summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Makefile28
-rw-r--r--constants/battle_anim_constants.asm2
-rw-r--r--constants/battle_tower_constants.asm2
-rw-r--r--constants/map_object_constants.asm3
-rw-r--r--constants/pokemon_data_constants.asm12
-rw-r--r--constants/script_constants.asm2
-rw-r--r--constants/sfx_constants.asm4
-rw-r--r--constants/wram_constants.asm28
-rw-r--r--data/events/odd_eggs.asm30
-rw-r--r--data/maps/attributes.asm2
-rw-r--r--data/phone/phone_contacts.asm78
-rw-r--r--data/phone/special_calls.asm14
-rw-r--r--data/phone/text/alan_callee.asm59
-rw-r--r--data/phone/text/alan_caller.asm98
-rw-r--r--data/phone/text/anthony_callee.asm73
-rw-r--r--data/phone/text/anthony_caller.asm139
-rw-r--r--data/phone/text/arnie_callee.asm62
-rw-r--r--data/phone/text/arnie_caller.asm106
-rw-r--r--data/phone/text/beth_callee.asm79
-rw-r--r--data/phone/text/beth_caller.asm98
-rw-r--r--data/phone/text/beverly_callee.asm68
-rw-r--r--data/phone/text/beverly_caller.asm82
-rw-r--r--data/phone/text/bike_shop.asm19
-rw-r--r--data/phone/text/bill.asm4
-rw-r--r--data/phone/text/brent_callee.asm79
-rw-r--r--data/phone/text/brent_caller.asm163
-rw-r--r--data/phone/text/chad_callee.asm78
-rw-r--r--data/phone/text/chad_caller.asm245
-rw-r--r--data/phone/text/dana_callee.asm68
-rw-r--r--data/phone/text/dana_caller.asm110
-rw-r--r--data/phone/text/derek_callee.asm64
-rw-r--r--data/phone/text/derek_caller.asm105
-rw-r--r--data/phone/text/erin_callee.asm68
-rw-r--r--data/phone/text/erin_caller.asm67
-rw-r--r--data/phone/text/extra.asm1737
-rw-r--r--data/phone/text/extra2.asm1795
-rw-r--r--data/phone/text/gaven_callee.asm72
-rw-r--r--data/phone/text/gaven_caller.asm85
-rw-r--r--data/phone/text/gina_callee.asm66
-rw-r--r--data/phone/text/gina_caller.asm119
-rw-r--r--data/phone/text/huey_callee.asm59
-rw-r--r--data/phone/text/huey_caller.asm43
-rw-r--r--data/phone/text/irwin_callee.asm56
-rw-r--r--data/phone/text/irwin_caller.asm289
-rw-r--r--data/phone/text/jack_callee.asm71
-rw-r--r--data/phone/text/jack_caller.asm193
-rw-r--r--data/phone/text/joey_callee.asm73
-rw-r--r--data/phone/text/joey_caller.asm91
-rw-r--r--data/phone/text/jose_callee.asm69
-rw-r--r--data/phone/text/jose_caller.asm130
-rw-r--r--data/phone/text/kenji_callee.asm44
-rw-r--r--data/phone/text/kenji_caller.asm63
-rw-r--r--data/phone/text/liz_callee.asm81
-rw-r--r--data/phone/text/liz_caller.asm308
-rw-r--r--data/phone/text/parry_callee.asm72
-rw-r--r--data/phone/text/parry_caller.asm69
-rw-r--r--data/phone/text/ralph_callee.asm59
-rw-r--r--data/phone/text/ralph_caller.asm133
-rw-r--r--data/phone/text/reena_callee.asm72
-rw-r--r--data/phone/text/reena_caller.asm88
-rw-r--r--data/phone/text/tiffany_callee.asm78
-rw-r--r--data/phone/text/tiffany_caller.asm137
-rw-r--r--data/phone/text/todd_callee.asm70
-rw-r--r--data/phone/text/todd_caller.asm117
-rw-r--r--data/phone/text/trainers.asm1991
-rw-r--r--data/phone/text/tully_callee.asm67
-rw-r--r--data/phone/text/tully_caller.asm104
-rw-r--r--data/phone/text/unknown_callee.asm30
-rw-r--r--data/phone/text/unused.asm3
-rw-r--r--data/phone/text/vance_callee.asm81
-rw-r--r--data/phone/text/vance_caller.asm64
-rw-r--r--data/phone/text/wade_callee.asm77
-rw-r--r--data/phone/text/wade_caller.asm136
-rw-r--r--data/phone/text/wilton_callee.asm64
-rw-r--r--data/phone/text/wilton_caller.asm103
-rw-r--r--data/text/std_text.asm4
-rw-r--r--docs/bugs_and_glitches.md191
-rw-r--r--engine/battle/battle_transition.asm2
-rw-r--r--engine/battle/core.asm15
-rw-r--r--engine/battle/effect_commands.asm2
-rw-r--r--engine/battle/move_effects/present.asm2
-rw-r--r--engine/battle_anims/anim_commands.asm2
-rw-r--r--engine/battle_anims/bg_effects.asm4
-rw-r--r--engine/battle_anims/core.asm4
-rw-r--r--engine/battle_anims/functions.asm245
-rw-r--r--engine/events/battle_tower/battle_tower.asm2
-rw-r--r--engine/events/battle_tower/load_trainer.asm10
-rw-r--r--engine/events/checksave.asm2
-rw-r--r--engine/events/map_name_sign.asm2
-rw-r--r--engine/events/mom_phone.asm2
-rw-r--r--engine/events/odd_egg.asm14
-rw-r--r--engine/games/unown_puzzle.asm4
-rw-r--r--engine/gfx/pic_animation.asm4
-rw-r--r--engine/gfx/player_gfx.asm6
-rw-r--r--engine/menus/debug.asm8
-rw-r--r--engine/menus/save.asm8
-rw-r--r--engine/movie/title.asm4
-rw-r--r--engine/overworld/events.asm24
-rw-r--r--engine/overworld/map_objects.asm58
-rw-r--r--engine/overworld/overworld.asm2
-rw-r--r--engine/overworld/player_step.asm6
-rw-r--r--engine/overworld/scripting.asm30
-rw-r--r--engine/overworld/warp_connection.asm4
-rw-r--r--engine/phone/phone_gossip.asm698
-rw-r--r--engine/phone/phone_scripts.asm1885
-rw-r--r--engine/phone/scripts/alan.asm60
-rw-r--r--engine/phone/scripts/anthony.asm61
-rw-r--r--engine/phone/scripts/arnie.asm64
-rw-r--r--engine/phone/scripts/beth.asm39
-rw-r--r--engine/phone/scripts/beverly.asm26
-rw-r--r--engine/phone/scripts/bike_shop.asm5
-rw-r--r--engine/phone/scripts/bill.asm41
-rw-r--r--engine/phone/scripts/brent.asm44
-rw-r--r--engine/phone/scripts/brent_gossip.asm62
-rw-r--r--engine/phone/scripts/buena.asm (renamed from engine/phone/buenas_password.asm)4
-rw-r--r--engine/phone/scripts/chad.asm49
-rw-r--r--engine/phone/scripts/chad_gossip.asm62
-rw-r--r--engine/phone/scripts/dana.asm65
-rw-r--r--engine/phone/scripts/derek.asm48
-rw-r--r--engine/phone/scripts/elm.asm101
-rw-r--r--engine/phone/scripts/erin.asm40
-rw-r--r--engine/phone/scripts/gaven.asm44
-rw-r--r--engine/phone/scripts/generic_callee.asm (renamed from engine/phone/generic_calls.asm)0
-rw-r--r--engine/phone/scripts/generic_caller.asm (renamed from engine/phone/phone_callers.asm)0
-rw-r--r--engine/phone/scripts/gina.asm72
-rw-r--r--engine/phone/scripts/hangups.asm183
-rw-r--r--engine/phone/scripts/hangups_2.asm49
-rw-r--r--engine/phone/scripts/huey.asm41
-rw-r--r--engine/phone/scripts/irwin.asm19
-rw-r--r--engine/phone/scripts/irwin_gossip.asm88
-rw-r--r--engine/phone/scripts/jack.asm49
-rw-r--r--engine/phone/scripts/jack_gossip.asm68
-rw-r--r--engine/phone/scripts/joey.asm41
-rw-r--r--engine/phone/scripts/jose.asm59
-rw-r--r--engine/phone/scripts/kenji.asm9
-rw-r--r--engine/phone/scripts/liz.asm102
-rw-r--r--engine/phone/scripts/liz_gossip.asm62
-rw-r--r--engine/phone/scripts/mom.asm142
-rw-r--r--engine/phone/scripts/parry.asm40
-rw-r--r--engine/phone/scripts/ralph.asm59
-rw-r--r--engine/phone/scripts/reena.asm39
-rw-r--r--engine/phone/scripts/reminders.asm95
-rw-r--r--engine/phone/scripts/reminders_2.asm15
-rw-r--r--engine/phone/scripts/tiffany.asm98
-rw-r--r--engine/phone/scripts/todd.asm59
-rw-r--r--engine/phone/scripts/tully.asm60
-rw-r--r--engine/phone/scripts/unused.asm3
-rw-r--r--engine/phone/scripts/vance.asm40
-rw-r--r--engine/phone/scripts/wade.asm113
-rw-r--r--engine/phone/scripts/wilton.asm75
-rw-r--r--engine/rtc/timeset.asm2
-rw-r--r--engine/tilesets/tileset_anims.asm4
m---------extras0
-rw-r--r--gfx/pokemon/anims.asm2
-rw-r--r--gfx/pokemon/unown_anims.asm2
-rw-r--r--home/audio.asm2
-rw-r--r--home/init.asm2
-rw-r--r--home/map.asm8
-rw-r--r--home/scrolling_menu.asm2
-rw-r--r--home/window.asm4
-rw-r--r--main.asm116
-rw-r--r--maps/LakeOfRage.asm2
-rw-r--r--maps/Route36.asm2
-rw-r--r--mobile/mobile_5c.asm2
-rw-r--r--pokecrystal.link6
-rw-r--r--tools/gfx.py (renamed from gfx.py)7
-rw-r--r--tools/pokemontools/__init__.py1
-rw-r--r--tools/pokemontools/gfx.py938
-rw-r--r--tools/pokemontools/lz.py580
-rw-r--r--tools/pokemontools/png.py2650
-rw-r--r--wram.asm232
172 files changed, 12858 insertions, 8646 deletions
diff --git a/.gitmodules b/.gitmodules
index e5177ea1e..e69de29bb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "extras"]
- path = extras
- url = git://github.com/pret/pokemon-reverse-engineering-tools.git
diff --git a/Makefile b/Makefile
index c78a996ce..e213bf63c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,3 @@
-ifeq (,$(shell which sha1sum))
-SHA1 := shasum
-else
-SHA1 := sha1sum
-endif
-
-RGBASM := rgbasm
-RGBFIX := rgbfix
-RGBGFX := rgbgfx
-RGBLINK := rgblink
-
roms := pokecrystal.gbc pokecrystal11.gbc
crystal_obj := \
@@ -30,10 +19,25 @@ lib/mobile/main.o
crystal11_obj := $(crystal_obj:.o=11.o)
+### Build tools
+
+ifeq (,$(shell which sha1sum))
+SHA1 := shasum
+else
+SHA1 := sha1sum
+endif
+
+RGBDS ?=
+RGBASM ?= $(RGBDS)rgbasm
+RGBFIX ?= $(RGBDS)rgbfix
+RGBGFX ?= $(RGBDS)rgbgfx
+RGBLINK ?= $(RGBDS)rgblink
+
+
### Build targets
.SUFFIXES:
-.PHONY: all crystal crystal11 clean compare tools tidy
+.PHONY: all crystal crystal11 clean tidy compare tools
.SECONDEXPANSION:
.PRECIOUS:
.SECONDARY:
diff --git a/constants/battle_anim_constants.asm b/constants/battle_anim_constants.asm
index 91733cd34..c9eeac130 100644
--- a/constants/battle_anim_constants.asm
+++ b/constants/battle_anim_constants.asm
@@ -11,7 +11,7 @@
const BATTLEANIMSTRUCT_YCOORD
const BATTLEANIMSTRUCT_XOFFSET
const BATTLEANIMSTRUCT_YOFFSET
- const BATTLEANIMSTRUCT_0B
+ const BATTLEANIMSTRUCT_PARAM
const BATTLEANIMSTRUCT_DURATION
const BATTLEANIMSTRUCT_FRAME
const BATTLEANIMSTRUCT_ANON_JT_INDEX
diff --git a/constants/battle_tower_constants.asm b/constants/battle_tower_constants.asm
index 0965d626a..9bf7bd7aa 100644
--- a/constants/battle_tower_constants.asm
+++ b/constants/battle_tower_constants.asm
@@ -5,7 +5,7 @@ BATTLETOWER_NUM_UNIQUE_MON EQU 21
BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70
BATTLETOWER_TRAINERDATALENGTH EQU $24
-BATTLE_TOWER_STRUCT_LENGTH EQU $e0 ; NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * (PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH) + BATTLETOWER_TRAINERDATALENGTH
+BATTLE_TOWER_STRUCT_LENGTH EQUS "(NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKNAMED_MON_STRUCT_LENGTH + BATTLETOWER_TRAINERDATALENGTH)"
; BattleTowerAction writebyte arguments (see engine/events/battle_tower/battle_tower.asm)
const_def
diff --git a/constants/map_object_constants.asm b/constants/map_object_constants.asm
index 55a3f358b..00ddb772a 100644
--- a/constants/map_object_constants.asm
+++ b/constants/map_object_constants.asm
@@ -70,6 +70,9 @@ EMOTE_OBJECT EQU 1 << EMOTE_OBJECT_F
const OBJ_FLAGS2_2 ; 2
const OVERHEAD_F ; 3
const USE_OBP1_F ; 4
+ const OBJ_FLAGS2_5 ; 5
+ const OBJ_FLAGS2_6 ; 6
+ const OBJ_FLAGS2_7 ; 7
LOW_PRIORITY EQU 1 << LOW_PRIORITY_F
HIGH_PRIORITY EQU 1 << HIGH_PRIORITY_F
diff --git a/constants/pokemon_data_constants.asm b/constants/pokemon_data_constants.asm
index 1aedf20cb..ac88133d6 100644
--- a/constants/pokemon_data_constants.asm
+++ b/constants/pokemon_data_constants.asm
@@ -97,6 +97,8 @@ MON_SAT EQUS "(wPartyMon1SpclAtk - wPartyMon1)"
MON_SDF EQUS "(wPartyMon1SpclDef - wPartyMon1)"
BOXMON_STRUCT_LENGTH EQUS "(wPartyMon1End - wPartyMon1)"
PARTYMON_STRUCT_LENGTH EQUS "(wPartyMon1StatsEnd - wPartyMon1)"
+
+NICKNAMED_MON_STRUCT_LENGTH EQUS "(PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH)"
REDMON_STRUCT_LENGTH EQU 44
; caught data
@@ -121,9 +123,9 @@ MONS_PER_BOX EQU 20
NUM_BOXES EQU 14
; hall of fame
-HOF_MON_LENGTH = 1 + 2 + 2 + 1 + (MON_NAME_LENGTH + -1) ; species, id, dvs, level, nick
-HOF_LENGTH = 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator
-NUM_HOF_TEAMS = 30
+HOF_MON_LENGTH EQU 1 + 2 + 2 + 1 + (MON_NAME_LENGTH + -1) ; species, id, dvs, level, nick
+HOF_LENGTH EQU 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator
+NUM_HOF_TEAMS EQU 30
; evolution types (used in data/pokemon/evos_attacks.asm)
const_def 1
@@ -150,8 +152,8 @@ NUM_HOF_TEAMS = 30
NUM_GRASSMON EQU 7 ; data/wild/*_grass.asm table size
NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size
-GRASS_WILDDATA_LENGTH EQU (NUM_GRASSMON * 2 + 1) * 3 + 2
-WATER_WILDDATA_LENGTH EQU (NUM_WATERMON * 2 + 1) * 1 + 2
+GRASS_WILDDATA_LENGTH EQU 2 + (1 + NUM_GRASSMON * 2) * 3
+WATER_WILDDATA_LENGTH EQU 2 + (1 + NUM_WATERMON * 2) * 1
FISHGROUP_DATA_LENGTH EQU 1 + 2 * 3
NUM_ROAMMON_MAPS EQU 16 ; RoamMaps table size (see data/wild/roammon_maps.asm)
diff --git a/constants/script_constants.asm b/constants/script_constants.asm
index a31394a36..34f2bc864 100644
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -163,7 +163,7 @@ NUM_CMDQUEUE_TYPES EQU const_value
const EMOTE_ROD ; 9
const EMOTE_BOULDER_DUST ; 10
const EMOTE_GRASS_RUSTLE ; 11
-EMOTE_MEM EQU -1
+EMOTE_FROM_MEM EQU -1
; fruittree arguments
; FruitTreeItems indexes (see data/items/fruit_trees.asm)
diff --git a/constants/sfx_constants.asm b/constants/sfx_constants.asm
index 37fd908db..b58af59ea 100644
--- a/constants/sfx_constants.asm
+++ b/constants/sfx_constants.asm
@@ -189,10 +189,10 @@
const SFX_TRAIN_ARRIVED ; b9
const SFX_STOP_SLOT ; ba
const SFX_2_BOOPS ; bb
- const SFX_GLASS_TING ; bc
- const SFX_GLASS_TING_2 ; bd
; new to Crystal
+ const SFX_GLASS_TING ; bc
+ const SFX_GLASS_TING_2 ; bd
const SFX_INTRO_UNOWN_1 ; be
const SFX_INTRO_UNOWN_2 ; bf
const SFX_INTRO_UNOWN_3 ; c0
diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm
index abdef53e9..1c8ff5192 100644
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -94,6 +94,13 @@ REMOVE_BOX EQU 1
DAY_CARE_WITHDRAW EQU 2
DAY_CARE_DEPOSIT EQU 3
+; wPlayerStepFlags:: ; d150
+ const_def 4
+ const PLAYERSTEP_MIDAIR_F ; 4
+ const PLAYERSTEP_CONTINUE_F ; 5
+ const PLAYERSTEP_STOP_F ; 6
+ const PLAYERSTEP_START_F ; 7
+
; wInitListType:: ; d263
INIT_ENEMYOT_LIST EQU 1
INIT_BAG_ITEM_LIST EQU 2
@@ -126,14 +133,27 @@ PLAYERSPRITESETUP_RESET_ACTION_F EQU 7
; wPlayerGender:: ; d472
PLAYERGENDER_FEMALE_F EQU 0
+; wMapStatus:: ; d432
+ const_def
+ const MAPSTATUS_START ; 0
+ const MAPSTATUS_ENTER ; 1
+ const MAPSTATUS_HANDLE ; 2
+ const MAPSTATUS_DONE ; 3
+
+; wMapEventStatus:: ; d433
+ const_def
+ const MAPEVENTS_ON ; 0
+ const MAPEVENTS_OFF ; 1
+
; wScriptFlags:: ; d434
SCRIPT_RUNNING EQU 2
; wScriptMode:: ; d437
-SCRIPT_OFF EQU 0
-SCRIPT_READ EQU 1
-SCRIPT_WAIT_MOVEMENT EQU 2
-SCRIPT_WAIT EQU 3
+ const_def
+ const SCRIPT_OFF
+ const SCRIPT_READ
+ const SCRIPT_WAIT_MOVEMENT
+ const SCRIPT_WAIT
; wSpawnAfterChampion:: ; d4b5
SPAWN_LANCE EQU 1
diff --git a/data/events/odd_eggs.asm b/data/events/odd_eggs.asm
index a3c942ff7..5b251645a 100644
--- a/data/events/odd_eggs.asm
+++ b/data/events/odd_eggs.asm
@@ -29,7 +29,6 @@ prob_total = 0
OddEggs:
-OddEgg1:
db PICHU
db NO_ITEM
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
@@ -43,7 +42,7 @@ OddEgg1:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 30, 20, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -55,7 +54,6 @@ OddEgg1:
bigdw 8 ; SAtk
bigdw 8 ; SDef
db "EGG@@@@@@@@"
-OddEgg1End:
db PICHU
db NO_ITEM
@@ -70,7 +68,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 30, 20, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -96,7 +94,7 @@ OddEgg1End:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 35, 20, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -122,7 +120,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 35, 20, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -148,7 +146,7 @@ OddEgg1End:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 15, 20, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -174,7 +172,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 15, 20, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -200,7 +198,7 @@ OddEgg1End:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 35, 30, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -226,7 +224,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 35, 30, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -252,7 +250,7 @@ OddEgg1End:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 25, 10, 0, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -278,7 +276,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 25, 10, 0, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -304,7 +302,7 @@ OddEgg1End:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 30, 30, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -330,7 +328,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 30, 30, 10, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -356,7 +354,7 @@ OddEgg1End:
bigdw 0
dn 0, 0, 0, 0 ; DVs
db 35, 10, 0, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
@@ -382,7 +380,7 @@ OddEgg1End:
bigdw 0
dn 2, 10, 10, 10 ; DVs
db 35, 10, 0, 0 ; PP
- db 20 ; Happiness
+ db 20 ; Step cycles to hatch
db 0, 0, 0 ; Pokerus, Caught data
db 5 ; Level
db 0, 0 ; Status
diff --git a/data/maps/attributes.asm b/data/maps/attributes.asm
index 7e7642fc1..0b49a351a 100644
--- a/data/maps/attributes.asm
+++ b/data/maps/attributes.asm
@@ -10,7 +10,7 @@ CURRENT_MAP_HEIGHT = \2_HEIGHT
db CURRENT_MAP_HEIGHT, CURRENT_MAP_WIDTH
db BANK(\1_Blocks)
dw \1_Blocks
- db BANK(\1_MapScripts) ; BANK(\1_MapEvents)
+ db BANK(\1_MapScripts) ; aka BANK(\1_MapEvents)
dw \1_MapScripts
dw \1_MapEvents
db \4
diff --git a/data/phone/phone_contacts.asm b/data/phone/phone_contacts.asm
index a7a774507..0c67e5109 100644
--- a/data/phone/phone_contacts.asm
+++ b/data/phone/phone_contacts.asm
@@ -1,5 +1,5 @@
phone: MACRO
-; trainer class, trainer id, map, time 1, script 1, time 2, script 2
+; trainer class, trainer id, map, callee time, callee script, caller time, caller script
db \1, \2
map_id \3
db \4
@@ -10,41 +10,41 @@ ENDM
PhoneContacts:
; entries correspond to PHONE_* constants
- phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
- phone TRAINER_NONE, PHONECONTACT_MOM, PLAYERS_HOUSE_1F, ANYTIME, MomPhoneScript, 0, UnusedPhoneScript
- phone TRAINER_NONE, PHONECONTACT_BIKESHOP, OAKS_LAB, 0, UnusedPhoneScript, 0, UnusedPhoneScript
- phone TRAINER_NONE, PHONECONTACT_BILL, N_A, ANYTIME, BillPhoneScript1, 0, BillPhoneScript2
- phone TRAINER_NONE, PHONECONTACT_ELM, ELMS_LAB, ANYTIME, ElmPhoneScript1, 0, ElmPhoneScript2
- phone SCHOOLBOY, JACK1, NATIONAL_PARK, ANYTIME, JackPhoneScript1, ANYTIME, JackPhoneScript2
- phone POKEFANF, BEVERLY1, NATIONAL_PARK, ANYTIME, BeverlyPhoneScript1, ANYTIME, BeverlyPhoneScript2
- phone SAILOR, HUEY1, OLIVINE_LIGHTHOUSE_2F, ANYTIME, HueyPhoneScript1, ANYTIME, HueyPhoneScript2
- phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
- phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
- phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
- phone COOLTRAINERM, GAVEN3, ROUTE_26, ANYTIME, GavenPhoneScript1, ANYTIME, GavenPhoneScript2
- phone COOLTRAINERF, BETH1, ROUTE_26, ANYTIME, BethPhoneScript1, ANYTIME, BethPhoneScript2
- phone BIRD_KEEPER, JOSE2, ROUTE_27, ANYTIME, JosePhoneScript1, ANYTIME, JosePhoneScript2
- phone COOLTRAINERF, REENA1, ROUTE_27, ANYTIME, ReenaPhoneScript1, ANYTIME, ReenaPhoneScript2
- phone YOUNGSTER, JOEY1, ROUTE_30, ANYTIME, JoeyPhoneScript1, ANYTIME, JoeyPhoneScript2
- phone BUG_CATCHER, WADE1, ROUTE_31, ANYTIME, WadePhoneScript1, ANYTIME, WadePhoneScript2
- phone FISHER, RALPH1, ROUTE_32, ANYTIME, RalphPhoneScript1, ANYTIME, RalphPhoneScript2
- phone PICNICKER, LIZ1, ROUTE_32, ANYTIME, LizPhoneScript1, ANYTIME, LizPhoneScript2
- phone HIKER, ANTHONY2, ROUTE_33, ANYTIME, AnthonyPhoneScript1, ANYTIME, AnthonyPhoneScript2
- phone CAMPER, TODD1, ROUTE_34, ANYTIME, ToddPhoneScript1, ANYTIME, ToddPhoneScript2
- phone PICNICKER, GINA1, ROUTE_34, ANYTIME, GinaPhoneScript1, ANYTIME, GinaPhoneScript2
- phone JUGGLER, IRWIN1, ROUTE_35, ANYTIME, IrwinPhoneScript1, ANYTIME, IrwinPhoneScript2
- phone BUG_CATCHER, ARNIE1, ROUTE_35, ANYTIME, ArniePhoneScript1, ANYTIME, ArniePhoneScript2
- phone SCHOOLBOY, ALAN1, ROUTE_36, ANYTIME, AlanPhoneScript1, ANYTIME, AlanPhoneScript2
- phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
- phone LASS, DANA1, ROUTE_38, ANYTIME, DanaPhoneScript1, ANYTIME, DanaPhoneScript2
- phone SCHOOLBOY, CHAD1, ROUTE_38, ANYTIME, ChadPhoneScript1, ANYTIME, ChadPhoneScript2
- phone POKEFANM, DEREK1, ROUTE_39, ANYTIME, DerekPhoneScript1, ANYTIME, DerekPhoneScript2
- phone FISHER, TULLY1, ROUTE_42, ANYTIME, TullyPhoneScript1, ANYTIME, TullyPhoneScript2
- phone POKEMANIAC, BRENT1, ROUTE_43, ANYTIME, BrentPhoneScript1, ANYTIME, BrentPhoneScript2
- phone PICNICKER, TIFFANY3, ROUTE_43, ANYTIME, TiffanyPhoneScript1, ANYTIME, TiffanyPhoneScript2
- phone BIRD_KEEPER, VANCE1, ROUTE_44, ANYTIME, VancePhoneScript1, ANYTIME, VancePhoneScript2
- phone FISHER, WILTON1, ROUTE_44, ANYTIME, WiltonPhoneScript1, ANYTIME, WiltonPhoneScript2
- phone BLACKBELT_T, KENJI3, ROUTE_45, ANYTIME, KenjiPhoneScript1, ANYTIME, KenjiPhoneScript2
- phone HIKER, PARRY1, ROUTE_45, ANYTIME, ParryPhoneScript1, ANYTIME, ParryPhoneScript2
- phone PICNICKER, ERIN1, ROUTE_46, ANYTIME, ErinPhoneScript1, ANYTIME, ErinPhoneScript2
- phone TRAINER_NONE, PHONECONTACT_BUENA, GOLDENROD_DEPT_STORE_ROOF, ANYTIME, BuenaPhoneScript1, ANYTIME, BuenaPhoneScript2
+ phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
+ phone TRAINER_NONE, PHONECONTACT_MOM, PLAYERS_HOUSE_1F, ANYTIME, MomPhoneCalleeScript, 0, UnusedPhoneScript
+ phone TRAINER_NONE, PHONECONTACT_BIKESHOP, OAKS_LAB, 0, UnusedPhoneScript, 0, UnusedPhoneScript
+ phone TRAINER_NONE, PHONECONTACT_BILL, N_A, ANYTIME, BillPhoneCalleeScript, 0, BillPhoneCallerScript
+ phone TRAINER_NONE, PHONECONTACT_ELM, ELMS_LAB, ANYTIME, ElmPhoneCalleeScript, 0, ElmPhoneCallerScript
+ phone SCHOOLBOY, JACK1, NATIONAL_PARK, ANYTIME, JackPhoneCalleeScript, ANYTIME, JackPhoneCallerScript
+ phone POKEFANF, BEVERLY1, NATIONAL_PARK, ANYTIME, BeverlyPhoneCalleeScript, ANYTIME, BeverlyPhoneCallerScript
+ phone SAILOR, HUEY1, OLIVINE_LIGHTHOUSE_2F, ANYTIME, HueyPhoneCalleeScript, ANYTIME, HueyPhoneCallerScript
+ phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
+ phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
+ phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
+ phone COOLTRAINERM, GAVEN3, ROUTE_26, ANYTIME, GavenPhoneCalleeScript, ANYTIME, GavenPhoneCallerScript
+ phone COOLTRAINERF, BETH1, ROUTE_26, ANYTIME, BethPhoneCalleeScript, ANYTIME, BethPhoneCallerScript
+ phone BIRD_KEEPER, JOSE2, ROUTE_27, ANYTIME, JosePhoneCalleeScript, ANYTIME, JosePhoneCallerScript
+ phone COOLTRAINERF, REENA1, ROUTE_27, ANYTIME, ReenaPhoneCalleeScript, ANYTIME, ReenaPhoneCallerScript
+ phone YOUNGSTER, JOEY1, ROUTE_30, ANYTIME, JoeyPhoneCalleeScript, ANYTIME, JoeyPhoneCallerScript
+ phone BUG_CATCHER, WADE1, ROUTE_31, ANYTIME, WadePhoneCalleeScript, ANYTIME, WadePhoneCallerScript
+ phone FISHER, RALPH1, ROUTE_32, ANYTIME, RalphPhoneCalleeScript, ANYTIME, RalphPhoneCallerScript
+ phone PICNICKER, LIZ1, ROUTE_32, ANYTIME, LizPhoneCalleeScript, ANYTIME, LizPhoneCallerScript
+ phone HIKER, ANTHONY2, ROUTE_33, ANYTIME, AnthonyPhoneCalleeScript, ANYTIME, AnthonyPhoneCallerScript
+ phone CAMPER, TODD1, ROUTE_34, ANYTIME, ToddPhoneCalleeScript, ANYTIME, ToddPhoneCallerScript
+ phone PICNICKER, GINA1, ROUTE_34, ANYTIME, GinaPhoneCalleeScript, ANYTIME, GinaPhoneCallerScript
+ phone JUGGLER, IRWIN1, ROUTE_35, ANYTIME, IrwinPhoneCalleeScript, ANYTIME, IrwinPhoneCallerScript
+ phone BUG_CATCHER, ARNIE1, ROUTE_35, ANYTIME, ArniePhoneCalleeScript, ANYTIME, ArniePhoneCallerScript
+ phone SCHOOLBOY, ALAN1, ROUTE_36, ANYTIME, AlanPhoneCalleeScript, ANYTIME, AlanPhoneCallerScript
+ phone TRAINER_NONE, PHONE_00, N_A, 0, UnusedPhoneScript, 0, UnusedPhoneScript
+ phone LASS, DANA1, ROUTE_38, ANYTIME, DanaPhoneCalleeScript, ANYTIME, DanaPhoneCallerScript
+ phone SCHOOLBOY, CHAD1, ROUTE_38, ANYTIME, ChadPhoneCalleeScript, ANYTIME, ChadPhoneCallerScript
+ phone POKEFANM, DEREK1, ROUTE_39, ANYTIME, DerekPhoneCalleeScript, ANYTIME, DerekPhoneCallerScript
+ phone FISHER, TULLY1, ROUTE_42, ANYTIME, TullyPhoneCalleeScript, ANYTIME, TullyPhoneCallerScript
+ phone POKEMANIAC, BRENT1, ROUTE_43, ANYTIME, BrentPhoneCalleeScript, ANYTIME, BrentPhoneCallerScript
+ phone PICNICKER, TIFFANY3, ROUTE_43, ANYTIME, TiffanyPhoneCalleeScript, ANYTIME, TiffanyPhoneCallerScript
+ phone BIRD_KEEPER, VANCE1, ROUTE_44, ANYTIME, VancePhoneCalleeScript, ANYTIME, VancePhoneCallerScript
+ phone FISHER, WILTON1, ROUTE_44, ANYTIME, WiltonPhoneCalleeScript, ANYTIME, WiltonPhoneCallerScript
+ phone BLACKBELT_T, KENJI3, ROUTE_45, ANYTIME, KenjiPhoneCalleeScript, ANYTIME, KenjiPhoneCallerScript
+ phone HIKER, PARRY1, ROUTE_45, ANYTIME, ParryPhoneCalleeScript, ANYTIME, ParryPhoneCallerScript
+ phone PICNICKER, ERIN1, ROUTE_46, ANYTIME, ErinPhoneCalleeScript, ANYTIME, ErinPhoneCallerScript
+ phone TRAINER_NONE, PHONECONTACT_BUENA, GOLDENROD_DEPT_STORE_ROOF, ANYTIME, BuenaPhoneCalleeScript, ANYTIME, BuenaPhoneCallerScript
diff --git a/data/phone/special_calls.asm b/data/phone/special_calls.asm
index 224ca2258..826a5d283 100644
--- a/data/phone/special_calls.asm
+++ b/data/phone/special_calls.asm
@@ -7,11 +7,11 @@ ENDM
SpecialPhoneCallList:
; entries correspond to SPECIALCALL_* constants
- specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2
- specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2
- specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2
- specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2
- specialcall SpecialCallWhereverYouAre, PHONECONTACT_ELM, ElmPhoneScript2
- specialcall SpecialCallWhereverYouAre, PHONECONTACT_BIKESHOP, BikeShopPhoneScript
+ specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneCallerScript
+ specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneCallerScript
+ specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneCallerScript
+ specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneCallerScript
+ specialcall SpecialCallWhereverYouAre, PHONECONTACT_ELM, ElmPhoneCallerScript
+ specialcall SpecialCallWhereverYouAre, PHONECONTACT_BIKESHOP, BikeShopPhoneCallerScript
specialcall SpecialCallWhereverYouAre, PHONECONTACT_MOM, MomPhoneLectureScript
- specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneScript2
+ specialcall SpecialCallOnlyWhenOutside, PHONECONTACT_ELM, ElmPhoneCallerScript
diff --git a/data/phone/text/alan_callee.asm b/data/phone/text/alan_callee.asm
new file mode 100644
index 000000000..a7f62f89d
--- /dev/null
+++ b/data/phone/text/alan_callee.asm
@@ -0,0 +1,59 @@
+UnknownText_0x1b659d:
+ text "Yup, it's @"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Is this <PLAY_G>?"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b65c7:
+ text "Yup, it's @"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Is that <PLAY_G>?"
+ done
+
+UnknownText_0x1b65e3:
+ text "Yup, it's @"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Is that <PLAY_G>?"
+ line "Good evening!"
+ done
+
+UnknownText_0x1b660d:
+ text "Hello! It's me,"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b6624:
+ text "Hello! It's me,"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b663b:
+ text "Hello! It's me,"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b6652:
+ text "<PLAY_G>, are you"
+ line "raising your"
+ cont "#MON properly?"
+
+ para "I read in a book"
+ line "that you should"
+
+ para "raise any #MON"
+ line "you catch with"
+ cont "love and care."
+ done
diff --git a/data/phone/text/alan_caller.asm b/data/phone/text/alan_caller.asm
new file mode 100644
index 000000000..fad41cafb
--- /dev/null
+++ b/data/phone/text/alan_caller.asm
@@ -0,0 +1,98 @@
+AlanGettingStrongerText:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "getting stronger,"
+
+ para "exactly as I"
+ line "calculated!"
+ done
+
+UnknownText_0x64cf3:
+ text "By the way, we"
+ line "knocked out a wild"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " just"
+ line "the other day."
+
+ para "Studying up in"
+ line "advance worked!"
+ done
+
+UnknownText_0x64d4f:
+ text "By the way, a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text " escaped"
+ cont "on me yesterday."
+
+ para "A computational"
+ line "error on my part…"
+ done
+
+UnknownText_0x64da4:
+ text "I've studied quite"
+ line "a bit since then,"
+
+ para "and I've gotten a"
+ line "lot better!"
+
+ para "I'm hanging out on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Can you come down"
+ line "for a battle?"
+ done
+
+UnknownText_0x64e1f:
+ text "See you later!"
+ done
+
+UnknownText_0x64e2f:
+ text "Hehehe, I picked"
+ line "up something nice!"
+
+ para "You can have it!"
+ line "Why don't you come"
+
+ para "to @"
+ text_ram wStringBuffer5
+ text_start
+ line "and pick it up?"
+ done
+
+UnknownText_0x64e90:
+ text "I haven't picked"
+ line "up anything yet."
+
+ para "I'll call you if I"
+ line "find something."
+ done
+
+UnknownText_0x64ed4:
+ text "If we don't battle"
+ line "soon, I'll forget"
+ cont "my strategy!"
+
+ para "I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x64f1a:
+ text "I have to do my"
+ line "homework, so can"
+
+ para "you come get your"
+ line "gift right away?"
+
+ para "I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/anthony_callee.asm b/data/phone/text/anthony_callee.asm
new file mode 100644
index 000000000..8919d41c2
--- /dev/null
+++ b/data/phone/text/anthony_callee.asm
@@ -0,0 +1,73 @@
+UnknownText_0x1b5f7a:
+ text "Yeah, @"
+ text_ram wStringBuffer3
+ text " the"
+ line "HIKER here."
+
+ para "Ah, <PLAYER>!"
+ done
+
+UnknownText_0x1b5f9e:
+ text "Yeah, @"
+ text_ram wStringBuffer3
+ text " the"
+ line "HIKER here."
+
+ para "Ah, <PLAYER>,"
+ line "right?"
+ done
+
+UnknownText_0x1b5fc9:
+ text "Yeah, @"
+ text_ram wStringBuffer3
+ text " the"
+ line "HIKER here."
+
+ para "Ah, <PLAYER>, isn't"
+ line "it?"
+ done
+
+UnknownText_0x1b5ff6:
+ text "Yo, <PLAYER>?"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text_start
+ line "the HIKER!"
+ done
+
+UnknownText_0x1b6017:
+ text "Hey, is this"
+ line "<PLAYER>?"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text_start
+ line "the HIKER!"
+ done
+
+UnknownText_0x1b6041:
+ text "<PLAYER>, you still"
+ line "awake?"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text_start
+ line "the HIKER!"
+ done
+
+UnknownText_0x1b606f:
+ text "Are your #MON"
+ line "as feisty as ever?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " and"
+ line "me--we have energy"
+
+ para "to burn. We hike"
+ line "up mountains every"
+
+ para "day to work out"
+ line "all our energy."
+ done
diff --git a/data/phone/text/anthony_caller.asm b/data/phone/text/anthony_caller.asm
new file mode 100644
index 000000000..5cbf011b7
--- /dev/null
+++ b/data/phone/text/anthony_caller.asm
@@ -0,0 +1,139 @@
+AnthonyAteBerriesText:
+ text "The other day, I"
+ line "was watching my"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " eat"
+ line "some BERRIES."
+
+ para "It looked like it"
+ line "was enjoying its"
+
+ para "meal, so I decided"
+ line "to try some."
+
+ para "I'm not sure if"
+ line "people should eat"
+
+ para "that stuff, but it"
+ line "was delicious!"
+ done
+
+UnknownText_0x176aef:
+ text "Lately, I've been"
+ line "running across"
+
+ para "wild @"
+ text_ram wStringBuffer4
+ text_start
+ line "quite often."
+
+ para "They're easily"
+ line "taken care of."
+ done
+
+UnknownText_0x176b45:
+ text "Oh yeah, I was"
+ line "battling this"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " the"
+ line "other day…"
+
+ para "It took off when I"
+ line "got distracted by"
+ cont "a passing BEAUTY."
+
+ para "Learn from my"
+ line "mistake--always"
+
+ para "stay focused on"
+ line "the job at hand!"
+ done
+
+UnknownText_0x176bee:
+ text "Come on--let's"
+ line "battle right now!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text " is"
+ line "where I am."
+
+ para "Come on down if"
+ line "you feel up to it!"
+ done
+
+UnknownText_0x176c47:
+ text "All right then!"
+ line "Be good!"
+ done
+
+UnknownText_0x176c61:
+ text "<PLAYER>! It's"
+ line "mind-blowing!"
+
+ para "I took a hike in"
+ line "@"
+ text_ram wStringBuffer5
+ text_start
+ cont "yesterday, see?"
+
+ para "Well, there were"
+ line "tons of @"
+ text_ram wStringBuffer4
+ text_start
+ para "around! You have"
+ line "to see it!"
+
+ para "I get this feeling"
+ line "that @"
+ text_ram wStringBuffer4
+ text_start
+ para "may be timid."
+ line "I didn't see any"
+
+ para "where there are"
+ line "strong #MON."
+ done
+
+UnknownText_0x176d32:
+ text "Rare #MON?"
+
+ para "Hey, sorry! I was"
+ line "too focused on my"
+
+ para "hike, so I wasn't"
+ line "paying attention."
+ done
+
+UnknownText_0x176d85:
+ text "Hello! You haven't"
+ line "forgotten about"
+
+ para "our battle, have"
+ line "you?"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "!"
+ line "I'm waiting!"
+ done
+
+UnknownText_0x176dd1:
+ text "Hello? What? Where"
+ line "is DUNSPARCE?"
+
+ para "DARK CAVE! Hurry!"
+
+ para "I know I've said"
+ line "it before, but"
+
+ para "DUNSPARCE don't"
+ line "appear when there"
+
+ para "are strong #MON"
+ line "around."
+ done
diff --git a/data/phone/text/arnie_callee.asm b/data/phone/text/arnie_callee.asm
new file mode 100644
index 000000000..ace24befe
--- /dev/null
+++ b/data/phone/text/arnie_callee.asm
@@ -0,0 +1,62 @@
+UnknownText_0x1b6454:
+ text "Yeah, hello."
+ line "This is @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "…Huh, <PLAY_G>? Yo!"
+ done
+
+UnknownText_0x1b647e:
+ text "Yeah, hello, you"
+ line "got @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "…Huh, <PLAY_G>? Yo!"
+ done
+
+UnknownText_0x1b64a8:
+ text "Yeah, hello, you"
+ line "got @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "…Huh, <PLAY_G>? Yo!"
+ done
+
+UnknownText_0x1b64d2:
+ text "Yeah, hello?"
+ line "@"
+ text_ram wStringBuffer3
+ text " calling."
+
+ para "What are you up"
+ line "to, <PLAY_G>?"
+ done
+
+UnknownText_0x1b6506:
+ text "Yeah, hello?"
+ line "@"
+ text_ram wStringBuffer3
+ text " calling."
+
+ para "Where are you now,"
+ line "<PLAY_G>?"
+ done
+
+UnknownText_0x1b6539:
+ text "Yeah, hello?"
+ line "@"
+ text_ram wStringBuffer3
+ text " calling."
+
+ para "Are you awake now,"
+ line "<PLAY_G>?"
+ done
+
+UnknownText_0x1b656c:
+ text "I bet your #MON"
+ line "are a lot stronger"
+ cont "than before."
+ done
diff --git a/data/phone/text/arnie_caller.asm b/data/phone/text/arnie_caller.asm
new file mode 100644
index 000000000..ce3a52b63
--- /dev/null
+++ b/data/phone/text/arnie_caller.asm
@@ -0,0 +1,106 @@
+ArnieLovesTheCuteText:
+ text "I'm always with my"
+ line "@"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "It's so cute!"
+ line "I just love it!"
+ done
+
+UnknownText_0x64a13:
+ text "Changing the topic"
+ line "here, I saw this"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " for the"
+ line "first time."
+
+ para "It was easy to"
+ line "beat, actually."
+ done
+
+UnknownText_0x64a71:
+ text "I was wondering,"
+ line "do you happen to"
+ cont "have @"
+ text_ram wStringBuffer4
+ text "?"
+
+ para "I can't seem to"
+ line "catch one. What is"
+
+ para "its weakness, I"
+ line "wonder."
+ done
+
+UnknownText_0x64ada:
+ text "Hey, let's battle"
+ line "our #MON!"
+
+ para "I won't lose to"
+ line "you battling or in"
+
+ para "the Bug-Catching"
+ line "Contest!"
+
+ para "I'll be here on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x64b48:
+ text "Let's talk again,"
+ line "huh?"
+ done
+
+UnknownText_0x64b5f:
+ text "Boy, am I glad I"
+ line "caught you!"
+
+ para "A whole bunch of"
+ line "@"
+ text_ram wStringBuffer4
+ text " have"
+
+ para "appeared around"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+
+ para "You have to see"
+ line "this!"
+ done
+
+UnknownText_0x64bc6:
+ text "I haven't had any"
+ line "luck seeing rare"
+ cont "#MON lately…"
+
+ para "But I know they're"
+ line "out there!"
+ done
+
+UnknownText_0x64c13:
+ text "Hey, where are you"
+ line "now?"
+
+ para "Let's battle. I'll"
+ line "be waiting for you"
+ cont "on @"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x64c5a:
+ text "Hello? Are you"
+ line "coming or what?"
+
+ para "You're missing out"
+ line "on seeing YANMA!"
+
+ para "Get down to ROUTE"
+ line "35 right now!"
+ done
diff --git a/data/phone/text/beth_callee.asm b/data/phone/text/beth_callee.asm
new file mode 100644
index 000000000..61bf7298f
--- /dev/null
+++ b/data/phone/text/beth_callee.asm
@@ -0,0 +1,79 @@
+UnknownText_0x1b53f7:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh, <PLAY_G>."
+ line "Good morning."
+
+ para ""
+ done
+
+UnknownText_0x1b5424:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh. Hi, <PLAY_G>."
+ done
+
+UnknownText_0x1b5446:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh, <PLAY_G>."
+ line "Good evening."
+ done
+
+UnknownText_0x1b5472:
+ text "Good morning,"
+ line "<PLAY_G>!"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text "."
+ line "Were you sleeping?"
+ done
+
+UnknownText_0x1b54a6:
+ text "<PLAY_G>, hi!"
+ line "This is @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Do you have some"
+ line "time?"
+ done
+
+UnknownText_0x1b54d4:
+ text "Hi, <PLAY_G>."
+ line "Good evening."
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "I hope you were"
+ line "awake."
+ done
+
+UnknownText_0x1b5510:
+ text "Are you the kind"
+ line "of person who goes"
+
+ para "to #MON CENTERS"
+ line "often?"
+
+ para "I go every day."
+ line "Watching out for"
+
+ para "the health of your"
+ line "#MON is a basic"
+
+ para "part of being a"
+ line "#MON trainer."
+ done
diff --git a/data/phone/text/beth_caller.asm b/data/phone/text/beth_caller.asm
new file mode 100644
index 000000000..d7cac6298
--- /dev/null
+++ b/data/phone/text/beth_caller.asm
@@ -0,0 +1,98 @@
+UnknownText_0x174c7f:
+ text "Do you remember my"
+ line "sweet @"
+ text_ram wStringBuffer4
+ text "?"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " runs"
+ line "very fast."
+
+ para "It's exhilarating"
+ line "to ride on its"
+
+ para "back when it"
+ line "really gets going."
+ done
+
+UnknownText_0x174cf6:
+ text "Oh, have you ever"
+ line "seen a @"
+ text_ram wStringBuffer4
+ text_start
+ cont "before?"
+
+ para "I just battled"
+ line "one…"
+
+ para "It was much faster"
+ line "than I expected."
+
+ para "I was a little"
+ line "shocked."
+
+ para "I still won, of"
+ line "course."
+ done
+
+UnknownText_0x174d86:
+ text "Oh, I just saw a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "I was trying to"
+ line "catch it when I"
+
+ para "noticed that I was"
+ line "all out of #"
+ cont "BALLS."
+
+ para "If you don't check"
+ line "your items, you"
+
+ para "may run out at the"
+ line "worst time."
+
+ para "I hope you learn"
+ line "from my mistake."
+ done
+
+UnknownText_0x174e4e:
+ text "Do you want to"
+ line "battle? I'm going"
+ cont "to win this time!"
+
+ para "I'll be waiting"
+ line "for you around"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "."
+ line "Look for me, OK?"
+ done
+
+UnknownText_0x174eb7:
+ text "OK, bye-bye!"
+ done
+
+UnknownText_0x174ec5:
+ text "Let's battle again"
+ line "sometime!"
+ done
+
+BethForgetDealText:
+ text "Um… <PLAY_G>?"
+ line "What's wrong?"
+
+ para "Did you forget our"
+ line "deal?"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "That's where I'm"
+ line "waiting."
+ done
diff --git a/data/phone/text/beverly_callee.asm b/data/phone/text/beverly_callee.asm
new file mode 100644
index 000000000..bac2e24bd
--- /dev/null
+++ b/data/phone/text/beverly_callee.asm
@@ -0,0 +1,68 @@
+UnknownText_0x1b4f21:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh! Good morning,"
+ line "<PLAYER>."
+ done
+
+UnknownText_0x1b4f4d:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh! Good day,"
+ line "<PLAYER>."
+ done
+
+UnknownText_0x1b4f75:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh! Good evening,"
+ line "<PLAYER>."
+ done
+
+UnknownText_0x1b4fa1:
+ text "Hello, <PLAYER>."
+ line "Good morning."
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text "."
+ line "Were you asleep?"
+ done
+
+UnknownText_0x1b4fda:
+ text "Hi, <PLAYER>."
+ line "This is @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "How are you doing?"
+ done
+
+UnknownText_0x1b5004:
+ text "Hi, <PLAYER>."
+ line "This is @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Were you awake?"
+ done
+
+UnknownText_0x1b502b:
+ text "Keeping your"
+ line "#MON happy?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "healthy. It eats a"
+ cont "lot every day."
+ done
diff --git a/data/phone/text/beverly_caller.asm b/data/phone/text/beverly_caller.asm
new file mode 100644
index 000000000..73fd4b215
--- /dev/null
+++ b/data/phone/text/beverly_caller.asm
@@ -0,0 +1,82 @@
+UnknownText_0x174688:
+ text "I fancied up my"
+ line "@"
+ text_ram wStringBuffer4
+ text " and"
+
+ para "made it even cuter"
+ line "than before!"
+ done
+
+UnknownText_0x1746c3:
+ text "I happened to come"
+ line "across a wild"
+ cont "SNUBBULL recently."
+
+ para "My SNUBBULL, I"
+ line "assure you, was"
+
+ para "far cuter than the"
+ line "wild one."
+ done
+
+UnknownText_0x174734:
+ text "I happened to see"
+ line "a wild MARILL the"
+
+ para "other day."
+ line "Or so I thought."
+
+ para "A closer look"
+ line "showed it was"
+
+ para "@"
+ text_ram wStringBuffer4
+ text ". I was"
+ line "quite miffed."
+ done
+
+UnknownText_0x1747ac:
+ text "You can expect a"
+ line "call from me."
+ done
+
+BeverlyFoundNuggetText:
+ text "My husband got"
+ line "some NUGGETS."
+
+ para "If you'd like, you"
+ line "could have one as"
+
+ para "thanks for helping"
+ line "me out."
+
+ para "I'll be at"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Please come see me"
+ line "when you can."
+ done
+
+UnknownText_0x17485b:
+ text "Are your #MON"
+ line "in prime form?"
+
+ para "Let's chat about"
+ line "#MON again."
+ done
+
+UnknownText_0x174895:
+ text "Pardon?"
+ line "Oh, the NUGGET?"
+
+ para "There's no need to"
+ line "hurry. Come see me"
+
+ para "in @"
+ text_ram wStringBuffer5
+ text_start
+ line "when you can."
+ done
diff --git a/data/phone/text/bike_shop.asm b/data/phone/text/bike_shop.asm
new file mode 100644
index 000000000..e410fc3be
--- /dev/null
+++ b/data/phone/text/bike_shop.asm
@@ -0,0 +1,19 @@
+UnknownText_0x174000:
+ text "Hi, <PLAY_G>!"
+ line "Our BICYCLE sales"
+
+ para "have gone through"
+ line "the roof!"
+
+ para "We owe it all to"
+ line "your advertising"
+
+ para "by riding around"
+ line "on our BICYCLE."
+
+ para "As our way of say-"
+ line "ing thanks, please"
+
+ para "keep that BICYCLE."
+ line "Thanks again!"
+ done
diff --git a/data/phone/text/bill.asm b/data/phone/text/bill.asm
index 7363741c4..c08e62749 100644
--- a/data/phone/text/bill.asm
+++ b/data/phone/text/bill.asm
@@ -34,8 +34,8 @@ BillPhoneGenericText:
para "<PLAY_G>, is it?"
line "Hang on a sec…"
- para $56
- line $56
+ para "<……>"
+ line "<……>"
done
BillPhoneNotFullText:
diff --git a/data/phone/text/brent_callee.asm b/data/phone/text/brent_callee.asm
new file mode 100644
index 000000000..9dcacdc4e
--- /dev/null
+++ b/data/phone/text/brent_callee.asm
@@ -0,0 +1,79 @@
+UnknownText_0x1b6c96:
+ text "Yes? @"
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "Ah, <PLAYER>. What"
+ line "can I do for you?"
+ done
+
+UnknownText_0x1b6cc6:
+ text "Yes? @"
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "Ah, <PLAYER>. What"
+ line "can I do for you?"
+ done
+
+UnknownText_0x1b6cf6:
+ text "Yes? @"
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "Ah, <PLAYER>. What"
+ line "can I do for you?"
+ done
+
+UnknownText_0x1b6d26:
+ text "Hiya, <PLAYER>. How"
+ line "are you doing?"
+
+ para "Hey! It's me,"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b6d57:
+ text "Hiya, <PLAYER>, how"
+ line "are you doing?"
+
+ para "Hey, it's me,"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b6d88:
+ text "Hiya, <PLAYER>, how"
+ line "are you doing?"
+
+ para "Hey, it's me,"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b6db9:
+ text "Oh yeah, I saw you"
+ line "coming out of a"
+
+ para "#MON CENTER the"
+ line "other day."
+
+ para "You heal your"
+ line "#MON regularly,"
+
+ para "don't you?"
+ line "I'm impressed."
+
+ para "Heh, my @"
+ text_ram wStringBuffer4
+ text_start
+ line "is so tough, it"
+
+ para "doesn't need to go"
+ line "to #MON CENTERS"
+ cont "often. Heheh!"
+ done
diff --git a/data/phone/text/brent_caller.asm b/data/phone/text/brent_caller.asm
new file mode 100644
index 000000000..dcca0840f
--- /dev/null
+++ b/data/phone/text/brent_caller.asm
@@ -0,0 +1,163 @@
+BrentRareTradeText:
+ text "Oh yeah, I got an"
+ line "extremely rare"
+
+ para "#MON in a trade"
+ line "a while back."
+
+ para "Do you want to"
+ line "know what it is?"
+
+ para "Hehe, I'm keeping"
+ line "it a secret!"
+ done
+
+UnknownText_0x6613c:
+ text "Oh yeah, I took"
+ line "down this wild"
+
+ para "@"
+ text_ram wStringBuffer4
+ text "."
+ line "It wasn't rare"
+
+ para "enough to bother"
+ line "catching."
+ done
+
+UnknownText_0x6618c:
+ text "Oh yeah, I saw a"
+ line "rare #MON about"
+ cont "an hour ago."
+
+ para "It was my first"
+ line "sighting. But I"
+
+ para "didn't have any"
+ line "# BALLS…"
+
+ para "Would BILL laugh"
+ line "at my mistakes?"
+ done
+
+UnknownText_0x66214:
+ text "You've got time"
+ line "like usual, right?"
+
+ para "Feel like having a"
+ line "battle?"
+
+ para "It'll be a chance"
+ line "to see my rare"
+
+ para "#MON. It'll be"
+ line "worth your time!"
+
+ para "You know where--"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x662a9:
+ text "So that's it then."
+ done
+
+UnknownText_0x662bc:
+ text "Did you know…?"
+ line "BILL's father is"
+
+ para "supposed to be a"
+ line "great #MANIAC."
+ done
+
+UnknownText_0x662fc:
+ text "Did you know…?"
+ line "Apparently BILL's"
+
+ para "grandpa isn't a"
+ line "#MANIAC."
+ done
+
+UnknownText_0x66335:
+ text "Did you know…?"
+ line "BILL's originally"
+ cont "from GOLDENROD."
+ done
+
+UnknownText_0x66366:
+ text "Did you know…?"
+ line "BILL evidently"
+
+ para "lives on ROUTE 25"
+ line "in KANTO."
+ done
+
+UnknownText_0x663a1:
+ text "Did you know…?"
+ line "ABRA was the first"
+
+ para "#MON that BILL"
+ line "ostensibly caught."
+ done
+
+UnknownText_0x663e6:
+ text "Did you know…?"
+ line "BILL's younger"
+
+ para "sister apparently"
+ line "can't wink."
+ done
+
+UnknownText_0x66421:
+ text "Did you know…?"
+ line "BILL supposedly"
+
+ para "hates milk and"
+ line "can't drink it."
+ done
+
+UnknownText_0x6645f:
+ text "Did you know…?"
+ line "Evidently, BILL"
+
+ para "isn't very good at"
+ line "battling."
+ done
+
+UnknownText_0x6649b:
+ text "Did you know…?"
+ line "BILL appears to"
+
+ para "like the lady at"
+ line "the FLOWER SHOP."
+ done
+
+UnknownText_0x664dd:
+ text "Did you know…?"
+ line "BILL's mother is"
+
+ para "said to have been"
+ line "a KIMONO GIRL."
+ done
+
+UnknownText_0x6651e:
+ text "You wanted to hear"
+ line "about BILL?"
+
+ para "Sorry, but I'm too"
+ line "busy for you."
+
+ para "I'll call when I"
+ line "have time."
+ done
+
+UnknownText_0x66579:
+ text "You want to see my"
+ line "rare #MON."
+
+ para "Hurry over to"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
diff --git a/data/phone/text/chad_callee.asm b/data/phone/text/chad_callee.asm
new file mode 100644
index 000000000..f7602dbe2
--- /dev/null
+++ b/data/phone/text/chad_callee.asm
@@ -0,0 +1,78 @@
+UnknownText_0x1b67e2:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Hi, <PLAY_G>!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b680e:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Hi, <PLAY_G>, good"
+ line "day!"
+ done
+
+UnknownText_0x1b6836:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Hi, <PLAY_G>, good"
+ line "evening!"
+ done
+
+UnknownText_0x1b6862:
+ text "Hi, <PLAY_G>, good"
+ line "morning!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you?"
+ done
+
+UnknownText_0x1b6890:
+ text "Hi, <PLAY_G>, good"
+ line "day!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you?"
+ done
+
+UnknownText_0x1b68ba:
+ text "Hi, <PLAY_G>, good"
+ line "evening!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you?"
+ done
+
+UnknownText_0x1b68e8:
+ text "How are your"
+ line "#MON doing?"
+
+ para "You know PROF.OAK,"
+ line "so of course your"
+ cont "#MON are fine!"
+
+ para "My #MON are"
+ line "doing well too."
+
+ para "But then, I am"
+ line "trying to become a"
+
+ para "#MON professor,"
+ line "so that shouldn't"
+ cont "be a big surprise."
+ done
diff --git a/data/phone/text/chad_caller.asm b/data/phone/text/chad_caller.asm
new file mode 100644
index 000000000..f65035c27
--- /dev/null
+++ b/data/phone/text/chad_caller.asm
@@ -0,0 +1,245 @@
+ChadObservingWildText:
+ text "I recently began"
+ line "observing wild"
+ cont "@"
+ text_ram wStringBuffer4
+ text "."
+
+ para "I've been learning"
+ line "all sorts of new"
+
+ para "things through my"
+ line "observations."
+
+ para "I wish I could"
+ line "become a #MON"
+
+ para "researcher like"
+ line "PROF.OAK soon."
+ done
+
+UnknownText_0x65318:
+ text "Oh yes, I managed"
+ line "to knock out a"
+
+ para "wild @"
+ text_ram wStringBuffer4
+ text " a"
+ line "while back."
+
+ para "Well, considering"
+ line "all the studying I"
+
+ para "do every day, it"
+ line "was inevitable."
+ done
+
+UnknownText_0x65399:
+ text "Oh yes, I came"
+ line "close to catching"
+
+ para "a wild @"
+ text_ram wStringBuffer4
+ text ","
+ line "but it got away."
+
+ para "For the longest"
+ line "time, I've been"
+
+ para "wanting to observe"
+ line "@"
+ text_ram wStringBuffer4
+ text ". Rats…"
+ done
+
+UnknownText_0x65419:
+ text "Want to battle?"
+ line "I have to battle"
+
+ para "every so often to"
+ line "avoid rusting out."
+
+ para "I'll be on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x65471:
+ text "See you later!"
+ done
+
+ChadBlueGossipText:
+ text "Do you know BLUE?"
+
+ para "He's PROF.OAK's"
+ line "grandson and a"
+
+ para "former #MON"
+ line "LEAGUE CHAMPION!"
+
+ para "He's one super"
+ line "#MON trainer!"
+ done
+
+ChadDaisyGossipText:
+ text "PROF.OAK has a"
+ line "granddaughter"
+ cont "named DAISY."
+
+ para "When she's around,"
+ line "even the most"
+
+ para "ferocious #MON"
+ line "calm right down."
+ done
+
+ChadProfElmGossipText:
+ text "Everyone's talking"
+ line "about PROF.ELM."
+
+ para "He used to be an"
+ line "assistant to the"
+ cont "great PROF.OAK!"
+
+ para "That is so cool!"
+ line "I envy him!"
+ done
+
+ChadDreamGossipText:
+ text "PROF.OAK's dream"
+ line "is to compile a"
+
+ para "comprehensive"
+ line "#DEX."
+
+ para "I envy you for"
+ line "taking part in"
+ cont "that project…"
+ done
+
+ChadKurtGossipText:
+ text "Do you know KURT,"
+ line "the BALL creator?"
+
+ para "He and PROF.OAK go"
+ line "back a long way."
+
+ para "I guess great"
+ line "people attract one"
+ cont "another!"
+ done
+
+ChadLeagueGossipText:
+ text "#MON LEAGUE is"
+ line "the great gather-"
+ cont "ing place for all"
+
+ para "trainers who wish"
+ line "to become CHAMP."
+
+ para "PROF.OAK acts as"
+ line "an advisor to the"
+
+ para "#MON LEAGUE's"
+ line "headquarters."
+
+ para "He really is a"
+ line "great man."
+ done
+
+ChadRadioShowGossipText:
+ text "PROF.OAK'S #MON"
+ line "TALK is a popular"
+ cont "radio show, right?"
+
+ para "Did you know that"
+ line "he was going to"
+
+ para "turn down the show"
+ line "at first?"
+
+ para "But MARY's energy"
+ line "and persistence"
+ cont "wore him down."
+
+ para "So we have MARY to"
+ line "thank for it!"
+ done
+
+ChadBattlingGossipText:
+ text "PROF.OAK used to"
+ line "be a trainer a"
+ cont "long time ago."
+
+ para "But rather than"
+ line "battling, he found"
+
+ para "#MON themselves"
+ line "to be interesting."
+
+ para "So he abandoned"
+ line "his training to"
+
+ para "focus on becoming"
+ line "a researcher."
+ done
+
+ChadDaisyTeaGossipText:
+ text "PROF.OAK has a"
+ line "granddaughter"
+ cont "named DAISY."
+
+ para "She has tea every"
+ line "day for an hour"
+
+ para "from three in the"
+ line "afternoon."
+
+ para "I wish I could"
+ line "join her for tea"
+
+ para "and chat about"
+ line "PROF.OAK."
+ done
+
+ChadTravelGossipText:
+ text "Did you know?"
+ line "PROF.OAK traveled"
+
+ para "all over the world"
+ line "when he was young."
+
+ para "While traveling,"
+ line "he must've learned"
+
+ para "about #MON"
+ line "naturally."
+
+ para "I envy him…"
+ line "I'd like to travel"
+
+ para "and learn about"
+ line "things too…"
+ done
+
+UnknownText_0x65a23:
+ text "I'm going to study"
+ line "hard so PROF.OAK"
+
+ para "will make me his"
+ line "assistant!"
+ done
+
+UnknownText_0x65a63:
+ text "Do you remember"
+ line "about our battle?"
+
+ para "The place is"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Hurry over--I'm"
+ line "waiting."
+ done
diff --git a/data/phone/text/dana_callee.asm b/data/phone/text/dana_callee.asm
new file mode 100644
index 000000000..8b90785bf
--- /dev/null
+++ b/data/phone/text/dana_callee.asm
@@ -0,0 +1,68 @@
+UnknownText_0x1b66c8:
+ text "Hi, @"
+ text_ram wStringBuffer3
+ text " on the"
+ line "line."
+
+ para "Hey! It's <PLAY_G>!"
+ done
+
+UnknownText_0x1b66ec:
+ text "Hi, @"
+ text_ram wStringBuffer3
+ text " on the"
+ line "line."
+
+ para "I know!"
+ line "It's <PLAY_G>!"
+ done
+
+UnknownText_0x1b6713:
+ text "Hi, @"
+ text_ram wStringBuffer3
+ text " on the"
+ line "line."
+
+ para "<PLAY_G>?"
+ line "What's up?"
+ done
+
+UnknownText_0x1b6738:
+ text "Uh, <PLAY_G>?"
+
+ para "It's me!"
+ line "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b6757:
+ text "Uh, <PLAY_G>?"
+
+ para "It's me!"
+ line "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b6776:
+ text "Uh, <PLAY_G>?"
+
+ para "It's me!"
+ line "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b6795:
+ text "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "so full of energy,"
+
+ para "it's a little"
+ line "scary."
+
+ para "How are your"
+ line "#MON doing?"
+ done
diff --git a/data/phone/text/dana_caller.asm b/data/phone/text/dana_caller.asm
new file mode 100644
index 000000000..0209b2ae2
--- /dev/null
+++ b/data/phone/text/dana_caller.asm
@@ -0,0 +1,110 @@
+UnknownText_0x64f74:
+ text "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "getting prettier!"
+
+ para "I've been taking"
+ line "photos galore!"
+ done
+
+UnknownText_0x64fb2:
+ text "It took only an"
+ line "instant to KO a"
+ cont "wild @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "It must be because"
+ line "you gave me some"
+
+ para "battling tips last"
+ line "time."
+ done
+
+UnknownText_0x6501c:
+ text "You know what?"
+ line "A wild @"
+ text_ram wStringBuffer4
+ text_start
+ para "got away from me"
+ line "again."
+
+ para "It was so close!"
+ line "Really, just a"
+
+ para "little bit more,"
+ line "and I would've…"
+ done
+
+UnknownText_0x65091:
+ text "Right now, I'm on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "If you're close"
+ line "by, let's battle!"
+
+ para "I'll be waiting"
+ line "for you!"
+ done
+
+UnknownText_0x650e2:
+ text "See you!"
+ done
+
+UnknownText_0x650ec:
+ text "You know what?"
+ line "I got a good gift!"
+
+ para "As I promised,"
+ line "it's yours!"
+
+ para "I'm sure you'd"
+ line "like it. Come get"
+
+ para "it! I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x65161:
+ text "Oh! You wanted a"
+ line "gift, right?"
+
+ para "I got one, but I"
+ line "want to keep this."
+
+ para "Can you wait a bit"
+ line "longer?"
+ done
+
+UnknownText_0x651bf:
+ text "Hi! You haven't"
+ line "forgotten about"
+
+ para "your promise to"
+ line "battle me?"
+
+ para "I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x6520f:
+ text "Hello?"
+
+ para "If you don't come"
+ line "get your present"
+
+ para "soon, I'll give it"
+ line "to someone else."
+
+ para "I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/derek_callee.asm b/data/phone/text/derek_callee.asm
new file mode 100644
index 000000000..be0784140
--- /dev/null
+++ b/data/phone/text/derek_callee.asm
@@ -0,0 +1,64 @@
+UnknownText_0x1b69a8:
+ text "Hi, <PLAY_G>?"
+
+ para "Good morning pika."
+ line "What's up pika?"
+ done
+
+UnknownText_0x1b69d2:
+ text "Hi, <PLAY_G>?"
+
+ para "Good day pika,"
+ line "what's up pika?"
+ done
+
+UnknownText_0x1b69f8:
+ text "Hi, <PLAY_G>?"
+
+ para "Good evening pika,"
+ line "what's up pika?"
+ done
+
+UnknownText_0x1b6a22:
+ text "<PLAY_G> pika, good"
+ line "morning!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text ", how"
+ line "pika are you?"
+ done
+
+UnknownText_0x1b6a56:
+ text "<PLAY_G> pika, good"
+ line "pika day!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text ", how"
+ line "pika are you?"
+ done
+
+UnknownText_0x1b6a8b:
+ text "<PLAY_G> pika, good"
+ line "evening!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text ". Were"
+ line "you pika awake?"
+ done
+
+UnknownText_0x1b6ac2:
+ text "You have to hear"
+ line "this! My lovable"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " looked"
+ line "at me and grinned!"
+
+ para "It must be because"
+ line "our hearts beat"
+ cont "together as one!"
+ done
diff --git a/data/phone/text/derek_caller.asm b/data/phone/text/derek_caller.asm
new file mode 100644
index 000000000..a96768faa
--- /dev/null
+++ b/data/phone/text/derek_caller.asm
@@ -0,0 +1,105 @@
+DerekCheekPincherText:
+ text "Listen to this."
+ line "My @"
+ text_ram wStringBuffer4
+ text_start
+ para "grins happily when"
+ line "I pinch its cheek."
+
+ para "But it never grins"
+ line "for anyone else."
+
+ para "I must be special."
+ done
+
+UnknownText_0x65b29:
+ text "Oh, and recently,"
+ line "my PIKACHU beat a"
+ cont "wild @"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "A wild @"
+ text_ram wStringBuffer4
+ text ","
+ line "I tell you!"
+
+ para "Don't you think"
+ line "that's astounding?"
+
+ para "My PIKACHU is"
+ line "awesome!"
+
+ para "My PIKACHU is the"
+ line "greatest!"
+ done
+
+UnknownText_0x65bc8:
+ text "Oh, and I saw a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text " a"
+ cont "little while ago."
+
+ para "But it wasn't very"
+ line "cute, so I left"
+
+ para "it…"
+ line "#MON have to be"
+
+ para "cute. They're no"
+ line "good otherwise."
+ done
+
+UnknownText_0x65c4e:
+ text "Well, let's talk"
+ line "again!"
+ done
+
+DerekBugCatchingContestText:
+ text "Did you remember?"
+ line "The Bug-Catching"
+ cont "Contest is today."
+
+ para "You're going to"
+ line "go, aren't you?"
+
+ para "I think I'll"
+ line "participate with"
+
+ para "PIKACHU to show"
+ line "off its cuteness."
+ done
+
+UnknownText_0x65cf9:
+ text "I'd like you to"
+ line "have a NUGGET."
+
+ para "My PIKACHU just"
+ line "loves it."
+
+ para "I'm certain your"
+ line "PIKACHU will love"
+ cont "it too!"
+ done
+
+UnknownText_0x65d5c:
+ text "How is your"
+ line "PIKACHU doing?"
+
+ para "Let's get together"
+ line "and brag about our"
+ cont "PIKACHU!"
+ done
+
+UnknownText_0x65da6:
+ text "What's wrong?"
+
+ para "I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Come pick this up"
+ line "anytime."
+ done
diff --git a/data/phone/text/erin_callee.asm b/data/phone/text/erin_callee.asm
new file mode 100644
index 000000000..a39a19f80
--- /dev/null
+++ b/data/phone/text/erin_callee.asm
@@ -0,0 +1,68 @@
+UnknownText_0x1b751a:
+ text "Yes, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh. Hi, <PLAY_G>!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b7548:
+ text "Yes, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, hi, <PLAY_G>!"
+ line "Yahoo!"
+ done
+
+UnknownText_0x1b756f:
+ text "Yes, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, hi, <PLAY_G>!"
+ done
+
+UnknownText_0x1b758f:
+ text "<PLAY_G>!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b75ac:
+ text "<PLAY_G>!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "!"
+ line "Working hard?"
+ done
+
+UnknownText_0x1b75c9:
+ text "<PLAY_G>!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "!"
+ line "Were you up?"
+ done
+
+UnknownText_0x1b75e5:
+ text "Are you raising"
+ line "your #MON?"
+
+ para "Hey, @"
+ text_ram wStringBuffer3
+ text "'s"
+ line "@"
+ text_ram wStringBuffer4
+ text " is"
+ cont "looking good!"
+ done
diff --git a/data/phone/text/erin_caller.asm b/data/phone/text/erin_caller.asm
new file mode 100644
index 000000000..a7e3fd94f
--- /dev/null
+++ b/data/phone/text/erin_caller.asm
@@ -0,0 +1,67 @@
+UnknownText_0x6717a:
+ text_ram wStringBuffer3
+ text "'s @"
+ text_ram wStringBuffer4
+ text_start
+ line "is much stronger"
+ cont "than before!"
+ done
+
+UnknownText_0x671a4:
+ text "And, and…"
+ line "I just battled and"
+ cont "beat @"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "I've raised my"
+ line "#MON properly!"
+ done
+
+UnknownText_0x671eb:
+ text "But, but…"
+
+ para "A wild @"
+ text_ram wStringBuffer4
+ text_start
+ line "got away from me"
+
+ para "again. It's just"
+ line "not fair!"
+ done
+
+UnknownText_0x6722e:
+ text "I'm ERIN. Want to"
+ line "battle me again?"
+
+ para "I won't lose this"
+ line "time!"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x67281:
+ text "See you. Bye-bye!"
+ done
+
+ErinWorkingHardText:
+ text "I'm working hard"
+ line "to raise my"
+ cont "#MON!"
+
+ para "Come back for"
+ line "another battle!"
+ done
+
+ErinComeBattleText:
+ text "Oh, <PLAY_G>!"
+ line "Come battle ERIN!"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/extra.asm b/data/phone/text/extra.asm
deleted file mode 100644
index f7c2bb380..000000000
--- a/data/phone/text/extra.asm
+++ /dev/null
@@ -1,1737 +0,0 @@
-
-UnknownText_0x64000:
- text "I hate having to"
- line "hang up on you!"
-
- para "Call you later!"
- done
-
-UnknownText_0x64032:
- text "<PLAY_G>, have you"
- line "heard?"
-
- para "GOLDENROD's RADIO"
- line "TOWER has been"
-
- para "taken over by TEAM"
- line "ROCKET!"
-
- para "…Um… What's TEAM"
- line "ROCKET?"
- done
-
-UnknownText_0x64099:
- text "<PLAY_G>, I heard!"
-
- para "You defeated that"
- line "WHITNEY?"
-
- para "It makes me proud"
- line "to be your friend!"
- done
-
-UnknownText_0x640e6:
- text "Hey, I heard about"
- line "you!"
-
- para "You saved that"
- line "#MON at the"
-
- para "LIGHTHOUSE, didn't"
- line "you?"
-
- para "<PLAY_G>, I wish"
- line "you'd come see me"
-
- para "when I'm sick in"
- line "bed with a cold!"
- done
-
-UnknownText_0x6416d:
- text "I heard, I heard,"
- line "I heard!"
-
- para "You smashed TEAM"
- line "ROCKET's hideout!"
-
- para "You're like a"
- line "movie hero, even!"
-
- para "But um… What was"
- line "TEAM ROCKET?"
- done
-
-UnknownText_0x641e8:
- text "I heard, I heard,"
- line "I heard!"
-
- para "About your heroic"
- line "liberation of the"
-
- para "RADIO TOWER! You"
- line "rock so hard!"
- done
-
-UnknownText_0x64247:
- text "I saw, I saw!"
-
- para "I saw you go into"
- line "the DRAGON'S DEN!"
-
- para "I'm certain you"
- line "passed! Aww, no"
-
- para "need to be modest!"
- line "You can't fail!"
- done
-
-UnknownText_0x642bb:
- text "Yesterday, I went"
- line "out to NEW BARK"
-
- para "TOWN. There was a"
- line "lady who looked a"
-
- para "lot like you,"
- line "<PLAY_G>."
-
- para "What? That lady"
- line "was your mom?"
-
- para "Aww, I should've"
- line "introduced myself!"
-
- para "I bet your mom's"
- line "really proud of"
-
- para "all that you've"
- line "accomplished."
-
- para "Heh, put it this"
- line "way. I'd be proud"
-
- para "if I were your"
- line "mom, believe me!"
- done
-
-UnknownText_0x643d4:
- text "I saw, I saw,"
- line "I saw!"
-
- para "You striding onto"
- line "a ship, <PLAY_G>!"
-
- para "I can't get over"
- line "how good you look"
-
- para "with the sea as"
- line "your backdrop!"
- done
-
-UnknownText_0x64448:
- text "I heard, I heard!"
-
- para "You got a MAGNET"
- line "TRAIN PASS!"
-
- para "When I saw you"
- line "departing on the"
-
- para "ship, I felt sad"
- line "that I wouldn't be"
-
- para "able to see you"
- line "for a while."
-
- para "But since you have"
- line "that PASS, you can"
-
- para "zip back anytime!"
- line "That's reassuring!"
-
- para "What? You can FLY"
- line "back anytime?"
-
- para "What do you mean"
- line "by FLY?"
- done
-
-UnknownText_0x6455b:
- text "I saw, I saw!"
-
- para "You waking up"
- line "SNORLAX!"
-
- para "I was watching you"
- line "from afar, so I"
-
- para "couldn't tell what"
- line "you did exactly."
-
- para "Did you play a"
- line "flute to wake it?"
-
- para "Wow! That's like"
- line "magic!"
- done
-
-UnknownText_0x645ff:
- text "I hear rumors"
- line "about you all over"
- cont "the place."
-
- para "It just makes me"
- line "sigh, <PLAY_G>."
-
- para "How did you get so"
- line "strong?"
-
- para "Go for the world"
- line "championship now!"
-
- para "I'll always be"
- line "cheering you on!"
- done
-
-IrwinCalledRightAwayText:
- text "Hehe, I called"
- line "right away!"
-
- para "I think we can be"
- line "good friends!"
- done
-
-UnknownText_0x646df:
- text "I saw, I heard!"
-
- para "You beat MORTY of"
- line "ECRUTEAK GYM!"
-
- para "Th-that's just"
- line "incredible!"
-
- para "I actually went to"
- line "the GYM's entrance"
-
- para "to cheer you on."
- line "Did you know that?"
-
- para "But everyone was"
- line "floating, and"
-
- para "there were ghosts"
- line "all over! So I"
-
- para "chickened out and"
- line "took off for home…"
- done
-
-UnknownText_0x647d8:
- text "<PLAY_G>, I heard!"
-
- para "You're kicking up"
- line "a mighty ruckus"
-
- para "over in KANTO!"
- line "What a glorious"
-
- para "rampage it must"
- line "be!"
-
- para "You so rock!"
- done
-
-UnknownText_0x64846:
- text "Hearing about your"
- line "escapades rocks my"
-
- para "soul!"
- line "It sure does!"
- done
-
-UnknownText_0x64881:
- text "I'm so glad you"
- line "called!"
-
- para "I was just about"
- line "to call you too!"
-
- para "I guess we must be"
- line "a good match!"
- done
-
-UnknownText_0x648dc:
- text "How are you?"
-
- para "What are you"
- line "doing?"
-
- para "Where are you?"
-
- para "How many BADGES do"
- line "you have now?"
-
- para "How much money"
- line "have you saved?"
-
- para "How's your mom?"
-
- para "Have you got lots"
- line "of #MON?"
-
- para "Is it going to be"
- line "sunny tomorrow?"
-
- para "Arrgh, there's so"
- line "much I want to"
-
- para "chat about! This"
- line "is going nowhere!"
- done
-
-ArnieLovesTheCuteText:
- text "I'm always with my"
- line "@"
- text_ram wStringBuffer4
- text "!"
-
- para "It's so cute!"
- line "I just love it!"
- done
-
-UnknownText_0x64a13:
- text "Changing the topic"
- line "here, I saw this"
-
- para "@"
- text_ram wStringBuffer4
- text " for the"
- line "first time."
-
- para "It was easy to"
- line "beat, actually."
- done
-
-UnknownText_0x64a71:
- text "I was wondering,"
- line "do you happen to"
- cont "have @"
- text_ram wStringBuffer4
- text "?"
-
- para "I can't seem to"
- line "catch one. What is"
-
- para "its weakness, I"
- line "wonder."
- done
-
-UnknownText_0x64ada:
- text "Hey, let's battle"
- line "our #MON!"
-
- para "I won't lose to"
- line "you battling or in"
-
- para "the Bug-Catching"
- line "Contest!"
-
- para "I'll be here on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x64b48:
- text "Let's talk again,"
- line "huh?"
- done
-
-UnknownText_0x64b5f:
- text "Boy, am I glad I"
- line "caught you!"
-
- para "A whole bunch of"
- line "@"
- text_ram wStringBuffer4
- text " have"
-
- para "appeared around"
- line "@"
- text_ram wStringBuffer5
- text "!"
-
- para "You have to see"
- line "this!"
- done
-
-UnknownText_0x64bc6:
- text "I haven't had any"
- line "luck seeing rare"
- cont "#MON lately…"
-
- para "But I know they're"
- line "out there!"
- done
-
-UnknownText_0x64c13:
- text "Hey, where are you"
- line "now?"
-
- para "Let's battle. I'll"
- line "be waiting for you"
- cont "on @"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x64c5a:
- text "Hello? Are you"
- line "coming or what?"
-
- para "You're missing out"
- line "on seeing YANMA!"
-
- para "Get down to ROUTE"
- line "35 right now!"
- done
-
-AlanGettingStrongerText:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "getting stronger,"
-
- para "exactly as I"
- line "calculated!"
- done
-
-UnknownText_0x64cf3:
- text "By the way, we"
- line "knocked out a wild"
-
- para "@"
- text_ram wStringBuffer4
- text " just"
- line "the other day."
-
- para "Studying up in"
- line "advance worked!"
- done
-
-UnknownText_0x64d4f:
- text "By the way, a wild"
- line "@"
- text_ram wStringBuffer4
- text " escaped"
- cont "on me yesterday."
-
- para "A computational"
- line "error on my part…"
- done
-
-UnknownText_0x64da4:
- text "I've studied quite"
- line "a bit since then,"
-
- para "and I've gotten a"
- line "lot better!"
-
- para "I'm hanging out on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Can you come down"
- line "for a battle?"
- done
-
-UnknownText_0x64e1f:
- text "See you later!"
- done
-
-UnknownText_0x64e2f:
- text "Hehehe, I picked"
- line "up something nice!"
-
- para "You can have it!"
- line "Why don't you come"
-
- para "to @"
- text_ram wStringBuffer5
- text_start
- line "and pick it up?"
- done
-
-UnknownText_0x64e90:
- text "I haven't picked"
- line "up anything yet."
-
- para "I'll call you if I"
- line "find something."
- done
-
-UnknownText_0x64ed4:
- text "If we don't battle"
- line "soon, I'll forget"
- cont "my strategy!"
-
- para "I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x64f1a:
- text "I have to do my"
- line "homework, so can"
-
- para "you come get your"
- line "gift right away?"
-
- para "I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x64f74:
- text "My @"
- text_ram wStringBuffer4
- text " is"
- line "getting prettier!"
-
- para "I've been taking"
- line "photos galore!"
- done
-
-UnknownText_0x64fb2:
- text "It took only an"
- line "instant to KO a"
- cont "wild @"
- text_ram wStringBuffer4
- text "."
-
- para "It must be because"
- line "you gave me some"
-
- para "battling tips last"
- line "time."
- done
-
-UnknownText_0x6501c:
- text "You know what?"
- line "A wild @"
- text_ram wStringBuffer4
- text_start
- para "got away from me"
- line "again."
-
- para "It was so close!"
- line "Really, just a"
-
- para "little bit more,"
- line "and I would've…"
- done
-
-UnknownText_0x65091:
- text "Right now, I'm on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "If you're close"
- line "by, let's battle!"
-
- para "I'll be waiting"
- line "for you!"
- done
-
-UnknownText_0x650e2:
- text "See you!"
- done
-
-UnknownText_0x650ec:
- text "You know what?"
- line "I got a good gift!"
-
- para "As I promised,"
- line "it's yours!"
-
- para "I'm sure you'd"
- line "like it. Come get"
-
- para "it! I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x65161:
- text "Oh! You wanted a"
- line "gift, right?"
-
- para "I got one, but I"
- line "want to keep this."
-
- para "Can you wait a bit"
- line "longer?"
- done
-
-UnknownText_0x651bf:
- text "Hi! You haven't"
- line "forgotten about"
-
- para "your promise to"
- line "battle me?"
-
- para "I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x6520f:
- text "Hello?"
-
- para "If you don't come"
- line "get your present"
-
- para "soon, I'll give it"
- line "to someone else."
-
- para "I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-ChadObservingWildText:
- text "I recently began"
- line "observing wild"
- cont "@"
- text_ram wStringBuffer4
- text "."
-
- para "I've been learning"
- line "all sorts of new"
-
- para "things through my"
- line "observations."
-
- para "I wish I could"
- line "become a #MON"
-
- para "researcher like"
- line "PROF.OAK soon."
- done
-
-UnknownText_0x65318:
- text "Oh yes, I managed"
- line "to knock out a"
-
- para "wild @"
- text_ram wStringBuffer4
- text " a"
- line "while back."
-
- para "Well, considering"
- line "all the studying I"
-
- para "do every day, it"
- line "was inevitable."
- done
-
-UnknownText_0x65399:
- text "Oh yes, I came"
- line "close to catching"
-
- para "a wild @"
- text_ram wStringBuffer4
- text ","
- line "but it got away."
-
- para "For the longest"
- line "time, I've been"
-
- para "wanting to observe"
- line "@"
- text_ram wStringBuffer4
- text ". Rats…"
- done
-
-UnknownText_0x65419:
- text "Want to battle?"
- line "I have to battle"
-
- para "every so often to"
- line "avoid rusting out."
-
- para "I'll be on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x65471:
- text "See you later!"
- done
-
-ChadBlueGossipText:
- text "Do you know BLUE?"
-
- para "He's PROF.OAK's"
- line "grandson and a"
-
- para "former #MON"
- line "LEAGUE CHAMPION!"
-
- para "He's one super"
- line "#MON trainer!"
- done
-
-ChadDaisyGossipText:
- text "PROF.OAK has a"
- line "granddaughter"
- cont "named DAISY."
-
- para "When she's around,"
- line "even the most"
-
- para "ferocious #MON"
- line "calm right down."
- done
-
-ChadProfElmGossipText:
- text "Everyone's talking"
- line "about PROF.ELM."
-
- para "He used to be an"
- line "assistant to the"
- cont "great PROF.OAK!"
-
- para "That is so cool!"
- line "I envy him!"
- done
-
-ChadDreamGossipText:
- text "PROF.OAK's dream"
- line "is to compile a"
-
- para "comprehensive"
- line "#DEX."
-
- para "I envy you for"
- line "taking part in"
- cont "that project…"
- done
-
-ChadKurtGossipText:
- text "Do you know KURT,"
- line "the BALL creator?"
-
- para "He and PROF.OAK go"
- line "back a long way."
-
- para "I guess great"
- line "people attract one"
- cont "another!"
- done
-
-ChadLeagueGossipText:
- text "#MON LEAGUE is"
- line "the great gather-"
- cont "ing place for all"
-
- para "trainers who wish"
- line "to become CHAMP."
-
- para "PROF.OAK acts as"
- line "an advisor to the"
-
- para "#MON LEAGUE's"
- line "headquarters."
-
- para "He really is a"
- line "great man."
- done
-
-ChadRadioShowGossipText:
- text "PROF.OAK'S #MON"
- line "TALK is a popular"
- cont "radio show, right?"
-
- para "Did you know that"
- line "he was going to"
-
- para "turn down the show"
- line "at first?"
-
- para "But MARY's energy"
- line "and persistence"
- cont "wore him down."
-
- para "So we have MARY to"
- line "thank for it!"
- done
-
-ChadBattlingGossipText:
- text "PROF.OAK used to"
- line "be a trainer a"
- cont "long time ago."
-
- para "But rather than"
- line "battling, he found"
-
- para "#MON themselves"
- line "to be interesting."
-
- para "So he abandoned"
- line "his training to"
-
- para "focus on becoming"
- line "a researcher."
- done
-
-ChadDaisyTeaGossipText:
- text "PROF.OAK has a"
- line "granddaughter"
- cont "named DAISY."
-
- para "She has tea every"
- line "day for an hour"
-
- para "from three in the"
- line "afternoon."
-
- para "I wish I could"
- line "join her for tea"
-
- para "and chat about"
- line "PROF.OAK."
- done
-
-ChadTravelGossipText:
- text "Did you know?"
- line "PROF.OAK traveled"
-
- para "all over the world"
- line "when he was young."
-
- para "While traveling,"
- line "he must've learned"
-
- para "about #MON"
- line "naturally."
-
- para "I envy him…"
- line "I'd like to travel"
-
- para "and learn about"
- line "things too…"
- done
-
-UnknownText_0x65a23:
- text "I'm going to study"
- line "hard so PROF.OAK"
-
- para "will make me his"
- line "assistant!"
- done
-
-UnknownText_0x65a63:
- text "Do you remember"
- line "about our battle?"
-
- para "The place is"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Hurry over--I'm"
- line "waiting."
- done
-
-DerekCheekPincherText:
- text "Listen to this."
- line "My @"
- text_ram wStringBuffer4
- text_start
- para "grins happily when"
- line "I pinch its cheek."
-
- para "But it never grins"
- line "for anyone else."
-
- para "I must be special."
- done
-
-UnknownText_0x65b29:
- text "Oh, and recently,"
- line "my PIKACHU beat a"
- cont "wild @"
- text_ram wStringBuffer4
- text "!"
-
- para "A wild @"
- text_ram wStringBuffer4
- text ","
- line "I tell you!"
-
- para "Don't you think"
- line "that's astounding?"
-
- para "My PIKACHU is"
- line "awesome!"
-
- para "My PIKACHU is the"
- line "greatest!"
- done
-
-UnknownText_0x65bc8:
- text "Oh, and I saw a"
- line "wild @"
- text_ram wStringBuffer4
- text " a"
- cont "little while ago."
-
- para "But it wasn't very"
- line "cute, so I left"
-
- para "it…"
- line "#MON have to be"
-
- para "cute. They're no"
- line "good otherwise."
- done
-
-UnknownText_0x65c4e:
- text "Well, let's talk"
- line "again!"
- done
-
-DerekBugCatchingContestText:
- text "Did you remember?"
- line "The Bug-Catching"
- cont "Contest is today."
-
- para "You're going to"
- line "go, aren't you?"
-
- para "I think I'll"
- line "participate with"
-
- para "PIKACHU to show"
- line "off its cuteness."
- done
-
-UnknownText_0x65cf9:
- text "I'd like you to"
- line "have a NUGGET."
-
- para "My PIKACHU just"
- line "loves it."
-
- para "I'm certain your"
- line "PIKACHU will love"
- cont "it too!"
- done
-
-UnknownText_0x65d5c:
- text "How is your"
- line "PIKACHU doing?"
-
- para "Let's get together"
- line "and brag about our"
- cont "PIKACHU!"
- done
-
-UnknownText_0x65da6:
- text "What's wrong?"
-
- para "I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Come pick this up"
- line "anytime."
- done
-
-TullyGrownText:
- text "My @"
- text_ram wStringBuffer4
- text " has"
- line "grown again."
-
- para "It was only about"
- line "so big when I"
-
- para "caught it, but now"
- line "it's way bigger."
- done
-
-UnknownText_0x65e42:
- text "Oh yeah, I KO'd a"
- line "wild @"
- text_ram wStringBuffer4
- text "."
-
- para "It was huge, like"
- line "this big even."
-
- para "Heh, I guess you"
- line "can't tell over"
- cont "the phone…"
- done
-
-UnknownText_0x65eac:
- text "Oh yeah, I lost a"
- line "wild @"
- text_ram wStringBuffer4
- text "."
-
- para "It was huge, like"
- line "this big even."
-
- para "Heh, I guess you"
- line "can't tell over"
- cont "the phone…"
- done
-
-UnknownText_0x65f17:
- text "We should get a"
- line "battle going!"
-
- para "I'll be fishing on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Swing by if you"
- line "have the time."
- done
-
-UnknownText_0x65f6e:
- text "Well, I'll be"
- line "seeing you."
- done
-
-UnknownText_0x65f88:
- text "I picked up a good"
- line "little thing at"
- cont "the water's edge."
-
- para "Like I promised,"
- line "it's yours."
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x65ff2:
- text "Have I found"
- line "anything good?"
-
- para "Nope, not yet."
-
- para "It's like fishing,"
- line "you need patience."
- done
-
-UnknownText_0x66043:
- text "Yup, TULLY here…"
-
- para "<PLAY_G>? What?"
- line "You're lost?"
-
- para "Our battle will be"
- line "on @"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x66087:
- text "I've got something"
- line "good for you."
-
- para "Hustle over to"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-BrentRareTradeText:
- text "Oh yeah, I got an"
- line "extremely rare"
-
- para "#MON in a trade"
- line "a while back."
-
- para "Do you want to"
- line "know what it is?"
-
- para "Hehe, I'm keeping"
- line "it a secret!"
- done
-
-UnknownText_0x6613c:
- text "Oh yeah, I took"
- line "down this wild"
-
- para "@"
- text_ram wStringBuffer4
- text "."
- line "It wasn't rare"
-
- para "enough to bother"
- line "catching."
- done
-
-UnknownText_0x6618c:
- text "Oh yeah, I saw a"
- line "rare #MON about"
- cont "an hour ago."
-
- para "It was my first"
- line "sighting. But I"
-
- para "didn't have any"
- line "# BALLS…"
-
- para "Would BILL laugh"
- line "at my mistakes?"
- done
-
-UnknownText_0x66214:
- text "You've got time"
- line "like usual, right?"
-
- para "Feel like having a"
- line "battle?"
-
- para "It'll be a chance"
- line "to see my rare"
-
- para "#MON. It'll be"
- line "worth your time!"
-
- para "You know where--"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x662a9:
- text "So that's it then."
- done
-
-UnknownText_0x662bc:
- text "Did you know…?"
- line "BILL's father is"
-
- para "supposed to be a"
- line "great #MANIAC."
- done
-
-UnknownText_0x662fc:
- text "Did you know…?"
- line "Apparently BILL's"
-
- para "grandpa isn't a"
- line "#MANIAC."
- done
-
-UnknownText_0x66335:
- text "Did you know…?"
- line "BILL's originally"
- cont "from GOLDENROD."
- done
-
-UnknownText_0x66366:
- text "Did you know…?"
- line "BILL evidently"
-
- para "lives on ROUTE 25"
- line "in KANTO."
- done
-
-UnknownText_0x663a1:
- text "Did you know…?"
- line "ABRA was the first"
-
- para "#MON that BILL"
- line "ostensibly caught."
- done
-
-UnknownText_0x663e6:
- text "Did you know…?"
- line "BILL's younger"
-
- para "sister apparently"
- line "can't wink."
- done
-
-UnknownText_0x66421:
- text "Did you know…?"
- line "BILL supposedly"
-
- para "hates milk and"
- line "can't drink it."
- done
-
-UnknownText_0x6645f:
- text "Did you know…?"
- line "Evidently, BILL"
-
- para "isn't very good at"
- line "battling."
- done
-
-UnknownText_0x6649b:
- text "Did you know…?"
- line "BILL appears to"
-
- para "like the lady at"
- line "the FLOWER SHOP."
- done
-
-UnknownText_0x664dd:
- text "Did you know…?"
- line "BILL's mother is"
-
- para "said to have been"
- line "a KIMONO GIRL."
- done
-
-UnknownText_0x6651e:
- text "You wanted to hear"
- line "about BILL?"
-
- para "Sorry, but I'm too"
- line "busy for you."
-
- para "I'll call when I"
- line "have time."
- done
-
-UnknownText_0x66579:
- text "You want to see my"
- line "rare #MON."
-
- para "Hurry over to"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x665ad:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "adorable, don't"
-
- para "you think so?"
- line "I always sleep"
-
- para "with it--it's so"
- line "fluffy and warm!"
- done
-
-UnknownText_0x66605:
- text "Oh, and we had to"
- line "battle a wild"
-
- para "@"
- text_ram wStringBuffer4
- text " a while"
- line "ago…"
-
- para "My CLEFAIRY came"
- line "close to fainting!"
-
- para "Isn't that awful?"
-
- para "I hate those nasty"
- line "@"
- text_ram wStringBuffer4
- text "!"
- done
-
-UnknownText_0x66688:
- text "Oh, and we had to"
- line "battle a wild"
-
- para "@"
- text_ram wStringBuffer4
- text " a while"
- line "ago…"
-
- para "My CLEFAIRY got"
- line "frightened, so we"
-
- para "ran away as fast"
- line "as we could!"
-
- para "I just can't help"
- line "feeling protective"
- cont "of my CLEFAIRY."
- done
-
-UnknownText_0x66730:
- text "I know this might"
- line "surprise you, but"
-
- para "would you like to"
- line "battle?"
-
- para "I'll be waiting"
- line "with CLEFAIRY on"
- cont "@"
- text_ram wStringBuffer5
- text "."
- done
-
-TiffanyItsAwfulText:
- text_ram wStringBuffer4
- text "!"
-
- para "It's awful."
- line "My CLEFAIRY…"
-
- para "Huh? <PLAY_G>?"
-
- para "Oh, sorry! I was"
- line "in a hurry, and I…"
-
- para "I have to go!"
- line "Bye-bye!"
- done
-
-UnknownText_0x667f7:
- text "Bye-bye!"
- done
-
-UnknownText_0x66801:
- text "I bought some PINK"
- line "BOWS at GOLDENROD"
-
- para "DEPT.STORE for my"
- line "CLEFAIRY."
-
- para "I got too many, so"
- line "I'll give you one!"
-
- para "Come collect it on"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x66882:
- text "I love dressing up"
- line "my CLEFAIRY!"
- done
-
-UnknownText_0x668a3:
- text "What's wrong?"
- line "Can't you visit?"
-
- para "CLEFAIRY got tired"
- line "and fell asleep."
-
- para "I'm not sure if I"
- line "can wake it up…"
-
- para "Please hurry to"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x6691d:
- text "What's wrong?"
- line "Can't you visit?"
-
- para "I'm sure this will"
- line "look good on your"
- cont "CLEFAIRY."
-
- para "Please hurry to"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-VanceLiftoffText:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "become tougher."
-
- para "We've achieved"
- line "liftoff!"
- done
-
-UnknownText_0x669b2:
- text "We can easily beat"
- line "@"
- text_ram wStringBuffer4
- text "!"
-
- para "…Huh? You too?"
- line "Isn't that great?"
- done
-
-UnknownText_0x669ed:
- text "But get this, a"
- line "wild @"
- text_ram wStringBuffer4
- text_start
- para "just barely eluded"
- line "us."
-
- para "I wanted to FLY"
- line "after it…"
- done
-
-UnknownText_0x66a3a:
- text "Right now, I'm on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "You know, where I"
- line "first met you?"
-
- para "Want to battle?"
- line "I'll wait here."
- done
-
-UnknownText_0x66a93:
- text "OK, bye for now!"
- done
-
-VanceLookingForwardText:
- text "I'll be looking"
- line "forward to our"
- cont "next battle!"
- done
-
-VanceHurryHurryText:
- text "Oh, <PLAY_G>!"
- line "Hurry, hurry!"
-
- para "@"
- text_ram wStringBuffer5
- text "!"
- line "FLY over now!"
- done
-
-WiltonGrownText:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "grown impressive!"
-
- para "My fishing skills"
- line "have improved too!"
- done
-
-UnknownText_0x66b3e:
- text "We beat a wild"
- line "@"
- text_ram wStringBuffer4
- text "…"
-
- para "You know, I have"
- line "more fun fishing"
-
- para "than beating wild"
- line "#MON."
- done
-
-UnknownText_0x66b8f:
- text "But a while back,"
- line "we came this close"
-
- para "to landing a wild"
- line "@"
- text_ram wStringBuffer4
- text "."
-
- para "I tell you, it was"
- line "huge. Believe me."
- done
-
-UnknownText_0x66bf3:
- text "I'm fishing on"
- line "@"
- text_ram wStringBuffer5
- text ","
-
- para "but nothing's"
- line "biting today."
-
- para "Help me while my"
- line "time away, come"
- cont "over for a battle."
- done
-
-UnknownText_0x66c58:
- text "All right, later."
- done
-
-UnknownText_0x66c6b:
- text "I snagged an item"
- line "while fishing."
-
- para "Come pick it up on"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-WiltonHaventFoundAnythingText:
- text "Nah, I haven't"
- line "found anything"
-
- para "that's worth your"
- line "time."
-
- para "You have to have"
- line "patience."
- done
-
-WiltonNotBitingText:
- text "Sigh…"
- line "They're not biting"
-
- para "like before on"
- line "@"
- text_ram wStringBuffer5
- text "…"
-
- para "You have to come"
- line "for a battle!"
- done
-
-WiltonWantThisText:
- text "Don't you want"
- line "this item?"
-
- para "Hah? You don't"
- line "know where?"
-
- para "@"
- text_ram wStringBuffer5
- text "…"
- line "Just head from"
-
- para "MAHOGANY toward"
- line "BLACKTHORN!"
- done
-
-UnknownText_0x66dab:
- text "Anyway, we'll chat"
- line "again!"
- done
-
-UnknownText_0x66dc5:
- text "Are you still on"
- line "your journey?"
-
- para "I remain dedicated"
- line "to my training."
-
- para "Oooooaaarrrgh!"
- done
-
-UnknownText_0x66e17:
- text "I'm in training"
- line "now. I apologize,"
-
- para "but call me back"
- line "another time."
-
- para "Oooooaaarrrgh!"
- done
-
-UnknownText_0x66e67:
- text "I apologize, but I"
- line "don't have time to"
-
- para "chat while I am in"
- line "training!"
-
- para "I'll have time to"
- line "chat tomorrow!"
-
- para "Yiiihah!"
- done
-
-UnknownText_0x66ed3:
- text "I plan to take a"
- line "lunch break, so"
-
- para "come see me then!"
- line "Ayiiiyah!"
- done
-
-KenjiBreakText:
- text "I'm taking a break"
- line "on ROUTE 45!"
-
- para "Why not drop by if"
- line "you are free?"
- done
-
-UnknownText_0x66f52:
- text "I rested up over"
- line "my lunch break."
-
- para "Now it's time to"
- line "resume training!"
-
- para "Oooryaah!"
- done
-
-ParryNoMatchText:
- text "Nothing can match"
- line "my @"
- text_ram wStringBuffer4
- text " now."
- done
-
-UnknownText_0x66fc0:
- text "Yeah, we KO'd a"
- line "wild @"
- text_ram wStringBuffer4
- text "!"
-
- para "That was OK, but I"
- line "wanted to get it…"
- done
-
-UnknownText_0x67001:
- text "And yesterday, we"
- line "spotted a wild"
-
- para "@"
- text_ram wStringBuffer4
- text "."
- line "We were debating"
-
- para "whether to catch"
- line "it or beat it."
-
- para "When along came"
- line "another guy who"
-
- para "caught it!"
- line "How about that!"
- done
-
-UnknownText_0x67096:
- text "You're thinking"
- line "you'd like to"
-
- para "battle me. Am I"
- line "right or what?"
-
- para "Yep! We'll meet on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x670eb:
- text "OK, give me a call"
- line "again!"
- done
-
-ParryBattleWithMeText:
- text "You'll battle with"
- line "me again, right?"
- done
-
-ParryHaventYouGottenToText:
- text "Haven't you gotten"
- line "to @"
- text_ram wStringBuffer5
- text "?"
-
- para "Waiting here isn't"
- line "bad, but I'd sure"
- cont "like to battle!"
- done
-
-UnknownText_0x6717a:
- text_ram wStringBuffer3
- text "'s @"
- text_ram wStringBuffer4
- text_start
- line "is much stronger"
- cont "than before!"
- done
-
-UnknownText_0x671a4:
- text "And, and…"
- line "I just battled and"
- cont "beat @"
- text_ram wStringBuffer4
- text "!"
-
- para "I've raised my"
- line "#MON properly!"
- done
-
-UnknownText_0x671eb:
- text "But, but…"
-
- para "A wild @"
- text_ram wStringBuffer4
- text_start
- line "got away from me"
-
- para "again. It's just"
- line "not fair!"
- done
-
-UnknownText_0x6722e:
- text "I'm ERIN. Want to"
- line "battle me again?"
-
- para "I won't lose this"
- line "time!"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x67281:
- text "See you. Bye-bye!"
- done
-
-ErinWorkingHardText:
- text "I'm working hard"
- line "to raise my"
- cont "#MON!"
-
- para "Come back for"
- line "another battle!"
- done
-
-ErinComeBattleText:
- text "Oh, <PLAY_G>!"
- line "Come battle ERIN!"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
diff --git a/data/phone/text/extra2.asm b/data/phone/text/extra2.asm
deleted file mode 100644
index da6acc40c..000000000
--- a/data/phone/text/extra2.asm
+++ /dev/null
@@ -1,1795 +0,0 @@
-UnknownText_0x174000:
- text "Hi, <PLAY_G>!"
- line "Our BICYCLE sales"
-
- para "have gone through"
- line "the roof!"
-
- para "We owe it all to"
- line "your advertising"
-
- para "by riding around"
- line "on our BICYCLE."
-
- para "As our way of say-"
- line "ing thanks, please"
-
- para "keep that BICYCLE."
- line "Thanks again!"
- done
-
-JackIntelligenceText:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "intelligence keeps"
-
- para "rising. It might"
- line "be smarter than"
- cont "yours!"
- done
-
-JackDefeatedMonText:
- text "The other day, I"
- line "easily defeated a"
- cont "@"
- text_ram wStringBuffer4
- text "."
-
- para "I think swapping"
- line "tips with you is"
- cont "starting to help."
- done
-
-UnknownText_0x174165:
- text "Oh, and listen."
- line "I missed catching"
-
- para "a @"
- text_ram wStringBuffer4
- text " by"
- line "just a tiny bit."
-
- para "If I'd been a bit"
- line "more informed, I'm"
-
- para "sure I would've"
- line "caught it…"
- done
-
-UnknownText_0x1741e1:
- text "Do you want to"
- line "battle? I'll show"
-
- para "you how to battle"
- line "logically."
-
- para "I'll be in"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Give me a shout if"
- line "you're nearby."
- done
-
-UnknownText_0x174251:
- text "See you later!"
- done
-
-JackThunderTriviaText:
- text "Did you know?"
-
- para "When it's raining,"
- line "THUNDER is sure to"
- cont "strike."
- done
-
-JackRolloutTriviaText:
- text "Did you know…?"
-
- para "If you use DEFENSE"
- line "CURL, ROLLOUT's"
-
- para "power goes way up"
- line "past normal."
- done
-
-JackSolarbeamTriviaText:
- text "Did you know…?"
-
- para "If the sunlight is"
- line "harsh, SOLARBEAM"
-
- para "doesn't need to be"
- line "charged up."
- done
-
-JackStompTriviaText:
- text "Did you know…?"
-
- para "If the opponent"
- line "uses MINIMIZE,"
-
- para "your STOMP becomes"
- line "more powerful."
- done
-
-JackGustTriviaText:
- text "Did you know…?"
-
- para "If your opponent"
- line "is FLYing, your"
-
- para "GUST becomes much"
- line "more powerful."
- done
-
-JackTwisterTriviaText:
- text "Did you know…?"
-
- para "If your opponent"
- line "is FLYing, your"
-
- para "TWISTER becomes"
- line "more powerful."
- done
-
-JackEarthquakeTriviaText:
- text "Did you know…?"
-
- para "If your opponent"
- line "uses DIG, your"
-
- para "EARTHQUAKE becomes"
- line "more powerful."
- done
-
-JackMagnitudeTriviaText:
- text "Did you know…?"
-
- para "If your opponent"
- line "uses DIG, your"
-
- para "MAGNITUDE becomes"
- line "more powerful."
- done
-
-JackSandstormTriviaText:
- text "Did you know…?"
-
- para "The rock, ground"
- line "and steel types"
-
- para "can't be hurt by"
- line "SANDSTORM."
- done
-
-JackSunnyDayTriviaText:
- text "Did you know…?"
-
- para "If the sunlight is"
- line "harsh, water-type"
-
- para "moves become much"
- line "weaker."
- done
-
-JackRainDanceTriviaText:
- text "Did you know…?"
-
- para "When it's raining,"
- line "fire-type moves"
-
- para "become much weaker"
- line "than usual."
- done
-
-UnknownText_0x1745c2:
- text "My friend heard"
- line "some great tips."
-
- para "He's going to let"
- line "me in on some."
-
- para "When he tells me,"
- line "I'll call right"
- cont "away and tell you."
- done
-
-UnknownText_0x174638:
- text "Hey, <PLAY_G>!"
-
- para "Do you remember"
- line "your promise?"
-
- para "We have to battle"
- line "soon!"
-
- para "I'll be at"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x174688:
- text "I fancied up my"
- line "@"
- text_ram wStringBuffer4
- text " and"
-
- para "made it even cuter"
- line "than before!"
- done
-
-UnknownText_0x1746c3:
- text "I happened to come"
- line "across a wild"
- cont "SNUBBULL recently."
-
- para "My SNUBBULL, I"
- line "assure you, was"
-
- para "far cuter than the"
- line "wild one."
- done
-
-UnknownText_0x174734:
- text "I happened to see"
- line "a wild MARILL the"
-
- para "other day."
- line "Or so I thought."
-
- para "A closer look"
- line "showed it was"
-
- para "@"
- text_ram wStringBuffer4
- text ". I was"
- line "quite miffed."
- done
-
-UnknownText_0x1747ac:
- text "You can expect a"
- line "call from me."
- done
-
-BeverlyFoundNuggetText:
- text "My husband got"
- line "some NUGGETS."
-
- para "If you'd like, you"
- line "could have one as"
-
- para "thanks for helping"
- line "me out."
-
- para "I'll be at"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Please come see me"
- line "when you can."
- done
-
-UnknownText_0x17485b:
- text "Are your #MON"
- line "in prime form?"
-
- para "Let's chat about"
- line "#MON again."
- done
-
-UnknownText_0x174895:
- text "Pardon?"
- line "Oh, the NUGGET?"
-
- para "There's no need to"
- line "hurry. Come see me"
-
- para "in @"
- text_ram wStringBuffer5
- text_start
- line "when you can."
- done
-
-UnknownText_0x1748ea:
- text "Hey, I challenge"
- line "you to a battle!"
-
- para "It won't be like"
- line "last time!"
-
- para "@"
- text_ram wStringBuffer5
- text "'s"
- line "where I'm waiting"
-
- para "for you. Hustle"
- line "over here pronto!"
- done
-
-UnknownText_0x174962:
- text "See ya!"
- done
-
-UnknownText_0x17496b:
- text "We have to battle"
- line "again sometime."
-
- para "You can bet I'm"
- line "going to keep"
-
- para "challenging you"
- line "till I win."
- done
-
-UnknownText_0x1749c7:
- text "Hey, you'd better"
- line "not have forgotten"
- cont "about our battle!"
-
- para "@"
- text_ram wStringBuffer5
- text "!"
-
- para "Hustle over quick!"
- line "I'm waiting!"
- done
-
-GavenGreaterText:
- text "My @"
- text_ram wStringBuffer4
- text_start
- line "might be greater"
- cont "than I imagined."
-
- para "I doubt I'll see a"
- line "@"
- text_ram wStringBuffer4
- text " that's"
- cont "better than mine."
- done
-
-UnknownText_0x174a80:
- text "Oh, and I managed"
- line "to barely defeat"
-
- para "@"
- text_ram wStringBuffer4
- text " the"
- line "other day."
-
- para "I've never seen a"
- line "@"
- text_ram wStringBuffer4
- text " get"
- cont "that strong…"
-
- para "You shouldn't let"
- line "your guard down,"
-
- para "even against a"
- line "#MON you're"
- cont "used to seeing."
- done
-
-UnknownText_0x174b2d:
- text "And a while back,"
- line "I tried to catch a"
- cont "wild @"
- text_ram wStringBuffer4
- text "."
-
- para "But it managed to"
- line "elude me."
-
- para "One wrong decision"
- line "could mean total"
-
- para "failure… You ought"
- line "to be careful too."
- done
-
-UnknownText_0x174bc5:
- text "Let's battle!"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Give me a shout"
- line "when you're close."
- done
-
-UnknownText_0x174c0e:
- text "OK, I'll talk to"
- line "you soon!"
- done
-
-UnknownText_0x174c29:
- text "I obsess over how"
- line "to beat you."
- done
-
-UnknownText_0x174c49:
- text "<PLAY_G>, why"
- line "aren't you here?"
-
- para "I'll take you down"
- line "with @"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x174c7f:
- text "Do you remember my"
- line "sweet @"
- text_ram wStringBuffer4
- text "?"
-
- para "@"
- text_ram wStringBuffer4
- text " runs"
- line "very fast."
-
- para "It's exhilarating"
- line "to ride on its"
-
- para "back when it"
- line "really gets going."
- done
-
-UnknownText_0x174cf6:
- text "Oh, have you ever"
- line "seen a @"
- text_ram wStringBuffer4
- text_start
- cont "before?"
-
- para "I just battled"
- line "one…"
-
- para "It was much faster"
- line "than I expected."
-
- para "I was a little"
- line "shocked."
-
- para "I still won, of"
- line "course."
- done
-
-UnknownText_0x174d86:
- text "Oh, I just saw a"
- line "wild @"
- text_ram wStringBuffer4
- text "."
-
- para "I was trying to"
- line "catch it when I"
-
- para "noticed that I was"
- line "all out of #"
- cont "BALLS."
-
- para "If you don't check"
- line "your items, you"
-
- para "may run out at the"
- line "worst time."
-
- para "I hope you learn"
- line "from my mistake."
- done
-
-UnknownText_0x174e4e:
- text "Do you want to"
- line "battle? I'm going"
- cont "to win this time!"
-
- para "I'll be waiting"
- line "for you around"
-
- para "@"
- text_ram wStringBuffer5
- text "."
- line "Look for me, OK?"
- done
-
-UnknownText_0x174eb7:
- text "OK, bye-bye!"
- done
-
-UnknownText_0x174ec5:
- text "Let's battle again"
- line "sometime!"
- done
-
-BethForgetDealText:
- text "Um… <PLAY_G>?"
- line "What's wrong?"
-
- para "Did you forget our"
- line "deal?"
-
- para "@"
- text_ram wStringBuffer5
- text "."
-
- para "That's where I'm"
- line "waiting."
- done
-
-JoseAromaText:
- text "Hey listen, my"
- line "@"
- text_ram wStringBuffer4
- text "'s stick"
-
- para "has this really"
- line "delicious aroma."
-
- para "That aroma gets my"
- line "appetite going!"
- done
-
-UnknownText_0x174f90:
- text "A while ago, my"
- line "FARFETCH'D KO'd"
- cont "this @"
- text_ram wStringBuffer4
- text "."
-
- para "You should have"
- line "seen FARFETCH'D"
-
- para "wield that stick."
- line "Amazing stuff!"
- done
-
-UnknownText_0x174ffd:
- text "I ran into a wild"
- line "@"
- text_ram wStringBuffer4
- text "…"
-
- para "I was trying to"
- line "catch it, but it"
-
- para "took off faster"
- line "than I thought it"
-
- para "would. It was a"
- line "bit disappointing."
- done
-
-UnknownText_0x17507d:
- text "Want to battle"
- line "again?"
-
- para "For some reason,"
- line "my FARFETCH'D is"
-
- para "all worked up and"
- line "raring to go."
-
- para "@"
- text_ram wStringBuffer5
- text "'s"
- line "where I'm at."
-
- para "Keep an eye out"
- line "for me, OK?"
- done
-
-UnknownText_0x175106:
- text "Be seeing you!"
- done
-
-JoseFoundSomethingText:
- text "My FARFETCH'D had"
- line "something pretty"
- cont "in its beak."
-
- para "Like I promised,"
- line "you can have it."
-
- para "Catch up to me on"
- line "@"
- text_ram wStringBuffer5
- text ","
-
- para "and I'll let you"
- line "have it."
- done
-
-UnknownText_0x17519b:
- text "I haven't gotten"
- line "what I promised"
- cont "you yet."
-
- para "I'll call you as"
- line "soon as I get it,"
-
- para "so could you wait"
- line "a little longer?"
- done
-
-UnknownText_0x17520a:
- text "<PLAY_G>, could you"
- line "hurry over?"
-
- para "FARFETCH'D is"
- line "agitated."
-
- para "If you don't come"
- line "soon, it might"
-
- para "smack me with its"
- line "stick!"
-
- para "@"
- text_ram wStringBuffer5
- text "!"
-
- para "Please come as"
- line "soon as you can!"
- done
-
-UnknownText_0x17529c:
- text "What's wrong?"
-
- para "Don't you want"
- line "this gift?"
-
- para "Catch up to me on"
- line "@"
- text_ram wStringBuffer5
- text ","
-
- para "and I'll let you"
- line "have it."
- done
-
-UnknownText_0x1752f5:
- text "Listen, dear…"
-
- para "Do you recall my"
- line "@"
- text_ram wStringBuffer4
- text "?"
-
- para "Yes, exactly. That"
- line "lovely @"
- text_ram wStringBuffer4
- text "."
-
- para "Wouldn't you agree"
- line "it's a perfect"
- cont "match for me?"
- done
-
-UnknownText_0x17536b:
- text "Have I ever faced"
- line "a wild @"
- text_ram wStringBuffer4
- text "?"
-
- para "You need to ask?"
-
- para "@"
- text_ram wStringBuffer4
- text " I've"
- line "beaten on numerous"
- cont "occasions!"
- done
-
-UnknownText_0x1753c5:
- text "Have I ever failed"
- line "to catch a wild"
- cont "#MON?"
-
- para "You need to ask?"
-
- para "I would never fail"
- line "to catch a wild"
-
- para "@"
- text_ram wStringBuffer4
- text "…"
- line "Oh! Never mind!"
- done
-
-UnknownText_0x17543a:
- text "We are going to"
- line "battle!"
-
- para "The place shall be"
- line "@"
- text_ram wStringBuffer5
- text "!"
-
- para "Don't make me"
- line "wait! Got it?"
- done
-
-UnknownText_0x175488:
- text "Fine, you may go."
- done
-
-UnknownText_0x17549b:
- text "Don't be too proud"
- line "just because you"
-
- para "happened to beat"
- line "me… "
-
- para "It was a fluke!"
- done
-
-UnknownText_0x1754e5:
- text "What are you"
- line "doing?"
-
- para "I told you that"
- line "the place was"
-
- para "@"
- text_ram wStringBuffer5
- text "!"
- line "Don't try to run!"
- done
-
-JoeySharperText:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "looking sharper"
- cont "than before!"
-
- para "I doubt there's a"
- line "#MON as cool as"
-
- para "this guy in your"
- line "party!"
- done
-
-UnknownText_0x175591:
- text "Oh yeah, I took"
- line "down a @"
- text_ram wStringBuffer4
- text_start
- para "in the wild the"
- line "other day."
-
- para "It was a cakewalk."
- line "Well, I guess it"
-
- para "can't be helped,"
- line "us being so tough."
- done
-
-UnknownText_0x175611:
- text "Oh yeah, I saw a"
- line "wild @"
- text_ram wStringBuffer4
- text "!"
-
- para "I thought about"
- line "going for it, but"
-
- para "I decided to work"
- line "with my one-and-"
-
- para "only right to the"
- line "extreme end."
- done
-
-UnknownText_0x175693:
- text "Let's get together"
- line "and battle!"
-
- para "I promise things"
- line "will be different!"
-
- para "@"
- text_ram wStringBuffer5
- text "'s"
- line "where I'll be."
-
- para "Give me a shout"
- line "when you come."
- done
-
-UnknownText_0x17570a:
- text "All right. Later!"
- done
-
-UnknownText_0x17571d:
- text "I'm checking out"
- line "@"
- text_ram wStringBuffer4
- text "'s moves"
-
- para "and devising some"
- line "strategies."
-
- para "When I come up"
- line "with a good one,"
- cont "let's battle!"
- done
-
-UnknownText_0x175786:
- text "What's keeping"
- line "you, <PLAYER>!"
-
- para "Let's get down and"
- line "battle already!"
-
- para "I'm waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-WadeAreYouGrowingText:
- text "Are your #MON"
- line "growing?"
-
- para "My #MON are"
- line "growing a bit too"
-
- para "quickly for me."
- line "It's overwhelming!"
-
- para "@"
- text_ram wStringBuffer4
- text "'s grow-"
- line "ing especially"
-
- para "quickly. I think"
- line "it'll get tough."
- done
-
-UnknownText_0x175869:
- text "Oh yeah, we KO'd a"
- line "wild @"
- text_ram wStringBuffer4
- text_start
- para "with one hit a"
- line "while back."
-
- para "It went down so"
- line "easily, I felt a"
-
- para "little sorry for"
- line "the poor thing."
- done
-
-UnknownText_0x1758e4:
- text "Oh yeah, a wild"
- line "@"
- text_ram wStringBuffer4
- text " got"
-
- para "away from me at"
- line "the last second."
-
- para "I know it's a"
- line "common #MON…"
-
- para "But it does annoy"
- line "me that it got"
-
- para "away when I almost"
- line "had it."
- done
-
-UnknownText_0x175976:
- text "Do you feel like a"
- line "#MON battle?"
-
- para "It won't be like"
- line "last time!"
-
- para "@"
- text_ram wStringBuffer5
- text "'s"
- line "where I'll be."
-
- para "Let me know when"
- line "you get there."
- done
-
-UnknownText_0x1759e7:
- text "See you later!"
- done
-
-WadeBugCatchingContestText:
- text "The Bug-Catching"
- line "Contest is at the"
-
- para "NATIONAL PARK"
- line "today."
-
- para "Are you going,"
- line "<PLAY_G>?"
-
- para "I'm trying to make"
- line "up my mind."
- done
-
-WadeFoundBerryText:
- text "I found all kinds"
- line "of BERRIES. If you"
-
- para "want, I'll share"
- line "some with you."
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x175abe:
- text "Huh? BERRIES?"
-
- para "Sorry, I haven't"
- line "found any yet."
-
- para "I'll call you if I"
- line "find any. Will you"
- cont "please wait?"
- done
-
-UnknownText_0x175b1e:
- text "Let's battle"
- line "already!"
-
- para "@"
- text_ram wStringBuffer5
- text " is"
- line "where I am."
-
- para "Please get here as"
- line "soon as you can!"
- done
-
-UnknownText_0x175b6d:
- text "How come you're"
- line "not here yet?"
-
- para "@"
- text_ram wStringBuffer5
- text " is"
- line "where I am."
-
- para "Please get here as"
- line "soon as you can!"
- done
-
-RalphNeglectingKidsText:
- text "I've been spending"
- line "more time with my"
-
- para "@"
- text_ram wStringBuffer4
- text " than I"
- line "have with my kids."
-
- para "That's a bit sad,"
- line "actually."
- done
-
-UnknownText_0x175c24:
- text "I just beat a wild"
- line "@"
- text_ram wStringBuffer4
- text "."
-
- para "I told my kid, but"
- line "he scoffed that he"
-
- para "could do the same"
- line "thing easily."
-
- para "Boy, has he gotten"
- line "cocky…"
- done
-
-UnknownText_0x175c9f:
- text "Yesterday a wild"
- line "@"
- text_ram wStringBuffer4
- text " slipped"
-
- para "away from me, in"
- line "front of my kid."
-
- para "I was feeling down"
- line "about it until he"
-
- para "shared his #"
- line "BALLS with me."
-
- para "Hahah, that sure"
- line "made my day!"
- done
-
-UnknownText_0x175d40:
- text "What do you say to"
- line "a battle with me?"
-
- para "Good, you're going"
- line "to do it!"
-
- para "For a kid, you're"
- line "quite agreeable."
-
- para "@"
- text_ram wStringBuffer5
- text " is"
- line "the spot!"
- done
-
-UnknownText_0x175db7:
- text "You call your mom"
- line "sometimes too!"
- done
-
-UnknownText_0x175dd9:
- text "Listen, I… Yowch!"
-
- para "Uh, sorry! See,"
- line "@"
- text_ram wStringBuffer4
- text " are"
-
- para "biting like there"
- line "is no tomorrow"
-
- para "over here on"
- line "@"
- text_ram wStringBuffer5
- text "!"
-
- para "Aiyee! Ouch!"
- line "One jabbed me!"
-
- para "Heh, they're some"
- line "kind of feisty!"
-
- para "<PLAY_G>, you have"
- line "to see this rare"
-
- para "sight! Get ready"
- line "to fish!"
- done
-
-UnknownText_0x175eaf:
- text "Yeah, I know."
-
- para "You're looking for"
- line "rare #MON."
-
- para "Recently, all I've"
- line "been catching are"
- cont "MAGIKARP, though…"
- done
-
-UnknownText_0x175f11:
- text "So where are you?"
- line "I'm waiting for"
-
- para "you to show up on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "You shouldn't make"
- line "your elders wait!"
- done
-
-UnknownText_0x175f70:
- text "Hey, what's the"
- line "matter with you?"
-
- para "Aren't you coming"
- line "over to fish for"
- cont "QWILFISH?"
-
- para "I'm on ROUTE 32,"
- line "so hurry up!"
- done
-
-UnknownText_0x175fda:
- text "Oh, you have to"
- line "hear this."
-
- para "My @"
- text_ram wStringBuffer4
- text " is"
- line "so adorable!"
-
- para "It always wants to"
- line "nuzzle me!"
- done
-
-UnknownText_0x17602d:
- text "And, and! Um…"
-
- para "We beat a wild"
- line "@"
- text_ram wStringBuffer4
- text " with"
-
- para "just one hit a"
- line "little while ago."
-
- para "We felt sorry for"
- line "it, though."
- done
-
-UnknownText_0x176095:
- text "And, and! Uh…"
-
- para "We just saw a"
- line "really gorgeous"
- cont "@"
- text_ram wStringBuffer4
- text "."
-
- para "But I was on the"
- line "phone, so it got"
-
- para "away. It made us"
- line "really angry!"
- done
-
-UnknownText_0x17610a:
- text "Hi! Do you have"
- line "some free time?"
-
- para "I've got all sorts"
- line "of time. If you're"
-
- para "free, would you"
- line "like to battle?"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "Let me know when"
- line "you get here!"
- done
-
-LizHiTaniaText:
- text "Hi, TANIA. How are"
- line "you? This is LIZ."
-
- para "I'm fine, but I'm"
- line "bored silly!"
-
- para "Huh… Wrong number?"
- line "Oops! Sorry!"
- done
-
-UnknownText_0x17620a:
- text "OK, I'll call you"
- line "later!"
- done
-
-UnknownText_0x176223:
- text "Listen, listen!"
-
- para "I was listening to"
- line "the radio in the"
-
- para "RUINS OF ALPH when"
- line "an odd broadcast"
-
- para "suddenly cut it on"
- line "the regular show."
-
- para "I wonder what it"
- line "was. So strange!"
- done
-
-UnknownText_0x1762c3:
- text "Listen, listen!"
-
- para "Don't you think"
- line "FALKNER of VIOLET"
-
- para "GYM is cool and"
- line "handsome?"
-
- para "But they say his"
- line "dad, who's out"
-
- para "training on the"
- line "road, is even more"
-
- para "cool and handsome"
- line "than FALKNER."
-
- para "I wish I could"
- line "meet him!"
- done
-
-UnknownText_0x17638a:
- text "Listen, listen!"
-
- para "Do you know EARL,"
- line "the teacher who"
-
- para "runs the #MON"
- line "ACADEMY in VIOLET?"
-
- para "I saw him doing"
- line "pirouettes while"
-
- para "he was running. It"
- line "was wildly funny!"
- done
-
-UnknownText_0x176424:
- text "Listen, listen!"
-
- para "I collect #MON"
- line "plush dolls."
-
- para "But I can't seem"
- line "to get a hold of a"
-
- para "SURF PIKACHU DOLL."
- line "None of my friends"
-
- para "have it. It must"
- line "be totally rare!"
-
- para "You could really"
- line "brag about it if"
- cont "you had one."
- done
-
-UnknownText_0x1764eb:
- text "Listen, listen!"
-
- para "Do you know about"
- line "MOOMOO MILK?"
-
- para "You can buy it at"
- line "MOOMOO FARM."
-
- para "It's supposed to"
- line "be good for health"
-
- para "and beauty."
- line "I really want to"
-
- para "try some. I bet"
- line "it's delicious!"
- done
-
-UnknownText_0x176599:
- text "Listen, listen!"
-
- para "There's a #MON"
- line "SALON in GOLDENROD"
-
- para "that's run by two"
- line "brothers."
-
- para "The older brother"
- line "is good, but the"
-
- para "younger one really"
- line "isn't."
-
- para "But sometimes the"
- line "younger one does a"
-
- para "better job than"
- line "his brother."
-
- para "Every time I go, I"
- line "have a hard time"
-
- para "trying to decide"
- line "whom I should use…"
- done
-
-UnknownText_0x1766ac:
- text "Listen, listen!"
-
- para "GOLDENROD GYM's"
- line "WHITNEY began"
-
- para "battling only a"
- line "little while ago!"
-
- para "But the #MON"
- line "LEAGUE chose her"
- cont "as a GYM LEADER!"
-
- para "I bet she must be"
- line "totally talented."
- done
-
-UnknownText_0x17674f:
- text "Listen, listen!"
-
- para "Have you ever"
- line "taken part in a"
-
- para "Bug-Catching"
- line "Contest at the"
- cont "NATIONAL PARK?"
-
- para "I did once, but"
- line "all I could catch"
- cont "was a CATERPIE."
-
- para "But guess what!"
-
- para "I won with that"
- line "CATERPIE. Isn't"
- cont "that great?"
- done
-
-UnknownText_0x176816:
- text "Listen, listen!"
-
- para "I saw a beautiful"
- line "@"
- text_ram wStringBuffer4
- text "!"
-
- para "I wish I could"
- line "become a beautiful"
- cont "@"
- text_ram wStringBuffer4
- text " too."
- done
-
-UnknownText_0x17686d:
- text "Listen, listen!"
-
- para "Uh… Um… Whoops!"
-
- para "I forgot what I"
- line "was going to say!"
- done
-
-UnknownText_0x1768b0:
- text "Listen, listen!"
-
- para "My @"
- text_ram wStringBuffer4
- text "…"
- line "it… so pretty…"
-
- para "and… giggle… so"
- line "awesome… yes… but…"
-
- para "very much… eeek!"
- line "And… lovely…"
-
- para "Just ravishing…"
- line "Oh, too much!"
-
- para "…Hug it… sleeping…"
- line "That's right…"
-
- para "pretty… sigh… So"
- line "nice… Cute…"
-
- para "…Oops! Look at the"
- line "time! I chatted"
- cont "too long!"
-
- para "I'm sorry I took"
- line "so much of your"
-
- para "time!"
- line "I love chatting!"
- done
-
-UnknownText_0x1769da:
- text "I've got too much"
- line "time on my hands!"
-
- para "Let's battle right"
- line "away!"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-AnthonyAteBerriesText:
- text "The other day, I"
- line "was watching my"
-
- para "@"
- text_ram wStringBuffer4
- text " eat"
- line "some BERRIES."
-
- para "It looked like it"
- line "was enjoying its"
-
- para "meal, so I decided"
- line "to try some."
-
- para "I'm not sure if"
- line "people should eat"
-
- para "that stuff, but it"
- line "was delicious!"
- done
-
-UnknownText_0x176aef:
- text "Lately, I've been"
- line "running across"
-
- para "wild @"
- text_ram wStringBuffer4
- text_start
- line "quite often."
-
- para "They're easily"
- line "taken care of."
- done
-
-UnknownText_0x176b45:
- text "Oh yeah, I was"
- line "battling this"
-
- para "@"
- text_ram wStringBuffer4
- text " the"
- line "other day…"
-
- para "It took off when I"
- line "got distracted by"
- cont "a passing BEAUTY."
-
- para "Learn from my"
- line "mistake--always"
-
- para "stay focused on"
- line "the job at hand!"
- done
-
-UnknownText_0x176bee:
- text "Come on--let's"
- line "battle right now!"
-
- para "@"
- text_ram wStringBuffer5
- text " is"
- line "where I am."
-
- para "Come on down if"
- line "you feel up to it!"
- done
-
-UnknownText_0x176c47:
- text "All right then!"
- line "Be good!"
- done
-
-UnknownText_0x176c61:
- text "<PLAYER>! It's"
- line "mind-blowing!"
-
- para "I took a hike in"
- line "@"
- text_ram wStringBuffer5
- text_start
- cont "yesterday, see?"
-
- para "Well, there were"
- line "tons of @"
- text_ram wStringBuffer4
- text_start
- para "around! You have"
- line "to see it!"
-
- para "I get this feeling"
- line "that @"
- text_ram wStringBuffer4
- text_start
- para "may be timid."
- line "I didn't see any"
-
- para "where there are"
- line "strong #MON."
- done
-
-UnknownText_0x176d32:
- text "Rare #MON?"
-
- para "Hey, sorry! I was"
- line "too focused on my"
-
- para "hike, so I wasn't"
- line "paying attention."
- done
-
-UnknownText_0x176d85:
- text "Hello! You haven't"
- line "forgotten about"
-
- para "our battle, have"
- line "you?"
-
- para "@"
- text_ram wStringBuffer5
- text "!"
- line "I'm waiting!"
- done
-
-UnknownText_0x176dd1:
- text "Hello? What? Where"
- line "is DUNSPARCE?"
-
- para "DARK CAVE! Hurry!"
-
- para "I know I've said"
- line "it before, but"
-
- para "DUNSPARCE don't"
- line "appear when there"
-
- para "are strong #MON"
- line "around."
- done
-
-ToddLooksCuteLikeMeText:
- text "My @"
- text_ram wStringBuffer4
- text " is"
- line "looking more and"
-
- para "more like me. It's"
- line "getting cuter!"
- done
-
-UnknownText_0x176e9c:
- text "And, you know?"
-
- para "Now we can KO"
- line "@"
- text_ram wStringBuffer4
- text " easily."
-
- para "I should challenge"
- line "the GOLDENROD GYM."
- done
-
-UnknownText_0x176eee:
- text "And, you know?"
- line "We just failed to"
-
- para "beat @"
- text_ram wStringBuffer4
- text " by"
- line "a tiny margin."
-
- para "I'm guessing my"
- line "#MON's levels"
-
- para "aren't high enough"
- line "yet…"
- done
-
-UnknownText_0x176f60:
- text "You must be a lot"
- line "better now, huh?"
-
- para "How about showing"
- line "me your technique"
-
- para "in a real battle"
- line "with me?"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x176fdb:
- text "See you later!"
- done
-
-UnknownText_0x176feb:
- text "This is it--the"
- line "one we've all been"
- cont "waiting for!"
-
- para "GOLDENROD DEPT."
- line "STORE's bargain"
- cont "sale is on now!"
-
- para "Want it cheap?"
- line "Want it lots?"
-
- para "Don't miss this"
- line "GOLDENROD chance!"
-
- para "Huh? I sound like"
- line "a huckster?"
-
- para "Well, yeah. I was"
- line "mimicking them…"
-
- para "Anyway, you've got"
- line "to get there as"
- cont "soon as you can!"
- done
-
-UnknownText_0x1770fb:
- text "I'm saving up for"
- line "the next bargain"
-
- para "sale. When's the"
- line "next one?"
- done
-
-UnknownText_0x177138:
- text "Where are you?"
-
- para "Let's have our"
- line "battle soon!"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
- done
-
-UnknownText_0x17717c:
- text "Haven't you gone"
- line "to GOLDENROD DEPT."
-
- para "STORE? I've scoped"
- line "it out already!"
-
- para "They had some real"
- line "bargains."
-
- para "You should get"
- line "there quickly."
- done
-
-UnknownText_0x1771fd:
- text "My @"
- text_ram wStringBuffer4
- text " and"
- line "I are getting more"
-
- para "in sync with each"
- line "other."
- done
-
-UnknownText_0x177237:
- text "We battled a wild"
- line "@"
- text_ram wStringBuffer4
- text " and"
-
- para "managed to drop it"
- line "in a close match."
-
- para "We're getting into"
- line "the groove!"
- done
-
-UnknownText_0x177297:
- text "But, you know?"
-
- para "I still haven't"
- line "caught @"
- text_ram wStringBuffer4
- text "."
-
- para "It's getting past"
- line "frustrating…"
- done
-
-UnknownText_0x1772e2:
- text "Would you be my"
- line "practice partner"
- cont "again sometime?"
-
- para "I'll be waiting on"
- line "@"
- text_ram wStringBuffer5
- text "."
-
- para "…Could you take it"
- line "a little easier on"
- cont "me next time?"
- done
-
-UnknownText_0x177361:
- text "Bye! Let's chat"
- line "again!"
- done
-
-UnknownText_0x177378:
- text "Have you heard"
- line "about TEAM ROCKET?"
-
- para "They've taken over"
- line "the RADIO TOWER in"
- cont "GOLDENROD."
-
- para "Are the people"
- line "inside safe?"
- done
-
-UnknownText_0x1773e7:
- text "I picked up some-"
- line "thing nice today."
-
- para "I want you to have"
- line "it, so I called!"
-
- para "You will come for"
- line "it, won't you?"
-
- para "@"
- text_ram wStringBuffer5
- text " is"
- line "where I am."
- done
-
-UnknownText_0x177465:
- text "Sorry, I haven't"
- line "found anything"
-
- para "useful yet…"
- line "I promise, if I"
-
- para "find anything, you"
- line "can have it!"
- done
-
-UnknownText_0x1774c1:
- text "Oh, <PLAY_G>!"
- line "How soon can I"
-
- para "expect to see you"
- line "for our battle?"
-
- para "Don't forget,"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
-
-UnknownText_0x17750e:
- text "I'm getting really"
- line "impatient, waiting"
-
- para "to give you my"
- line "present!"
-
- para "Hurry over to"
- line "@"
- text_ram wStringBuffer5
- text "!"
- done
diff --git a/data/phone/text/gaven_callee.asm b/data/phone/text/gaven_callee.asm
new file mode 100644
index 000000000..3191ca7db
--- /dev/null
+++ b/data/phone/text/gaven_callee.asm
@@ -0,0 +1,72 @@
+UnknownText_0x1b5270:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking…"
+
+ para "Hi, <PLAY_G>!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b52a5:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking…"
+
+ para "Hi, <PLAY_G>!"
+ done
+
+UnknownText_0x1b52cc:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking…"
+
+ para "Hi, <PLAY_G>!"
+ line "Good evening!"
+ done
+
+UnknownText_0x1b5301:
+ text "<PLAY_G>, good"
+ line "morning!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you doing?"
+ done
+
+UnknownText_0x1b5335:
+ text "Hi, <PLAY_G>!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you doing?"
+ done
+
+UnknownText_0x1b535f:
+ text "<PLAY_G>, good"
+ line "evening!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you doing?"
+ done
+
+UnknownText_0x1b5393:
+ text "How are your"
+ line "#MON doing?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "doing as great as"
+ cont "ever."
+
+ para "Let's keep at it"
+ line "and become #MON"
+ cont "CHAMPS!"
+ done
diff --git a/data/phone/text/gaven_caller.asm b/data/phone/text/gaven_caller.asm
new file mode 100644
index 000000000..96b5c9086
--- /dev/null
+++ b/data/phone/text/gaven_caller.asm
@@ -0,0 +1,85 @@
+GavenGreaterText:
+ text "My @"
+ text_ram wStringBuffer4
+ text_start
+ line "might be greater"
+ cont "than I imagined."
+
+ para "I doubt I'll see a"
+ line "@"
+ text_ram wStringBuffer4
+ text " that's"
+ cont "better than mine."
+ done
+
+UnknownText_0x174a80:
+ text "Oh, and I managed"
+ line "to barely defeat"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " the"
+ line "other day."
+
+ para "I've never seen a"
+ line "@"
+ text_ram wStringBuffer4
+ text " get"
+ cont "that strong…"
+
+ para "You shouldn't let"
+ line "your guard down,"
+
+ para "even against a"
+ line "#MON you're"
+ cont "used to seeing."
+ done
+
+UnknownText_0x174b2d:
+ text "And a while back,"
+ line "I tried to catch a"
+ cont "wild @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "But it managed to"
+ line "elude me."
+
+ para "One wrong decision"
+ line "could mean total"
+
+ para "failure… You ought"
+ line "to be careful too."
+ done
+
+UnknownText_0x174bc5:
+ text "Let's battle!"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Give me a shout"
+ line "when you're close."
+ done
+
+UnknownText_0x174c0e:
+ text "OK, I'll talk to"
+ line "you soon!"
+ done
+
+UnknownText_0x174c29:
+ text "I obsess over how"
+ line "to beat you."
+ done
+
+UnknownText_0x174c49:
+ text "<PLAY_G>, why"
+ line "aren't you here?"
+
+ para "I'll take you down"
+ line "with @"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/gina_callee.asm b/data/phone/text/gina_callee.asm
new file mode 100644
index 000000000..3c86e94e6
--- /dev/null
+++ b/data/phone/text/gina_callee.asm
@@ -0,0 +1,66 @@
+UnknownText_0x1b626a:
+ text "Hello? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, <PLAY_G>!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b6296:
+ text "Hello? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, <PLAY_G>!"
+ line "Hi, how are you?"
+ done
+
+UnknownText_0x1b62c5:
+ text "Hello? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, <PLAY_G>!"
+ line "Good evening!"
+ done
+
+UnknownText_0x1b62f1:
+ text "<PLAY_G>?"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "."
+ line "Good morning!"
+ done
+
+UnknownText_0x1b630e:
+ text "<PLAY_G>?"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text ". Is"
+ line "this a bad time?"
+ done
+
+UnknownText_0x1b6331:
+ text "<PLAY_G>?"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "."
+ line "Got time to chat?"
+ done
+
+UnknownText_0x1b6352:
+ text "Are your #MON"
+ line "still tough?"
+
+ para "I train every day"
+ line "with @"
+ text_ram wStringBuffer4
+ text "."
+ done
diff --git a/data/phone/text/gina_caller.asm b/data/phone/text/gina_caller.asm
new file mode 100644
index 000000000..eb65d3786
--- /dev/null
+++ b/data/phone/text/gina_caller.asm
@@ -0,0 +1,119 @@
+UnknownText_0x1771fd:
+ text "My @"
+ text_ram wStringBuffer4
+ text " and"
+ line "I are getting more"
+
+ para "in sync with each"
+ line "other."
+ done
+
+UnknownText_0x177237:
+ text "We battled a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text " and"
+
+ para "managed to drop it"
+ line "in a close match."
+
+ para "We're getting into"
+ line "the groove!"
+ done
+
+UnknownText_0x177297:
+ text "But, you know?"
+
+ para "I still haven't"
+ line "caught @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "It's getting past"
+ line "frustrating…"
+ done
+
+UnknownText_0x1772e2:
+ text "Would you be my"
+ line "practice partner"
+ cont "again sometime?"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "…Could you take it"
+ line "a little easier on"
+ cont "me next time?"
+ done
+
+UnknownText_0x177361:
+ text "Bye! Let's chat"
+ line "again!"
+ done
+
+UnknownText_0x177378:
+ text "Have you heard"
+ line "about TEAM ROCKET?"
+
+ para "They've taken over"
+ line "the RADIO TOWER in"
+ cont "GOLDENROD."
+
+ para "Are the people"
+ line "inside safe?"
+ done
+
+UnknownText_0x1773e7:
+ text "I picked up some-"
+ line "thing nice today."
+
+ para "I want you to have"
+ line "it, so I called!"
+
+ para "You will come for"
+ line "it, won't you?"
+
+ para "@"
+ text_ram wStringBuffer5
+ text " is"
+ line "where I am."
+ done
+
+UnknownText_0x177465:
+ text "Sorry, I haven't"
+ line "found anything"
+
+ para "useful yet…"
+ line "I promise, if I"
+
+ para "find anything, you"
+ line "can have it!"
+ done
+
+UnknownText_0x1774c1:
+ text "Oh, <PLAY_G>!"
+ line "How soon can I"
+
+ para "expect to see you"
+ line "for our battle?"
+
+ para "Don't forget,"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x17750e:
+ text "I'm getting really"
+ line "impatient, waiting"
+
+ para "to give you my"
+ line "present!"
+
+ para "Hurry over to"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/huey_callee.asm b/data/phone/text/huey_callee.asm
new file mode 100644
index 000000000..9fc78d76f
--- /dev/null
+++ b/data/phone/text/huey_callee.asm
@@ -0,0 +1,59 @@
+UnknownText_0x1b5073:
+ text "Yeah, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Huh? What's up,"
+ line "<PLAYER>?"
+ done
+
+UnknownText_0x1b509b:
+ text "Yeah, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Huh? What's up"
+ line "<PLAYER>?"
+ done
+
+UnknownText_0x1b50c2:
+ text "Yeah, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Huh? What's up"
+ line "<PLAYER>?"
+ done
+
+UnknownText_0x1b50e9:
+ text "Yo, <PLAYER>!"
+ line "You awake?"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ line "How's it going?"
+ done
+
+UnknownText_0x1b511a:
+ text "Yo, <PLAYER>! You"
+ line "free right now?"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ line "How's it going?"
+ done
+
+UnknownText_0x1b5154:
+ text "Yo, <PLAYER>!"
+ line "Were you asleep?"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ line "How's it going?"
+ done
diff --git a/data/phone/text/huey_caller.asm b/data/phone/text/huey_caller.asm
new file mode 100644
index 000000000..a4822f059
--- /dev/null
+++ b/data/phone/text/huey_caller.asm
@@ -0,0 +1,43 @@
+UnknownText_0x1748ea:
+ text "Hey, I challenge"
+ line "you to a battle!"
+
+ para "It won't be like"
+ line "last time!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "'s"
+ line "where I'm waiting"
+
+ para "for you. Hustle"
+ line "over here pronto!"
+ done
+
+UnknownText_0x174962:
+ text "See ya!"
+ done
+
+UnknownText_0x17496b:
+ text "We have to battle"
+ line "again sometime."
+
+ para "You can bet I'm"
+ line "going to keep"
+
+ para "challenging you"
+ line "till I win."
+ done
+
+UnknownText_0x1749c7:
+ text "Hey, you'd better"
+ line "not have forgotten"
+ cont "about our battle!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "!"
+
+ para "Hustle over quick!"
+ line "I'm waiting!"
+ done
diff --git a/data/phone/text/irwin_callee.asm b/data/phone/text/irwin_callee.asm
new file mode 100644
index 000000000..46bcda8b4
--- /dev/null
+++ b/data/phone/text/irwin_callee.asm
@@ -0,0 +1,56 @@
+UnknownText_0x1b638c:
+ text "Hello? @"
+ text_ram wStringBuffer3
+ text_start
+ line "here…"
+
+ para "Hey, <PLAY_G>!"
+ done
+
+UnknownText_0x1b63a8:
+ text "Hello? @"
+ text_ram wStringBuffer3
+ text_start
+ line "here…"
+
+ para "Wow, <PLAY_G>!"
+ done
+
+UnknownText_0x1b63c4:
+ text "Hello? @"
+ text_ram wStringBuffer3
+ text_start
+ line "here…"
+
+ para "Yippee, <PLAY_G>!"
+ done
+
+UnknownText_0x1b63e3:
+ text "Uh, hello."
+ line "<PLAY_G>?"
+
+ para "It's your pal,"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b6407:
+ text "Uh, hello,"
+ line "<PLAY_G>?"
+
+ para "It's your buddy"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b642c:
+ text "Uh, hello,"
+ line "<PLAY_G>?"
+
+ para "It's your sidekick"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+ done
diff --git a/data/phone/text/irwin_caller.asm b/data/phone/text/irwin_caller.asm
new file mode 100644
index 000000000..552cf8259
--- /dev/null
+++ b/data/phone/text/irwin_caller.asm
@@ -0,0 +1,289 @@
+UnknownText_0x64000:
+ text "I hate having to"
+ line "hang up on you!"
+
+ para "Call you later!"
+ done
+
+UnknownText_0x64032:
+ text "<PLAY_G>, have you"
+ line "heard?"
+
+ para "GOLDENROD's RADIO"
+ line "TOWER has been"
+
+ para "taken over by TEAM"
+ line "ROCKET!"
+
+ para "…Um… What's TEAM"
+ line "ROCKET?"
+ done
+
+UnknownText_0x64099:
+ text "<PLAY_G>, I heard!"
+
+ para "You defeated that"
+ line "WHITNEY?"
+
+ para "It makes me proud"
+ line "to be your friend!"
+ done
+
+UnknownText_0x640e6:
+ text "Hey, I heard about"
+ line "you!"
+
+ para "You saved that"
+ line "#MON at the"
+
+ para "LIGHTHOUSE, didn't"
+ line "you?"
+
+ para "<PLAY_G>, I wish"
+ line "you'd come see me"
+
+ para "when I'm sick in"
+ line "bed with a cold!"
+ done
+
+UnknownText_0x6416d:
+ text "I heard, I heard,"
+ line "I heard!"
+
+ para "You smashed TEAM"
+ line "ROCKET's hideout!"
+
+ para "You're like a"
+ line "movie hero, even!"
+
+ para "But um… What was"
+ line "TEAM ROCKET?"
+ done
+
+UnknownText_0x641e8:
+ text "I heard, I heard,"
+ line "I heard!"
+
+ para "About your heroic"
+ line "liberation of the"
+
+ para "RADIO TOWER! You"
+ line "rock so hard!"
+ done
+
+UnknownText_0x64247:
+ text "I saw, I saw!"
+
+ para "I saw you go into"
+ line "the DRAGON'S DEN!"
+
+ para "I'm certain you"
+ line "passed! Aww, no"
+
+ para "need to be modest!"
+ line "You can't fail!"
+ done
+
+UnknownText_0x642bb:
+ text "Yesterday, I went"
+ line "out to NEW BARK"
+
+ para "TOWN. There was a"
+ line "lady who looked a"
+
+ para "lot like you,"
+ line "<PLAY_G>."
+
+ para "What? That lady"
+ line "was your mom?"
+
+ para "Aww, I should've"
+ line "introduced myself!"
+
+ para "I bet your mom's"
+ line "really proud of"
+
+ para "all that you've"
+ line "accomplished."
+
+ para "Heh, put it this"
+ line "way. I'd be proud"
+
+ para "if I were your"
+ line "mom, believe me!"
+ done
+
+UnknownText_0x643d4:
+ text "I saw, I saw,"
+ line "I saw!"
+
+ para "You striding onto"
+ line "a ship, <PLAY_G>!"
+
+ para "I can't get over"
+ line "how good you look"
+
+ para "with the sea as"
+ line "your backdrop!"
+ done
+
+UnknownText_0x64448:
+ text "I heard, I heard!"
+
+ para "You got a MAGNET"
+ line "TRAIN PASS!"
+
+ para "When I saw you"
+ line "departing on the"
+
+ para "ship, I felt sad"
+ line "that I wouldn't be"
+
+ para "able to see you"
+ line "for a while."
+
+ para "But since you have"
+ line "that PASS, you can"
+
+ para "zip back anytime!"
+ line "That's reassuring!"
+
+ para "What? You can FLY"
+ line "back anytime?"
+
+ para "What do you mean"
+ line "by FLY?"
+ done
+
+UnknownText_0x6455b:
+ text "I saw, I saw!"
+
+ para "You waking up"
+ line "SNORLAX!"
+
+ para "I was watching you"
+ line "from afar, so I"
+
+ para "couldn't tell what"
+ line "you did exactly."
+
+ para "Did you play a"
+ line "flute to wake it?"
+
+ para "Wow! That's like"
+ line "magic!"
+ done
+
+UnknownText_0x645ff:
+ text "I hear rumors"
+ line "about you all over"
+ cont "the place."
+
+ para "It just makes me"
+ line "sigh, <PLAY_G>."
+
+ para "How did you get so"
+ line "strong?"
+
+ para "Go for the world"
+ line "championship now!"
+
+ para "I'll always be"
+ line "cheering you on!"
+ done
+
+IrwinCalledRightAwayText:
+ text "Hehe, I called"
+ line "right away!"
+
+ para "I think we can be"
+ line "good friends!"
+ done
+
+UnknownText_0x646df:
+ text "I saw, I heard!"
+
+ para "You beat MORTY of"
+ line "ECRUTEAK GYM!"
+
+ para "Th-that's just"
+ line "incredible!"
+
+ para "I actually went to"
+ line "the GYM's entrance"
+
+ para "to cheer you on."
+ line "Did you know that?"
+
+ para "But everyone was"
+ line "floating, and"
+
+ para "there were ghosts"
+ line "all over! So I"
+
+ para "chickened out and"
+ line "took off for home…"
+ done
+
+UnknownText_0x647d8:
+ text "<PLAY_G>, I heard!"
+
+ para "You're kicking up"
+ line "a mighty ruckus"
+
+ para "over in KANTO!"
+ line "What a glorious"
+
+ para "rampage it must"
+ line "be!"
+
+ para "You so rock!"
+ done
+
+UnknownText_0x64846:
+ text "Hearing about your"
+ line "escapades rocks my"
+
+ para "soul!"
+ line "It sure does!"
+ done
+
+UnknownText_0x64881:
+ text "I'm so glad you"
+ line "called!"
+
+ para "I was just about"
+ line "to call you too!"
+
+ para "I guess we must be"
+ line "a good match!"
+ done
+
+UnknownText_0x648dc:
+ text "How are you?"
+
+ para "What are you"
+ line "doing?"
+
+ para "Where are you?"
+
+ para "How many BADGES do"
+ line "you have now?"
+
+ para "How much money"
+ line "have you saved?"
+
+ para "How's your mom?"
+
+ para "Have you got lots"
+ line "of #MON?"
+
+ para "Is it going to be"
+ line "sunny tomorrow?"
+
+ para "Arrgh, there's so"
+ line "much I want to"
+
+ para "chat about! This"
+ line "is going nowhere!"
+ done
diff --git a/data/phone/text/jack_callee.asm b/data/phone/text/jack_callee.asm
new file mode 100644
index 000000000..18c0ec1a4
--- /dev/null
+++ b/data/phone/text/jack_callee.asm
@@ -0,0 +1,71 @@
+UnknownText_0x1b4dc5:
+ text "Hello. This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Good morning,"
+ line "<PLAY_G>!"
+ done
+
+UnknownText_0x1b4ded:
+ text "Hello. This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "How's it going,"
+ line "<PLAY_G>?"
+ done
+
+UnknownText_0x1b4e16:
+ text "Hello. This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Good evening,"
+ line "<PLAY_G>!"
+ done
+
+UnknownText_0x1b4e3e:
+ text "<PLAY_G>, good"
+ line "morning!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "How are you doing?"
+ done
+
+UnknownText_0x1b4e72:
+ text "<PLAY_G>, howdy!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "Isn't it nice out?"
+ done
+
+UnknownText_0x1b4e9e:
+ text "<PLAY_G>, good"
+ line "evening!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "Got a minute?"
+ done
+
+UnknownText_0x1b4ecd:
+ text "How are your"
+ line "#MON doing?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "so curious, it's a"
+
+ para "problem. Maybe"
+ line "it's like me…"
+ done
diff --git a/data/phone/text/jack_caller.asm b/data/phone/text/jack_caller.asm
new file mode 100644
index 000000000..671097a34
--- /dev/null
+++ b/data/phone/text/jack_caller.asm
@@ -0,0 +1,193 @@
+JackIntelligenceText:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "intelligence keeps"
+
+ para "rising. It might"
+ line "be smarter than"
+ cont "yours!"
+ done
+
+JackDefeatedMonText:
+ text "The other day, I"
+ line "easily defeated a"
+ cont "@"
+ text_ram wStringBuffer4
+ text "."
+
+ para "I think swapping"
+ line "tips with you is"
+ cont "starting to help."
+ done
+
+UnknownText_0x174165:
+ text "Oh, and listen."
+ line "I missed catching"
+
+ para "a @"
+ text_ram wStringBuffer4
+ text " by"
+ line "just a tiny bit."
+
+ para "If I'd been a bit"
+ line "more informed, I'm"
+
+ para "sure I would've"
+ line "caught it…"
+ done
+
+UnknownText_0x1741e1:
+ text "Do you want to"
+ line "battle? I'll show"
+
+ para "you how to battle"
+ line "logically."
+
+ para "I'll be in"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Give me a shout if"
+ line "you're nearby."
+ done
+
+UnknownText_0x174251:
+ text "See you later!"
+ done
+
+JackThunderTriviaText:
+ text "Did you know?"
+
+ para "When it's raining,"
+ line "THUNDER is sure to"
+ cont "strike."
+ done
+
+JackRolloutTriviaText:
+ text "Did you know…?"
+
+ para "If you use DEFENSE"
+ line "CURL, ROLLOUT's"
+
+ para "power goes way up"
+ line "past normal."
+ done
+
+JackSolarbeamTriviaText:
+ text "Did you know…?"
+
+ para "If the sunlight is"
+ line "harsh, SOLARBEAM"
+
+ para "doesn't need to be"
+ line "charged up."
+ done
+
+JackStompTriviaText:
+ text "Did you know…?"
+
+ para "If the opponent"
+ line "uses MINIMIZE,"
+
+ para "your STOMP becomes"
+ line "more powerful."
+ done
+
+JackGustTriviaText:
+ text "Did you know…?"
+
+ para "If your opponent"
+ line "is FLYing, your"
+
+ para "GUST becomes much"
+ line "more powerful."
+ done
+
+JackTwisterTriviaText:
+ text "Did you know…?"
+
+ para "If your opponent"
+ line "is FLYing, your"
+
+ para "TWISTER becomes"
+ line "more powerful."
+ done
+
+JackEarthquakeTriviaText:
+ text "Did you know…?"
+
+ para "If your opponent"
+ line "uses DIG, your"
+
+ para "EARTHQUAKE becomes"
+ line "more powerful."
+ done
+
+JackMagnitudeTriviaText:
+ text "Did you know…?"
+
+ para "If your opponent"
+ line "uses DIG, your"
+
+ para "MAGNITUDE becomes"
+ line "more powerful."
+ done
+
+JackSandstormTriviaText:
+ text "Did you know…?"
+
+ para "The rock, ground"
+ line "and steel types"
+
+ para "can't be hurt by"
+ line "SANDSTORM."
+ done
+
+JackSunnyDayTriviaText:
+ text "Did you know…?"
+
+ para "If the sunlight is"
+ line "harsh, water-type"
+
+ para "moves become much"
+ line "weaker."
+ done
+
+JackRainDanceTriviaText:
+ text "Did you know…?"
+
+ para "When it's raining,"
+ line "fire-type moves"
+
+ para "become much weaker"
+ line "than usual."
+ done
+
+UnknownText_0x1745c2:
+ text "My friend heard"
+ line "some great tips."
+
+ para "He's going to let"
+ line "me in on some."
+
+ para "When he tells me,"
+ line "I'll call right"
+ cont "away and tell you."
+ done
+
+UnknownText_0x174638:
+ text "Hey, <PLAY_G>!"
+
+ para "Do you remember"
+ line "your promise?"
+
+ para "We have to battle"
+ line "soon!"
+
+ para "I'll be at"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
diff --git a/data/phone/text/joey_callee.asm b/data/phone/text/joey_callee.asm
new file mode 100644
index 000000000..c86ba29fc
--- /dev/null
+++ b/data/phone/text/joey_callee.asm
@@ -0,0 +1,73 @@
+UnknownText_0x1b589a:
+ text "Hi, @"
+ text_ram wStringBuffer3
+ text " here!"
+
+ para "Oh, <PLAYER>? You"
+ line "doing well?"
+ done
+
+UnknownText_0x1b58c2:
+ text "Hi, @"
+ text_ram wStringBuffer3
+ text " here!"
+
+ para "Oh, <PLAYER>? You"
+ line "doing well?"
+ done
+
+UnknownText_0x1b58ea:
+ text "Hi, @"
+ text_ram wStringBuffer3
+ text " here!"
+
+ para "Oh, <PLAYER>? You"
+ line "doing well?"
+ done
+
+UnknownText_0x1b5912:
+ text "Yo, <PLAYER>!"
+ line "How're you doing?"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text ","
+ line "got a minute?"
+ done
+
+UnknownText_0x1b5948:
+ text "Yo, <PLAYER>! How's"
+ line "it going?"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text "."
+ line "Got a minute?"
+ done
+
+UnknownText_0x1b597c:
+ text "Yo, <PLAYER>!"
+ line "How're you doing?"
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text ","
+ line "got a minute?"
+ done
+
+UnknownText_0x1b59b2:
+ text "How are your"
+ line "#MON doing?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "raring to go, just"
+ cont "like always."
+
+ para "It's the only one"
+ line "I have. I'm going"
+
+ para "to become a great"
+ line "trainer with it!"
+ done
diff --git a/data/phone/text/joey_caller.asm b/data/phone/text/joey_caller.asm
new file mode 100644
index 000000000..dcf1dfd71
--- /dev/null
+++ b/data/phone/text/joey_caller.asm
@@ -0,0 +1,91 @@
+JoeySharperText:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "looking sharper"
+ cont "than before!"
+
+ para "I doubt there's a"
+ line "#MON as cool as"
+
+ para "this guy in your"
+ line "party!"
+ done
+
+UnknownText_0x175591:
+ text "Oh yeah, I took"
+ line "down a @"
+ text_ram wStringBuffer4
+ text_start
+ para "in the wild the"
+ line "other day."
+
+ para "It was a cakewalk."
+ line "Well, I guess it"
+
+ para "can't be helped,"
+ line "us being so tough."
+ done
+
+UnknownText_0x175611:
+ text "Oh yeah, I saw a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "I thought about"
+ line "going for it, but"
+
+ para "I decided to work"
+ line "with my one-and-"
+
+ para "only right to the"
+ line "extreme end."
+ done
+
+UnknownText_0x175693:
+ text "Let's get together"
+ line "and battle!"
+
+ para "I promise things"
+ line "will be different!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "'s"
+ line "where I'll be."
+
+ para "Give me a shout"
+ line "when you come."
+ done
+
+UnknownText_0x17570a:
+ text "All right. Later!"
+ done
+
+UnknownText_0x17571d:
+ text "I'm checking out"
+ line "@"
+ text_ram wStringBuffer4
+ text "'s moves"
+
+ para "and devising some"
+ line "strategies."
+
+ para "When I come up"
+ line "with a good one,"
+ cont "let's battle!"
+ done
+
+UnknownText_0x175786:
+ text "What's keeping"
+ line "you, <PLAYER>!"
+
+ para "Let's get down and"
+ line "battle already!"
+
+ para "I'm waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/jose_callee.asm b/data/phone/text/jose_callee.asm
new file mode 100644
index 000000000..c476d431b
--- /dev/null
+++ b/data/phone/text/jose_callee.asm
@@ -0,0 +1,69 @@
+UnknownText_0x1b55ae:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, <PLAY_G>?"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b55da:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, <PLAY_G>? Hi!"
+ done
+
+UnknownText_0x1b55fc:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, <PLAY_G>?"
+ line "Good evening!"
+ done
+
+UnknownText_0x1b5628:
+ text "Oh, <PLAY_G>?"
+
+ para "Tweet! Yeah, it's"
+ line "me, @"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b564c:
+ text "Oh, <PLAY_G>?"
+
+ para "Tweet! Yeah, it's"
+ line "me, @"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b5670:
+ text "Oh, <PLAY_G>?"
+
+ para "Tweet! Yeah, it's"
+ line "me, @"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b5694:
+ text "Are your #MON"
+ line "still cooking?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " has"
+ line "too much energy."
+
+ para "Once it takes off,"
+ line "it won't come back"
+ cont "for a while."
+ done
diff --git a/data/phone/text/jose_caller.asm b/data/phone/text/jose_caller.asm
new file mode 100644
index 000000000..33d022855
--- /dev/null
+++ b/data/phone/text/jose_caller.asm
@@ -0,0 +1,130 @@
+JoseAromaText:
+ text "Hey listen, my"
+ line "@"
+ text_ram wStringBuffer4
+ text "'s stick"
+
+ para "has this really"
+ line "delicious aroma."
+
+ para "That aroma gets my"
+ line "appetite going!"
+ done
+
+UnknownText_0x174f90:
+ text "A while ago, my"
+ line "FARFETCH'D KO'd"
+ cont "this @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "You should have"
+ line "seen FARFETCH'D"
+
+ para "wield that stick."
+ line "Amazing stuff!"
+ done
+
+UnknownText_0x174ffd:
+ text "I ran into a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text "…"
+
+ para "I was trying to"
+ line "catch it, but it"
+
+ para "took off faster"
+ line "than I thought it"
+
+ para "would. It was a"
+ line "bit disappointing."
+ done
+
+UnknownText_0x17507d:
+ text "Want to battle"
+ line "again?"
+
+ para "For some reason,"
+ line "my FARFETCH'D is"
+
+ para "all worked up and"
+ line "raring to go."
+
+ para "@"
+ text_ram wStringBuffer5
+ text "'s"
+ line "where I'm at."
+
+ para "Keep an eye out"
+ line "for me, OK?"
+ done
+
+UnknownText_0x175106:
+ text "Be seeing you!"
+ done
+
+JoseFoundSomethingText:
+ text "My FARFETCH'D had"
+ line "something pretty"
+ cont "in its beak."
+
+ para "Like I promised,"
+ line "you can have it."
+
+ para "Catch up to me on"
+ line "@"
+ text_ram wStringBuffer5
+ text ","
+
+ para "and I'll let you"
+ line "have it."
+ done
+
+UnknownText_0x17519b:
+ text "I haven't gotten"
+ line "what I promised"
+ cont "you yet."
+
+ para "I'll call you as"
+ line "soon as I get it,"
+
+ para "so could you wait"
+ line "a little longer?"
+ done
+
+UnknownText_0x17520a:
+ text "<PLAY_G>, could you"
+ line "hurry over?"
+
+ para "FARFETCH'D is"
+ line "agitated."
+
+ para "If you don't come"
+ line "soon, it might"
+
+ para "smack me with its"
+ line "stick!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "!"
+
+ para "Please come as"
+ line "soon as you can!"
+ done
+
+UnknownText_0x17529c:
+ text "What's wrong?"
+
+ para "Don't you want"
+ line "this gift?"
+
+ para "Catch up to me on"
+ line "@"
+ text_ram wStringBuffer5
+ text ","
+
+ para "and I'll let you"
+ line "have it."
+ done
diff --git a/data/phone/text/kenji_callee.asm b/data/phone/text/kenji_callee.asm
new file mode 100644
index 000000000..e108aa778
--- /dev/null
+++ b/data/phone/text/kenji_callee.asm
@@ -0,0 +1,44 @@
+UnknownText_0x1b730b:
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "<PLAYER>! Beautiful"
+ line "morning, hey?"
+ done
+
+UnknownText_0x1b7331:
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "<PLAYER>! Beautiful"
+ line "weather, hey?"
+ done
+
+UnknownText_0x1b7357:
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "<PLAYER>! Beautiful"
+ line "moonlight, hey?"
+ done
+
+UnknownText_0x1b737f:
+ text "Hey, <PLAYER>!"
+ line "This is @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b7397:
+ text "Hey, <PLAYER>!"
+ line "This is @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b73af:
+ text "Hey, <PLAYER>!"
+ line "This is @"
+ text_ram wStringBuffer3
+ text "!"
+ done
diff --git a/data/phone/text/kenji_caller.asm b/data/phone/text/kenji_caller.asm
new file mode 100644
index 000000000..d0f527d3b
--- /dev/null
+++ b/data/phone/text/kenji_caller.asm
@@ -0,0 +1,63 @@
+UnknownText_0x66dab:
+ text "Anyway, we'll chat"
+ line "again!"
+ done
+
+UnknownText_0x66dc5:
+ text "Are you still on"
+ line "your journey?"
+
+ para "I remain dedicated"
+ line "to my training."
+
+ para "Oooooaaarrrgh!"
+ done
+
+UnknownText_0x66e17:
+ text "I'm in training"
+ line "now. I apologize,"
+
+ para "but call me back"
+ line "another time."
+
+ para "Oooooaaarrrgh!"
+ done
+
+UnknownText_0x66e67:
+ text "I apologize, but I"
+ line "don't have time to"
+
+ para "chat while I am in"
+ line "training!"
+
+ para "I'll have time to"
+ line "chat tomorrow!"
+
+ para "Yiiihah!"
+ done
+
+UnknownText_0x66ed3:
+ text "I plan to take a"
+ line "lunch break, so"
+
+ para "come see me then!"
+ line "Ayiiiyah!"
+ done
+
+KenjiBreakText:
+ text "I'm taking a break"
+ line "on ROUTE 45!"
+
+ para "Why not drop by if"
+ line "you are free?"
+ done
+
+UnknownText_0x66f52:
+ text "I rested up over"
+ line "my lunch break."
+
+ para "Now it's time to"
+ line "resume training!"
+
+ para "Oooryaah!"
+ done
diff --git a/data/phone/text/liz_callee.asm b/data/phone/text/liz_callee.asm
new file mode 100644
index 000000000..93ea88923
--- /dev/null
+++ b/data/phone/text/liz_callee.asm
@@ -0,0 +1,81 @@
+UnknownText_0x1b5d9f:
+ text "Hello, @"
+ text_ram wStringBuffer3
+ text_start
+ line "speaking."
+
+ para "Oh, <PLAY_G>."
+ line "Good morning."
+ done
+
+UnknownText_0x1b5dcc:
+ text "Hello, @"
+ text_ram wStringBuffer3
+ text_start
+ line "speaking."
+
+ para "Oh, <PLAY_G>."
+ line "How are you?"
+ done
+
+UnknownText_0x1b5df8:
+ text "Hello, @"
+ text_ram wStringBuffer3
+ text_start
+ line "speaking."
+
+ para "Oh, <PLAY_G>."
+ line "Good evening."
+ done
+
+UnknownText_0x1b5e25:
+ text "Good morning,"
+ line "<PLAY_G>."
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text "."
+ line "Were you sleeping?"
+ done
+
+UnknownText_0x1b5e59:
+ text "Hi, <PLAY_G>."
+ line "This is @"
+ text_ram wStringBuffer3
+ text "."
+
+ para "How are things"
+ line "going for you?"
+ done
+
+UnknownText_0x1b5e8e:
+ text "Good evening,"
+ line "<PLAY_G>."
+
+ para "This is @"
+ text_ram wStringBuffer3
+ text "."
+ line "Are you awake?"
+ done
+
+UnknownText_0x1b5ebe:
+ text "I had some time,"
+ line "so I called you."
+
+ para "So anyway, how are"
+ line "your #MON?"
+
+ para "Me, I take my"
+ line "@"
+ text_ram wStringBuffer4
+ text " to the"
+
+ para "#MON CENTER in"
+ line "VIOLET every day,"
+
+ para "so it's doing just"
+ line "fantastic!"
+
+ para "I'm friends with"
+ line "the receptionist!"
+ done
diff --git a/data/phone/text/liz_caller.asm b/data/phone/text/liz_caller.asm
new file mode 100644
index 000000000..f0c7a7025
--- /dev/null
+++ b/data/phone/text/liz_caller.asm
@@ -0,0 +1,308 @@
+UnknownText_0x175fda:
+ text "Oh, you have to"
+ line "hear this."
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "so adorable!"
+
+ para "It always wants to"
+ line "nuzzle me!"
+ done
+
+UnknownText_0x17602d:
+ text "And, and! Um…"
+
+ para "We beat a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text " with"
+
+ para "just one hit a"
+ line "little while ago."
+
+ para "We felt sorry for"
+ line "it, though."
+ done
+
+UnknownText_0x176095:
+ text "And, and! Uh…"
+
+ para "We just saw a"
+ line "really gorgeous"
+ cont "@"
+ text_ram wStringBuffer4
+ text "."
+
+ para "But I was on the"
+ line "phone, so it got"
+
+ para "away. It made us"
+ line "really angry!"
+ done
+
+UnknownText_0x17610a:
+ text "Hi! Do you have"
+ line "some free time?"
+
+ para "I've got all sorts"
+ line "of time. If you're"
+
+ para "free, would you"
+ line "like to battle?"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Let me know when"
+ line "you get here!"
+ done
+
+LizHiTaniaText:
+ text "Hi, TANIA. How are"
+ line "you? This is LIZ."
+
+ para "I'm fine, but I'm"
+ line "bored silly!"
+
+ para "Huh… Wrong number?"
+ line "Oops! Sorry!"
+ done
+
+UnknownText_0x17620a:
+ text "OK, I'll call you"
+ line "later!"
+ done
+
+UnknownText_0x176223:
+ text "Listen, listen!"
+
+ para "I was listening to"
+ line "the radio in the"
+
+ para "RUINS OF ALPH when"
+ line "an odd broadcast"
+
+ para "suddenly cut it on"
+ line "the regular show."
+
+ para "I wonder what it"
+ line "was. So strange!"
+ done
+
+UnknownText_0x1762c3:
+ text "Listen, listen!"
+
+ para "Don't you think"
+ line "FALKNER of VIOLET"
+
+ para "GYM is cool and"
+ line "handsome?"
+
+ para "But they say his"
+ line "dad, who's out"
+
+ para "training on the"
+ line "road, is even more"
+
+ para "cool and handsome"
+ line "than FALKNER."
+
+ para "I wish I could"
+ line "meet him!"
+ done
+
+UnknownText_0x17638a:
+ text "Listen, listen!"
+
+ para "Do you know EARL,"
+ line "the teacher who"
+
+ para "runs the #MON"
+ line "ACADEMY in VIOLET?"
+
+ para "I saw him doing"
+ line "pirouettes while"
+
+ para "he was running. It"
+ line "was wildly funny!"
+ done
+
+UnknownText_0x176424:
+ text "Listen, listen!"
+
+ para "I collect #MON"
+ line "plush dolls."
+
+ para "But I can't seem"
+ line "to get a hold of a"
+
+ para "SURF PIKACHU DOLL."
+ line "None of my friends"
+
+ para "have it. It must"
+ line "be totally rare!"
+
+ para "You could really"
+ line "brag about it if"
+ cont "you had one."
+ done
+
+UnknownText_0x1764eb:
+ text "Listen, listen!"
+
+ para "Do you know about"
+ line "MOOMOO MILK?"
+
+ para "You can buy it at"
+ line "MOOMOO FARM."
+
+ para "It's supposed to"
+ line "be good for health"
+
+ para "and beauty."
+ line "I really want to"
+
+ para "try some. I bet"
+ line "it's delicious!"
+ done
+
+UnknownText_0x176599:
+ text "Listen, listen!"
+
+ para "There's a #MON"
+ line "SALON in GOLDENROD"
+
+ para "that's run by two"
+ line "brothers."
+
+ para "The older brother"
+ line "is good, but the"
+
+ para "younger one really"
+ line "isn't."
+
+ para "But sometimes the"
+ line "younger one does a"
+
+ para "better job than"
+ line "his brother."
+
+ para "Every time I go, I"
+ line "have a hard time"
+
+ para "trying to decide"
+ line "whom I should use…"
+ done
+
+UnknownText_0x1766ac:
+ text "Listen, listen!"
+
+ para "GOLDENROD GYM's"
+ line "WHITNEY began"
+
+ para "battling only a"
+ line "little while ago!"
+
+ para "But the #MON"
+ line "LEAGUE chose her"
+ cont "as a GYM LEADER!"
+
+ para "I bet she must be"
+ line "totally talented."
+ done
+
+UnknownText_0x17674f:
+ text "Listen, listen!"
+
+ para "Have you ever"
+ line "taken part in a"
+
+ para "Bug-Catching"
+ line "Contest at the"
+ cont "NATIONAL PARK?"
+
+ para "I did once, but"
+ line "all I could catch"
+ cont "was a CATERPIE."
+
+ para "But guess what!"
+
+ para "I won with that"
+ line "CATERPIE. Isn't"
+ cont "that great?"
+ done
+
+UnknownText_0x176816:
+ text "Listen, listen!"
+
+ para "I saw a beautiful"
+ line "@"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "I wish I could"
+ line "become a beautiful"
+ cont "@"
+ text_ram wStringBuffer4
+ text " too."
+ done
+
+UnknownText_0x17686d:
+ text "Listen, listen!"
+
+ para "Uh… Um… Whoops!"
+
+ para "I forgot what I"
+ line "was going to say!"
+ done
+
+UnknownText_0x1768b0:
+ text "Listen, listen!"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text "…"
+ line "it… so pretty…"
+
+ para "and… giggle… so"
+ line "awesome… yes… but…"
+
+ para "very much… eeek!"
+ line "And… lovely…"
+
+ para "Just ravishing…"
+ line "Oh, too much!"
+
+ para "…Hug it… sleeping…"
+ line "That's right…"
+
+ para "pretty… sigh… So"
+ line "nice… Cute…"
+
+ para "…Oops! Look at the"
+ line "time! I chatted"
+ cont "too long!"
+
+ para "I'm sorry I took"
+ line "so much of your"
+
+ para "time!"
+ line "I love chatting!"
+ done
+
+UnknownText_0x1769da:
+ text "I've got too much"
+ line "time on my hands!"
+
+ para "Let's battle right"
+ line "away!"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/parry_callee.asm b/data/phone/text/parry_callee.asm
new file mode 100644
index 000000000..247566b54
--- /dev/null
+++ b/data/phone/text/parry_callee.asm
@@ -0,0 +1,72 @@
+UnknownText_0x1b73c7:
+ text "Yup, yup!"
+ line "It's @"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Hah, and here's"
+ line "<PLAY_G>!"
+ done
+
+UnknownText_0x1b73ef:
+ text "Yup, yup!"
+ line "It's @"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Hah, and here's"
+ line "<PLAY_G>!"
+ done
+
+UnknownText_0x1b7417:
+ text "Yup, yup!"
+ line "It's @"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Hah, and here's"
+ line "<PLAY_G>!"
+ done
+
+UnknownText_0x1b743f:
+ text "<PLAY_G>, it's"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Have you had a"
+ line "proper breakfast?"
+ done
+
+UnknownText_0x1b746f:
+ text "<PLAY_G>, it's"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Have you had a"
+ line "proper lunch?"
+ done
+
+UnknownText_0x1b749b:
+ text "<PLAY_G>, it's"
+ line "@"
+ text_ram wStringBuffer3
+ text "!"
+
+ para "Have you had a"
+ line "proper dinner?"
+ done
+
+UnknownText_0x1b74c8:
+ text "Are your #MON"
+ line "looking good?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " and"
+ line "me--we're looking"
+
+ para "mighty dandy!"
+ line "Hahahah!"
+ done
diff --git a/data/phone/text/parry_caller.asm b/data/phone/text/parry_caller.asm
new file mode 100644
index 000000000..ca20b1c2c
--- /dev/null
+++ b/data/phone/text/parry_caller.asm
@@ -0,0 +1,69 @@
+ParryNoMatchText:
+ text "Nothing can match"
+ line "my @"
+ text_ram wStringBuffer4
+ text " now."
+ done
+
+UnknownText_0x66fc0:
+ text "Yeah, we KO'd a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "That was OK, but I"
+ line "wanted to get it…"
+ done
+
+UnknownText_0x67001:
+ text "And yesterday, we"
+ line "spotted a wild"
+
+ para "@"
+ text_ram wStringBuffer4
+ text "."
+ line "We were debating"
+
+ para "whether to catch"
+ line "it or beat it."
+
+ para "When along came"
+ line "another guy who"
+
+ para "caught it!"
+ line "How about that!"
+ done
+
+UnknownText_0x67096:
+ text "You're thinking"
+ line "you'd like to"
+
+ para "battle me. Am I"
+ line "right or what?"
+
+ para "Yep! We'll meet on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x670eb:
+ text "OK, give me a call"
+ line "again!"
+ done
+
+ParryBattleWithMeText:
+ text "You'll battle with"
+ line "me again, right?"
+ done
+
+ParryHaventYouGottenToText:
+ text "Haven't you gotten"
+ line "to @"
+ text_ram wStringBuffer5
+ text "?"
+
+ para "Waiting here isn't"
+ line "bad, but I'd sure"
+ cont "like to battle!"
+ done
diff --git a/data/phone/text/ralph_callee.asm b/data/phone/text/ralph_callee.asm
new file mode 100644
index 000000000..cbb647cd7
--- /dev/null
+++ b/data/phone/text/ralph_callee.asm
@@ -0,0 +1,59 @@
+UnknownText_0x1b5c10:
+ text "Yes? Ah, <PLAY_G>."
+
+ para "You're courteous"
+ line "enough to state"
+
+ para "your name when you"
+ line "call on the phone."
+ done
+
+UnknownText_0x1b5c63:
+ text "Yes? Ah, <PLAY_G>."
+
+ para "You're courteous"
+ line "enough to state"
+
+ para "your name when you"
+ line "call on the phone."
+ done
+
+UnknownText_0x1b5cb6:
+ text "Yes? Ah, <PLAY_G>."
+
+ para "You're courteous"
+ line "enough to state"
+
+ para "your name when you"
+ line "call on the phone."
+ done
+
+UnknownText_0x1b5d09:
+ text "Hiya, it's Uncle"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b5d21:
+ text "Hiya, it's Uncle"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b5d39:
+ text "Hiya, it's Uncle"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b5d51:
+ text "Are you taking"
+ line "good care of your"
+
+ para "#MON? You have"
+ line "to be good to your"
+ cont "partners!"
+ done
diff --git a/data/phone/text/ralph_caller.asm b/data/phone/text/ralph_caller.asm
new file mode 100644
index 000000000..f890be10f
--- /dev/null
+++ b/data/phone/text/ralph_caller.asm
@@ -0,0 +1,133 @@
+RalphNeglectingKidsText:
+ text "I've been spending"
+ line "more time with my"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " than I"
+ line "have with my kids."
+
+ para "That's a bit sad,"
+ line "actually."
+ done
+
+UnknownText_0x175c24:
+ text "I just beat a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text "."
+
+ para "I told my kid, but"
+ line "he scoffed that he"
+
+ para "could do the same"
+ line "thing easily."
+
+ para "Boy, has he gotten"
+ line "cocky…"
+ done
+
+UnknownText_0x175c9f:
+ text "Yesterday a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text " slipped"
+
+ para "away from me, in"
+ line "front of my kid."
+
+ para "I was feeling down"
+ line "about it until he"
+
+ para "shared his #"
+ line "BALLS with me."
+
+ para "Hahah, that sure"
+ line "made my day!"
+ done
+
+UnknownText_0x175d40:
+ text "What do you say to"
+ line "a battle with me?"
+
+ para "Good, you're going"
+ line "to do it!"
+
+ para "For a kid, you're"
+ line "quite agreeable."
+
+ para "@"
+ text_ram wStringBuffer5
+ text " is"
+ line "the spot!"
+ done
+
+UnknownText_0x175db7:
+ text "You call your mom"
+ line "sometimes too!"
+ done
+
+UnknownText_0x175dd9:
+ text "Listen, I… Yowch!"
+
+ para "Uh, sorry! See,"
+ line "@"
+ text_ram wStringBuffer4
+ text " are"
+
+ para "biting like there"
+ line "is no tomorrow"
+
+ para "over here on"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+
+ para "Aiyee! Ouch!"
+ line "One jabbed me!"
+
+ para "Heh, they're some"
+ line "kind of feisty!"
+
+ para "<PLAY_G>, you have"
+ line "to see this rare"
+
+ para "sight! Get ready"
+ line "to fish!"
+ done
+
+UnknownText_0x175eaf:
+ text "Yeah, I know."
+
+ para "You're looking for"
+ line "rare #MON."
+
+ para "Recently, all I've"
+ line "been catching are"
+ cont "MAGIKARP, though…"
+ done
+
+UnknownText_0x175f11:
+ text "So where are you?"
+ line "I'm waiting for"
+
+ para "you to show up on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "You shouldn't make"
+ line "your elders wait!"
+ done
+
+UnknownText_0x175f70:
+ text "Hey, what's the"
+ line "matter with you?"
+
+ para "Aren't you coming"
+ line "over to fish for"
+ cont "QWILFISH?"
+
+ para "I'm on ROUTE 32,"
+ line "so hurry up!"
+ done
diff --git a/data/phone/text/reena_callee.asm b/data/phone/text/reena_callee.asm
new file mode 100644
index 000000000..980ced9da
--- /dev/null
+++ b/data/phone/text/reena_callee.asm
@@ -0,0 +1,72 @@
+UnknownText_0x1b5702:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh. Hi, <PLAYER>."
+ line "What's up?"
+ done
+
+UnknownText_0x1b572e:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, hi, <PLAYER>,"
+ line "what's up?"
+ done
+
+UnknownText_0x1b575a:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, hi, <PLAYER>,"
+ line "what's up?"
+ done
+
+UnknownText_0x1b5786:
+ text "You're slow! Hurry"
+ line "up and answer!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b57b7:
+ text "You're slow! Hurry"
+ line "up and answer!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b57e8:
+ text "You're slow! Hurry"
+ line "up and answer!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "!"
+ done
+
+UnknownText_0x1b5819:
+ text "Hey, how are your"
+ line "#MON doing?"
+
+ para "What? Great?"
+ line "I see…"
+
+ para "What? My #MON?"
+
+ para "Of course they're"
+ line "doing great! What"
+
+ para "kind of a question"
+ line "is that?"
+ done
diff --git a/data/phone/text/reena_caller.asm b/data/phone/text/reena_caller.asm
new file mode 100644
index 000000000..815e2f596
--- /dev/null
+++ b/data/phone/text/reena_caller.asm
@@ -0,0 +1,88 @@
+UnknownText_0x1752f5:
+ text "Listen, dear…"
+
+ para "Do you recall my"
+ line "@"
+ text_ram wStringBuffer4
+ text "?"
+
+ para "Yes, exactly. That"
+ line "lovely @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "Wouldn't you agree"
+ line "it's a perfect"
+ cont "match for me?"
+ done
+
+UnknownText_0x17536b:
+ text "Have I ever faced"
+ line "a wild @"
+ text_ram wStringBuffer4
+ text "?"
+
+ para "You need to ask?"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " I've"
+ line "beaten on numerous"
+ cont "occasions!"
+ done
+
+UnknownText_0x1753c5:
+ text "Have I ever failed"
+ line "to catch a wild"
+ cont "#MON?"
+
+ para "You need to ask?"
+
+ para "I would never fail"
+ line "to catch a wild"
+
+ para "@"
+ text_ram wStringBuffer4
+ text "…"
+ line "Oh! Never mind!"
+ done
+
+UnknownText_0x17543a:
+ text "We are going to"
+ line "battle!"
+
+ para "The place shall be"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+
+ para "Don't make me"
+ line "wait! Got it?"
+ done
+
+UnknownText_0x175488:
+ text "Fine, you may go."
+ done
+
+UnknownText_0x17549b:
+ text "Don't be too proud"
+ line "just because you"
+
+ para "happened to beat"
+ line "me… "
+
+ para "It was a fluke!"
+ done
+
+UnknownText_0x1754e5:
+ text "What are you"
+ line "doing?"
+
+ para "I told you that"
+ line "the place was"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "!"
+ line "Don't try to run!"
+ done
diff --git a/data/phone/text/tiffany_callee.asm b/data/phone/text/tiffany_callee.asm
new file mode 100644
index 000000000..1bac8dc73
--- /dev/null
+++ b/data/phone/text/tiffany_callee.asm
@@ -0,0 +1,78 @@
+UnknownText_0x1b6e7c:
+ text "Yes? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh, <PLAY_G>."
+ line "Good morning."
+ done
+
+UnknownText_0x1b6ea6:
+ text "Yes? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh, <PLAY_G>."
+ line "Hello."
+ done
+
+UnknownText_0x1b6ec9:
+ text "Yes? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "Oh, <PLAY_G>, good"
+ line "evening."
+ done
+
+UnknownText_0x1b6ef3:
+ text "Is this <PLAY_G>?"
+
+ para "Good morning. This"
+ line "is @"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b6f1c:
+ text "Is this <PLAY_G>?"
+
+ para "Hi, it's @"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b6f37:
+ text "Is this <PLAY_G>?"
+
+ para "Good evening. This"
+ line "is @"
+ text_ram wStringBuffer3
+ text "."
+ done
+
+UnknownText_0x1b6f60:
+ text "Are your #MON"
+ line "doing well?"
+
+ para "I hope you take"
+ line "them to a #MON"
+ cont "CENTER every day."
+
+ para "Don't push them"
+ line "too hard."
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "cute and lively"
+
+ para "precisely because"
+ line "I take it to a"
+
+ para "#MON CENTER"
+ line "every day."
+ done
diff --git a/data/phone/text/tiffany_caller.asm b/data/phone/text/tiffany_caller.asm
new file mode 100644
index 000000000..220d4ef3c
--- /dev/null
+++ b/data/phone/text/tiffany_caller.asm
@@ -0,0 +1,137 @@
+UnknownText_0x665ad:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "adorable, don't"
+
+ para "you think so?"
+ line "I always sleep"
+
+ para "with it--it's so"
+ line "fluffy and warm!"
+ done
+
+UnknownText_0x66605:
+ text "Oh, and we had to"
+ line "battle a wild"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " a while"
+ line "ago…"
+
+ para "My CLEFAIRY came"
+ line "close to fainting!"
+
+ para "Isn't that awful?"
+
+ para "I hate those nasty"
+ line "@"
+ text_ram wStringBuffer4
+ text "!"
+ done
+
+UnknownText_0x66688:
+ text "Oh, and we had to"
+ line "battle a wild"
+
+ para "@"
+ text_ram wStringBuffer4
+ text " a while"
+ line "ago…"
+
+ para "My CLEFAIRY got"
+ line "frightened, so we"
+
+ para "ran away as fast"
+ line "as we could!"
+
+ para "I just can't help"
+ line "feeling protective"
+ cont "of my CLEFAIRY."
+ done
+
+UnknownText_0x66730:
+ text "I know this might"
+ line "surprise you, but"
+
+ para "would you like to"
+ line "battle?"
+
+ para "I'll be waiting"
+ line "with CLEFAIRY on"
+ cont "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+TiffanyItsAwfulText:
+ text_ram wStringBuffer4
+ text "!"
+
+ para "It's awful."
+ line "My CLEFAIRY…"
+
+ para "Huh? <PLAY_G>?"
+
+ para "Oh, sorry! I was"
+ line "in a hurry, and I…"
+
+ para "I have to go!"
+ line "Bye-bye!"
+ done
+
+UnknownText_0x667f7:
+ text "Bye-bye!"
+ done
+
+UnknownText_0x66801:
+ text "I bought some PINK"
+ line "BOWS at GOLDENROD"
+
+ para "DEPT.STORE for my"
+ line "CLEFAIRY."
+
+ para "I got too many, so"
+ line "I'll give you one!"
+
+ para "Come collect it on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x66882:
+ text "I love dressing up"
+ line "my CLEFAIRY!"
+ done
+
+UnknownText_0x668a3:
+ text "What's wrong?"
+ line "Can't you visit?"
+
+ para "CLEFAIRY got tired"
+ line "and fell asleep."
+
+ para "I'm not sure if I"
+ line "can wake it up…"
+
+ para "Please hurry to"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
+
+UnknownText_0x6691d:
+ text "What's wrong?"
+ line "Can't you visit?"
+
+ para "I'm sure this will"
+ line "look good on your"
+ cont "CLEFAIRY."
+
+ para "Please hurry to"
+ line "@"
+ text_ram wStringBuffer5
+ text "!"
+ done
diff --git a/data/phone/text/todd_callee.asm b/data/phone/text/todd_callee.asm
new file mode 100644
index 000000000..f795d29c2
--- /dev/null
+++ b/data/phone/text/todd_callee.asm
@@ -0,0 +1,70 @@
+UnknownText_0x1b60f5:
+ text "Yes? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking."
+
+ para "Hey, <PLAY_G>!"
+ done
+
+UnknownText_0x1b611b:
+ text "Yes? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking."
+
+ para "This must be"
+ line "<PLAY_G>."
+ done
+
+UnknownText_0x1b6149:
+ text "Yes? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking."
+
+ para "Ah, <PLAY_G>!"
+ done
+
+UnknownText_0x1b616e:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "<PLAY_G>, right?"
+ done
+
+UnknownText_0x1b618f:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "<PLAY_G>, what are"
+ line "you doing?"
+ done
+
+UnknownText_0x1b61bd:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "."
+
+ para "<PLAY_G>, sorry to"
+ line "call you so late."
+ done
+
+UnknownText_0x1b61f2:
+ text "How do you raise"
+ line "your #MON?"
+
+ para "I do all sorts"
+ line "of things, like"
+
+ para "leaving them in"
+ line "DAY-CARE and"
+
+ para "toughening them up"
+ line "with items."
+ done
diff --git a/data/phone/text/todd_caller.asm b/data/phone/text/todd_caller.asm
new file mode 100644
index 000000000..3b647d1b5
--- /dev/null
+++ b/data/phone/text/todd_caller.asm
@@ -0,0 +1,117 @@
+ToddLooksCuteLikeMeText:
+ text "My @"
+ text_ram wStringBuffer4
+ text " is"
+ line "looking more and"
+
+ para "more like me. It's"
+ line "getting cuter!"
+ done
+
+UnknownText_0x176e9c:
+ text "And, you know?"
+
+ para "Now we can KO"
+ line "@"
+ text_ram wStringBuffer4
+ text " easily."
+
+ para "I should challenge"
+ line "the GOLDENROD GYM."
+ done
+
+UnknownText_0x176eee:
+ text "And, you know?"
+ line "We just failed to"
+
+ para "beat @"
+ text_ram wStringBuffer4
+ text " by"
+ line "a tiny margin."
+
+ para "I'm guessing my"
+ line "#MON's levels"
+
+ para "aren't high enough"
+ line "yet…"
+ done
+
+UnknownText_0x176f60:
+ text "You must be a lot"
+ line "better now, huh?"
+
+ para "How about showing"
+ line "me your technique"
+
+ para "in a real battle"
+ line "with me?"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x176fdb:
+ text "See you later!"
+ done
+
+UnknownText_0x176feb:
+ text "This is it--the"
+ line "one we've all been"
+ cont "waiting for!"
+
+ para "GOLDENROD DEPT."
+ line "STORE's bargain"
+ cont "sale is on now!"
+
+ para "Want it cheap?"
+ line "Want it lots?"
+
+ para "Don't miss this"
+ line "GOLDENROD chance!"
+
+ para "Huh? I sound like"
+ line "a huckster?"
+
+ para "Well, yeah. I was"
+ line "mimicking them…"
+
+ para "Anyway, you've got"
+ line "to get there as"
+ cont "soon as you can!"
+ done
+
+UnknownText_0x1770fb:
+ text "I'm saving up for"
+ line "the next bargain"
+
+ para "sale. When's the"
+ line "next one?"
+ done
+
+UnknownText_0x177138:
+ text "Where are you?"
+
+ para "Let's have our"
+ line "battle soon!"
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x17717c:
+ text "Haven't you gone"
+ line "to GOLDENROD DEPT."
+
+ para "STORE? I've scoped"
+ line "it out already!"
+
+ para "They had some real"
+ line "bargains."
+
+ para "You should get"
+ line "there quickly."
+ done
diff --git a/data/phone/text/trainers.asm b/data/phone/text/trainers.asm
deleted file mode 100644
index 5e99f60a0..000000000
--- a/data/phone/text/trainers.asm
+++ /dev/null
@@ -1,1991 +0,0 @@
-UnknownText_0x1b4dc5:
- text "Hello. This is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Good morning,"
- line "<PLAY_G>!"
- done
-
-UnknownText_0x1b4ded:
- text "Hello. This is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "How's it going,"
- line "<PLAY_G>?"
- done
-
-UnknownText_0x1b4e16:
- text "Hello. This is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Good evening,"
- line "<PLAY_G>!"
- done
-
-UnknownText_0x1b4e3e:
- text "<PLAY_G>, good"
- line "morning!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "How are you doing?"
- done
-
-UnknownText_0x1b4e72:
- text "<PLAY_G>, howdy!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "Isn't it nice out?"
- done
-
-UnknownText_0x1b4e9e:
- text "<PLAY_G>, good"
- line "evening!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "Got a minute?"
- done
-
-UnknownText_0x1b4ecd:
- text "How are your"
- line "#MON doing?"
-
- para "My @"
- text_ram wStringBuffer4
- text " is"
- line "so curious, it's a"
-
- para "problem. Maybe"
- line "it's like me…"
- done
-
-UnknownText_0x1b4f21:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh! Good morning,"
- line "<PLAYER>."
- done
-
-UnknownText_0x1b4f4d:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh! Good day,"
- line "<PLAYER>."
- done
-
-UnknownText_0x1b4f75:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh! Good evening,"
- line "<PLAYER>."
- done
-
-UnknownText_0x1b4fa1:
- text "Hello, <PLAYER>."
- line "Good morning."
-
- para "This is @"
- text_ram wStringBuffer3
- text "."
- line "Were you asleep?"
- done
-
-UnknownText_0x1b4fda:
- text "Hi, <PLAYER>."
- line "This is @"
- text_ram wStringBuffer3
- text "."
-
- para "How are you doing?"
- done
-
-UnknownText_0x1b5004:
- text "Hi, <PLAYER>."
- line "This is @"
- text_ram wStringBuffer3
- text "."
-
- para "Were you awake?"
- done
-
-UnknownText_0x1b502b:
- text "Keeping your"
- line "#MON happy?"
-
- para "My @"
- text_ram wStringBuffer4
- text " is"
- line "healthy. It eats a"
- cont "lot every day."
- done
-
-UnknownText_0x1b5073:
- text "Yeah, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Huh? What's up,"
- line "<PLAYER>?"
- done
-
-UnknownText_0x1b509b:
- text "Yeah, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Huh? What's up"
- line "<PLAYER>?"
- done
-
-UnknownText_0x1b50c2:
- text "Yeah, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Huh? What's up"
- line "<PLAYER>?"
- done
-
-UnknownText_0x1b50e9:
- text "Yo, <PLAYER>!"
- line "You awake?"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "!"
- line "How's it going?"
- done
-
-UnknownText_0x1b511a:
- text "Yo, <PLAYER>! You"
- line "free right now?"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "!"
- line "How's it going?"
- done
-
-UnknownText_0x1b5154:
- text "Yo, <PLAYER>!"
- line "Were you asleep?"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "!"
- line "How's it going?"
- done
-
-UnknownText_0x1b518b:
- text "How are your"
- line "#MON doing?"
-
- para "My #MON are a"
- line "bit too energetic."
-
- para "@"
- text_ram wStringBuffer4
- text ","
- line "especially."
-
- para "Every time it"
- line "spots a trainer,"
- cont "it has to battle."
-
- para "It gets to be a"
- line "bit much for me!"
- done
-
-UnknownText_0x1b522b:
- text "My @"
- text_ram wStringBuffer4
- text "'s"
- line "looking tougher"
- cont "than ever."
-
- para "It looks even"
- line "tougher than me!"
- done
-
-UnknownText_0x1b5270:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text " speaking…"
-
- para "Hi, <PLAY_G>!"
- line "Good morning!"
- done
-
-UnknownText_0x1b52a5:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text " speaking…"
-
- para "Hi, <PLAY_G>!"
- done
-
-UnknownText_0x1b52cc:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text " speaking…"
-
- para "Hi, <PLAY_G>!"
- line "Good evening!"
- done
-
-UnknownText_0x1b5301:
- text "<PLAY_G>, good"
- line "morning!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "How are you doing?"
- done
-
-UnknownText_0x1b5335:
- text "Hi, <PLAY_G>!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "How are you doing?"
- done
-
-UnknownText_0x1b535f:
- text "<PLAY_G>, good"
- line "evening!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "How are you doing?"
- done
-
-UnknownText_0x1b5393:
- text "How are your"
- line "#MON doing?"
-
- para "My @"
- text_ram wStringBuffer4
- text "'s"
- line "doing as great as"
- cont "ever."
-
- para "Let's keep at it"
- line "and become #MON"
- cont "CHAMPS!"
- done
-
-UnknownText_0x1b53f7:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh, <PLAY_G>."
- line "Good morning."
-
- para ""
- done
-
-UnknownText_0x1b5424:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh. Hi, <PLAY_G>."
- done
-
-UnknownText_0x1b5446:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh, <PLAY_G>."
- line "Good evening."
- done
-
-UnknownText_0x1b5472:
- text "Good morning,"
- line "<PLAY_G>!"
-
- para "This is @"
- text_ram wStringBuffer3
- text "."
- line "Were you sleeping?"
- done
-
-UnknownText_0x1b54a6:
- text "<PLAY_G>, hi!"
- line "This is @"
- text_ram wStringBuffer3
- text "."
-
- para "Do you have some"
- line "time?"
- done
-
-UnknownText_0x1b54d4:
- text "Hi, <PLAY_G>."
- line "Good evening."
-
- para "This is @"
- text_ram wStringBuffer3
- text "."
-
- para "I hope you were"
- line "awake."
- done
-
-UnknownText_0x1b5510:
- text "Are you the kind"
- line "of person who goes"
-
- para "to #MON CENTERS"
- line "often?"
-
- para "I go every day."
- line "Watching out for"
-
- para "the health of your"
- line "#MON is a basic"
-
- para "part of being a"
- line "#MON trainer."
- done
-
-UnknownText_0x1b55ae:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, <PLAY_G>?"
- line "Good morning!"
- done
-
-UnknownText_0x1b55da:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, <PLAY_G>? Hi!"
- done
-
-UnknownText_0x1b55fc:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, <PLAY_G>?"
- line "Good evening!"
- done
-
-UnknownText_0x1b5628:
- text "Oh, <PLAY_G>?"
-
- para "Tweet! Yeah, it's"
- line "me, @"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b564c:
- text "Oh, <PLAY_G>?"
-
- para "Tweet! Yeah, it's"
- line "me, @"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b5670:
- text "Oh, <PLAY_G>?"
-
- para "Tweet! Yeah, it's"
- line "me, @"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b5694:
- text "Are your #MON"
- line "still cooking?"
-
- para "My @"
- text_ram wStringBuffer4
- text " has"
- line "too much energy."
-
- para "Once it takes off,"
- line "it won't come back"
- cont "for a while."
- done
-
-UnknownText_0x1b5702:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh. Hi, <PLAYER>."
- line "What's up?"
- done
-
-UnknownText_0x1b572e:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, hi, <PLAYER>,"
- line "what's up?"
- done
-
-UnknownText_0x1b575a:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, hi, <PLAYER>,"
- line "what's up?"
- done
-
-UnknownText_0x1b5786:
- text "You're slow! Hurry"
- line "up and answer!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b57b7:
- text "You're slow! Hurry"
- line "up and answer!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b57e8:
- text "You're slow! Hurry"
- line "up and answer!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b5819:
- text "Hey, how are your"
- line "#MON doing?"
-
- para "What? Great?"
- line "I see…"
-
- para "What? My #MON?"
-
- para "Of course they're"
- line "doing great! What"
-
- para "kind of a question"
- line "is that?"
- done
-
-UnknownText_0x1b589a:
- text "Hi, @"
- text_ram wStringBuffer3
- text " here!"
-
- para "Oh, <PLAYER>? You"
- line "doing well?"
- done
-
-UnknownText_0x1b58c2:
- text "Hi, @"
- text_ram wStringBuffer3
- text " here!"
-
- para "Oh, <PLAYER>? You"
- line "doing well?"
- done
-
-UnknownText_0x1b58ea:
- text "Hi, @"
- text_ram wStringBuffer3
- text " here!"
-
- para "Oh, <PLAYER>? You"
- line "doing well?"
- done
-
-UnknownText_0x1b5912:
- text "Yo, <PLAYER>!"
- line "How're you doing?"
-
- para "This is @"
- text_ram wStringBuffer3
- text ","
- line "got a minute?"
- done
-
-UnknownText_0x1b5948:
- text "Yo, <PLAYER>! How's"
- line "it going?"
-
- para "This is @"
- text_ram wStringBuffer3
- text "."
- line "Got a minute?"
- done
-
-UnknownText_0x1b597c:
- text "Yo, <PLAYER>!"
- line "How're you doing?"
-
- para "This is @"
- text_ram wStringBuffer3
- text ","
- line "got a minute?"
- done
-
-UnknownText_0x1b59b2:
- text "How are your"
- line "#MON doing?"
-
- para "My @"
- text_ram wStringBuffer4
- text "'s"
- line "raring to go, just"
- cont "like always."
-
- para "It's the only one"
- line "I have. I'm going"
-
- para "to become a great"
- line "trainer with it!"
- done
-
-UnknownText_0x1b5a3b:
- text "Hello? This is"
- line "@"
- text_ram wStringBuffer3
- text " speaking."
-
- para "Oh. Hi, <PLAY_G>!"
- line "Good morning!"
- done
-
-UnknownText_0x1b5a74:
- text "Hello? This is"
- line "@"
- text_ram wStringBuffer3
- text " speaking."
-
- para "Oh, hi, <PLAY_G>!"
- done
-
-UnknownText_0x1b5a9f:
- text "Hello? This is"
- line "@"
- text_ram wStringBuffer3
- text " speaking."
-
- para "Oh, hi, <PLAY_G>!"
- line "Good evening!"
- done
-
-UnknownText_0x1b5ad8:
- text "<PLAY_G>, good"
- line "morning!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "Isn't it nice out?"
- done
-
-UnknownText_0x1b5b0b:
- text "<PLAY_G>, howdy!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "Isn't it nice out?"
- done
-
-UnknownText_0x1b5b37:
- text "Good evening,"
- line "<PLAY_G>!"
-
- para "It's me, @"
- text_ram wStringBuffer3
- text "."
- line "Were you awake?"
- done
-
-UnknownText_0x1b5b68:
- text "How are your"
- line "#MON doing?"
-
- para "My #MON have"
- line "too much energy to"
-
- para "burn. It gets to"
- line "be a problem."
-
- para "Of all my #MON,"
- line "@"
- text_ram wStringBuffer4
- text " is the"
- cont "hardest to handle."
-
- para "Working with it is"
- line "exhausting."
- done
-
-UnknownText_0x1b5c10:
- text "Yes? Ah, <PLAY_G>."
-
- para "You're courteous"
- line "enough to state"
-
- para "your name when you"
- line "call on the phone."
- done
-
-UnknownText_0x1b5c63:
- text "Yes? Ah, <PLAY_G>."
-
- para "You're courteous"
- line "enough to state"
-
- para "your name when you"
- line "call on the phone."
- done
-
-UnknownText_0x1b5cb6:
- text "Yes? Ah, <PLAY_G>."
-
- para "You're courteous"
- line "enough to state"
-
- para "your name when you"
- line "call on the phone."
- done
-
-UnknownText_0x1b5d09:
- text "Hiya, it's Uncle"
- line "@"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b5d21:
- text "Hiya, it's Uncle"
- line "@"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b5d39:
- text "Hiya, it's Uncle"
- line "@"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b5d51:
- text "Are you taking"
- line "good care of your"
-
- para "#MON? You have"
- line "to be good to your"
- cont "partners!"
- done
-
-UnknownText_0x1b5d9f:
- text "Hello, @"
- text_ram wStringBuffer3
- text_start
- line "speaking."
-
- para "Oh, <PLAY_G>."
- line "Good morning."
- done
-
-UnknownText_0x1b5dcc:
- text "Hello, @"
- text_ram wStringBuffer3
- text_start
- line "speaking."
-
- para "Oh, <PLAY_G>."
- line "How are you?"
- done
-
-UnknownText_0x1b5df8:
- text "Hello, @"
- text_ram wStringBuffer3
- text_start
- line "speaking."
-
- para "Oh, <PLAY_G>."
- line "Good evening."
- done
-
-UnknownText_0x1b5e25:
- text "Good morning,"
- line "<PLAY_G>."
-
- para "This is @"
- text_ram wStringBuffer3
- text "."
- line "Were you sleeping?"
- done
-
-UnknownText_0x1b5e59:
- text "Hi, <PLAY_G>."
- line "This is @"
- text_ram wStringBuffer3
- text "."
-
- para "How are things"
- line "going for you?"
- done
-
-UnknownText_0x1b5e8e:
- text "Good evening,"
- line "<PLAY_G>."
-
- para "This is @"
- text_ram wStringBuffer3
- text "."
- line "Are you awake?"
- done
-
-UnknownText_0x1b5ebe:
- text "I had some time,"
- line "so I called you."
-
- para "So anyway, how are"
- line "your #MON?"
-
- para "Me, I take my"
- line "@"
- text_ram wStringBuffer4
- text " to the"
-
- para "#MON CENTER in"
- line "VIOLET every day,"
-
- para "so it's doing just"
- line "fantastic!"
-
- para "I'm friends with"
- line "the receptionist!"
- done
-
-UnknownText_0x1b5f7a:
- text "Yeah, @"
- text_ram wStringBuffer3
- text " the"
- line "HIKER here."
-
- para "Ah, <PLAYER>!"
- done
-
-UnknownText_0x1b5f9e:
- text "Yeah, @"
- text_ram wStringBuffer3
- text " the"
- line "HIKER here."
-
- para "Ah, <PLAYER>,"
- line "right?"
- done
-
-UnknownText_0x1b5fc9:
- text "Yeah, @"
- text_ram wStringBuffer3
- text " the"
- line "HIKER here."
-
- para "Ah, <PLAYER>, isn't"
- line "it?"
- done
-
-UnknownText_0x1b5ff6:
- text "Yo, <PLAYER>?"
-
- para "This is @"
- text_ram wStringBuffer3
- text_start
- line "the HIKER!"
- done
-
-UnknownText_0x1b6017:
- text "Hey, is this"
- line "<PLAYER>?"
-
- para "This is @"
- text_ram wStringBuffer3
- text_start
- line "the HIKER!"
- done
-
-UnknownText_0x1b6041:
- text "<PLAYER>, you still"
- line "awake?"
-
- para "This is @"
- text_ram wStringBuffer3
- text_start
- line "the HIKER!"
- done
-
-UnknownText_0x1b606f:
- text "Are your #MON"
- line "as feisty as ever?"
-
- para "My @"
- text_ram wStringBuffer4
- text " and"
- line "me--we have energy"
-
- para "to burn. We hike"
- line "up mountains every"
-
- para "day to work out"
- line "all our energy."
- done
-
-UnknownText_0x1b60f5:
- text "Yes? This is"
- line "@"
- text_ram wStringBuffer3
- text " speaking."
-
- para "Hey, <PLAY_G>!"
- done
-
-UnknownText_0x1b611b:
- text "Yes? This is"
- line "@"
- text_ram wStringBuffer3
- text " speaking."
-
- para "This must be"
- line "<PLAY_G>."
- done
-
-UnknownText_0x1b6149:
- text "Yes? This is"
- line "@"
- text_ram wStringBuffer3
- text " speaking."
-
- para "Ah, <PLAY_G>!"
- done
-
-UnknownText_0x1b616e:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "<PLAY_G>, right?"
- done
-
-UnknownText_0x1b618f:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "<PLAY_G>, what are"
- line "you doing?"
- done
-
-UnknownText_0x1b61bd:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "<PLAY_G>, sorry to"
- line "call you so late."
- done
-
-UnknownText_0x1b61f2:
- text "How do you raise"
- line "your #MON?"
-
- para "I do all sorts"
- line "of things, like"
-
- para "leaving them in"
- line "DAY-CARE and"
-
- para "toughening them up"
- line "with items."
- done
-
-UnknownText_0x1b626a:
- text "Hello? This is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, <PLAY_G>!"
- line "Good morning!"
- done
-
-UnknownText_0x1b6296:
- text "Hello? This is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, <PLAY_G>!"
- line "Hi, how are you?"
- done
-
-UnknownText_0x1b62c5:
- text "Hello? This is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, <PLAY_G>!"
- line "Good evening!"
- done
-
-UnknownText_0x1b62f1:
- text "<PLAY_G>?"
-
- para "It's @"
- text_ram wStringBuffer3
- text "."
- line "Good morning!"
- done
-
-UnknownText_0x1b630e:
- text "<PLAY_G>?"
-
- para "It's @"
- text_ram wStringBuffer3
- text ". Is"
- line "this a bad time?"
- done
-
-UnknownText_0x1b6331:
- text "<PLAY_G>?"
-
- para "It's @"
- text_ram wStringBuffer3
- text "."
- line "Got time to chat?"
- done
-
-UnknownText_0x1b6352:
- text "Are your #MON"
- line "still tough?"
-
- para "I train every day"
- line "with @"
- text_ram wStringBuffer4
- text "."
- done
-
-UnknownText_0x1b638c:
- text "Hello? @"
- text_ram wStringBuffer3
- text_start
- line "here…"
-
- para "Hey, <PLAY_G>!"
- done
-
-UnknownText_0x1b63a8:
- text "Hello? @"
- text_ram wStringBuffer3
- text_start
- line "here…"
-
- para "Wow, <PLAY_G>!"
- done
-
-UnknownText_0x1b63c4:
- text "Hello? @"
- text_ram wStringBuffer3
- text_start
- line "here…"
-
- para "Yippee, <PLAY_G>!"
- done
-
-UnknownText_0x1b63e3:
- text "Uh, hello."
- line "<PLAY_G>?"
-
- para "It's your pal,"
- line "@"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6407:
- text "Uh, hello,"
- line "<PLAY_G>?"
-
- para "It's your buddy"
- line "@"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b642c:
- text "Uh, hello,"
- line "<PLAY_G>?"
-
- para "It's your sidekick"
- line "@"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6454:
- text "Yeah, hello."
- line "This is @"
- text_ram wStringBuffer3
- text "."
-
- para "…Huh, <PLAY_G>? Yo!"
- done
-
-UnknownText_0x1b647e:
- text "Yeah, hello, you"
- line "got @"
- text_ram wStringBuffer3
- text "."
-
- para "…Huh, <PLAY_G>? Yo!"
- done
-
-UnknownText_0x1b64a8:
- text "Yeah, hello, you"
- line "got @"
- text_ram wStringBuffer3
- text "."
-
- para "…Huh, <PLAY_G>? Yo!"
- done
-
-UnknownText_0x1b64d2:
- text "Yeah, hello?"
- line "@"
- text_ram wStringBuffer3
- text " calling."
-
- para "What are you up"
- line "to, <PLAY_G>?"
- done
-
-UnknownText_0x1b6506:
- text "Yeah, hello?"
- line "@"
- text_ram wStringBuffer3
- text " calling."
-
- para "Where are you now,"
- line "<PLAY_G>?"
- done
-
-UnknownText_0x1b6539:
- text "Yeah, hello?"
- line "@"
- text_ram wStringBuffer3
- text " calling."
-
- para "Are you awake now,"
- line "<PLAY_G>?"
- done
-
-UnknownText_0x1b656c:
- text "I bet your #MON"
- line "are a lot stronger"
- cont "than before."
- done
-
-UnknownText_0x1b659d:
- text "Yup, it's @"
- text_ram wStringBuffer3
- text "!"
-
- para "Is this <PLAY_G>?"
- line "Good morning!"
- done
-
-UnknownText_0x1b65c7:
- text "Yup, it's @"
- text_ram wStringBuffer3
- text "!"
-
- para "Is that <PLAY_G>?"
- done
-
-UnknownText_0x1b65e3:
- text "Yup, it's @"
- text_ram wStringBuffer3
- text "!"
-
- para "Is that <PLAY_G>?"
- line "Good evening!"
- done
-
-UnknownText_0x1b660d:
- text "Hello! It's me,"
- line "@"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6624:
- text "Hello! It's me,"
- line "@"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b663b:
- text "Hello! It's me,"
- line "@"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6652:
- text "<PLAY_G>, are you"
- line "raising your"
- cont "#MON properly?"
-
- para "I read in a book"
- line "that you should"
-
- para "raise any #MON"
- line "you catch with"
- cont "love and care."
- done
-
-UnknownText_0x1b66c8:
- text "Hi, @"
- text_ram wStringBuffer3
- text " on the"
- line "line."
-
- para "Hey! It's <PLAY_G>!"
- done
-
-UnknownText_0x1b66ec:
- text "Hi, @"
- text_ram wStringBuffer3
- text " on the"
- line "line."
-
- para "I know!"
- line "It's <PLAY_G>!"
- done
-
-UnknownText_0x1b6713:
- text "Hi, @"
- text_ram wStringBuffer3
- text " on the"
- line "line."
-
- para "<PLAY_G>?"
- line "What's up?"
- done
-
-UnknownText_0x1b6738:
- text "Uh, <PLAY_G>?"
-
- para "It's me!"
- line "It's me, @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6757:
- text "Uh, <PLAY_G>?"
-
- para "It's me!"
- line "It's me, @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6776:
- text "Uh, <PLAY_G>?"
-
- para "It's me!"
- line "It's me, @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b6795:
- text "My @"
- text_ram wStringBuffer4
- text " is"
- line "so full of energy,"
-
- para "it's a little"
- line "scary."
-
- para "How are your"
- line "#MON doing?"
- done
-
-UnknownText_0x1b67e2:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Hi, <PLAY_G>!"
- line "Good morning!"
- done
-
-UnknownText_0x1b680e:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Hi, <PLAY_G>, good"
- line "day!"
- done
-
-UnknownText_0x1b6836:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Hi, <PLAY_G>, good"
- line "evening!"
- done
-
-UnknownText_0x1b6862:
- text "Hi, <PLAY_G>, good"
- line "morning!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "."
- line "How are you?"
- done
-
-UnknownText_0x1b6890:
- text "Hi, <PLAY_G>, good"
- line "day!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "."
- line "How are you?"
- done
-
-UnknownText_0x1b68ba:
- text "Hi, <PLAY_G>, good"
- line "evening!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "."
- line "How are you?"
- done
-
-UnknownText_0x1b68e8:
- text "How are your"
- line "#MON doing?"
-
- para "You know PROF.OAK,"
- line "so of course your"
- cont "#MON are fine!"
-
- para "My #MON are"
- line "doing well too."
-
- para "But then, I am"
- line "trying to become a"
-
- para "#MON professor,"
- line "so that shouldn't"
- cont "be a big surprise."
- done
-
-UnknownText_0x1b69a8:
- text "Hi, <PLAY_G>?"
-
- para "Good morning pika."
- line "What's up pika?"
- done
-
-UnknownText_0x1b69d2:
- text "Hi, <PLAY_G>?"
-
- para "Good day pika,"
- line "what's up pika?"
- done
-
-UnknownText_0x1b69f8:
- text "Hi, <PLAY_G>?"
-
- para "Good evening pika,"
- line "what's up pika?"
- done
-
-UnknownText_0x1b6a22:
- text "<PLAY_G> pika, good"
- line "morning!"
-
- para "It's @"
- text_ram wStringBuffer3
- text ", how"
- line "pika are you?"
- done
-
-UnknownText_0x1b6a56:
- text "<PLAY_G> pika, good"
- line "pika day!"
-
- para "It's @"
- text_ram wStringBuffer3
- text ", how"
- line "pika are you?"
- done
-
-UnknownText_0x1b6a8b:
- text "<PLAY_G> pika, good"
- line "evening!"
-
- para "It's @"
- text_ram wStringBuffer3
- text ". Were"
- line "you pika awake?"
- done
-
-UnknownText_0x1b6ac2:
- text "You have to hear"
- line "this! My lovable"
-
- para "@"
- text_ram wStringBuffer4
- text " looked"
- line "at me and grinned!"
-
- para "It must be because"
- line "our hearts beat"
- cont "together as one!"
- done
-
-UnknownText_0x1b6b39:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, Good morning,"
- line "<PLAY_G>."
- done
-
-UnknownText_0x1b6b65:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "That voice…"
- line "<PLAY_G>, right?"
- done
-
-UnknownText_0x1b6b92:
- text "Hello, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "This must be"
- line "<PLAY_G>!"
- done
-
-UnknownText_0x1b6bb9:
- text "Hello!"
- line "@"
- text_ram wStringBuffer3
- text " here…"
-
- para "Good morning! The"
- line "weather's great!"
- done
-
-UnknownText_0x1b6bef:
- text "Hello!"
- line "@"
- text_ram wStringBuffer3
- text " here…"
-
- para "What a perfect day"
- line "for fishing!"
- done
-
-UnknownText_0x1b6c23:
- text "Hello!"
- line "@"
- text_ram wStringBuffer3
- text " here…"
-
- para "It's a great night"
- line "for fishing!"
- done
-
-UnknownText_0x1b6c56:
- text "How's your trip"
- line "coming along?"
-
- para "I can't complain"
- line "about my fishing!"
- done
-
-UnknownText_0x1b6c96:
- text "Yes? @"
- text_ram wStringBuffer3
- text " here…"
-
- para "Ah, <PLAYER>. What"
- line "can I do for you?"
- done
-
-UnknownText_0x1b6cc6:
- text "Yes? @"
- text_ram wStringBuffer3
- text " here…"
-
- para "Ah, <PLAYER>. What"
- line "can I do for you?"
- done
-
-UnknownText_0x1b6cf6:
- text "Yes? @"
- text_ram wStringBuffer3
- text " here…"
-
- para "Ah, <PLAYER>. What"
- line "can I do for you?"
- done
-
-UnknownText_0x1b6d26:
- text "Hiya, <PLAYER>. How"
- line "are you doing?"
-
- para "Hey! It's me,"
- line "@"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b6d57:
- text "Hiya, <PLAYER>, how"
- line "are you doing?"
-
- para "Hey, it's me,"
- line "@"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b6d88:
- text "Hiya, <PLAYER>, how"
- line "are you doing?"
-
- para "Hey, it's me,"
- line "@"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b6db9:
- text "Oh yeah, I saw you"
- line "coming out of a"
-
- para "#MON CENTER the"
- line "other day."
-
- para "You heal your"
- line "#MON regularly,"
-
- para "don't you?"
- line "I'm impressed."
-
- para "Heh, my @"
- text_ram wStringBuffer4
- text_start
- line "is so tough, it"
-
- para "doesn't need to go"
- line "to #MON CENTERS"
- cont "often. Heheh!"
- done
-
-UnknownText_0x1b6e7c:
- text "Yes? This is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh, <PLAY_G>."
- line "Good morning."
- done
-
-UnknownText_0x1b6ea6:
- text "Yes? This is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh, <PLAY_G>."
- line "Hello."
- done
-
-UnknownText_0x1b6ec9:
- text "Yes? This is"
- line "@"
- text_ram wStringBuffer3
- text "."
-
- para "Oh, <PLAY_G>, good"
- line "evening."
- done
-
-UnknownText_0x1b6ef3:
- text "Is this <PLAY_G>?"
-
- para "Good morning. This"
- line "is @"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b6f1c:
- text "Is this <PLAY_G>?"
-
- para "Hi, it's @"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b6f37:
- text "Is this <PLAY_G>?"
-
- para "Good evening. This"
- line "is @"
- text_ram wStringBuffer3
- text "."
- done
-
-UnknownText_0x1b6f60:
- text "Are your #MON"
- line "doing well?"
-
- para "I hope you take"
- line "them to a #MON"
- cont "CENTER every day."
-
- para "Don't push them"
- line "too hard."
-
- para "My @"
- text_ram wStringBuffer4
- text " is"
- line "cute and lively"
-
- para "precisely because"
- line "I take it to a"
-
- para "#MON CENTER"
- line "every day."
- done
-
-UnknownText_0x1b7019:
- text "Yes, hello?"
- line "@"
- text_ram wStringBuffer3
- text " here!"
-
- para "Morning, <PLAY_G>!"
-
- para "Are you using bird"
- line "#MON?"
- done
-
-UnknownText_0x1b7057:
- text "Yes, hello?"
- line "@"
- text_ram wStringBuffer3
- text " here!"
-
- para "Hi, <PLAY_G>!"
-
- para "Are your bird"
- line "#MON flying?"
- done
-
-UnknownText_0x1b7092:
- text "Yes, hello?"
- line "@"
- text_ram wStringBuffer3
- text " here!"
-
- para "Evening, <PLAY_G>!"
- line "Are you letting"
-
- para "your bird #MON"
- line "see some action?"
- done
-
-UnknownText_0x1b70e7:
- text "Good morning,"
- line "<PLAY_G>!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "!"
- line "Good morning!"
- done
-
-UnknownText_0x1b7112:
- text "Hi, <PLAY_G>!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "!"
- line "Remember me?"
- done
-
-UnknownText_0x1b7132:
- text "Good evening,"
- line "<PLAY_G>!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "!"
- line "Are you free now?"
- done
-
-UnknownText_0x1b7161:
- text "Are you and your"
- line "#MON fine?"
-
- para "My @"
- text_ram wStringBuffer4
- text_start
- line "looks like it will"
-
- para "get tough enough"
- line "to face and beat"
-
- para "the legendary bird"
- line "#MON!"
- done
-
-UnknownText_0x1b71d5:
- text "Hello, you have"
- line "reached @"
- text_ram wStringBuffer3
- text "…"
-
- para "Ah, <PLAY_G>."
- done
-
-UnknownText_0x1b71fc:
- text "Hello, you have"
- line "reached @"
- text_ram wStringBuffer3
- text "…"
-
- para "Ah, <PLAY_G>, is"
- line "it?"
- done
-
-UnknownText_0x1b722a:
- text "Hello, you have"
- line "reached @"
- text_ram wStringBuffer3
- text "…"
-
- para "Ah, if it isn't"
- line "<PLAY_G>."
- done
-
-UnknownText_0x1b725c:
- text "Ah, it's @"
- text_ram wStringBuffer3
- text "…"
-
- para "Have you got a"
- line "moment?"
- done
-
-UnknownText_0x1b7283:
- text "Ah, it's @"
- text_ram wStringBuffer3
- text "…"
-
- para "Can you talk now?"
- done
-
-UnknownText_0x1b72a5:
- text "Ah, it's @"
- text_ram wStringBuffer3
- text "…"
-
- para "Sorry for calling"
- line "so late."
- done
-
-UnknownText_0x1b72d0:
- text "Have your #MON"
- line "grown any?"
-
- para "My @"
- text_ram wStringBuffer4
- text " has"
- line "grown quite a bit."
- done
-
-UnknownText_0x1b730b:
- text_ram wStringBuffer3
- text " here…"
-
- para "<PLAYER>! Beautiful"
- line "morning, hey?"
- done
-
-UnknownText_0x1b7331:
- text_ram wStringBuffer3
- text " here…"
-
- para "<PLAYER>! Beautiful"
- line "weather, hey?"
- done
-
-UnknownText_0x1b7357:
- text_ram wStringBuffer3
- text " here…"
-
- para "<PLAYER>! Beautiful"
- line "moonlight, hey?"
- done
-
-UnknownText_0x1b737f:
- text "Hey, <PLAYER>!"
- line "This is @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b7397:
- text "Hey, <PLAYER>!"
- line "This is @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b73af:
- text "Hey, <PLAYER>!"
- line "This is @"
- text_ram wStringBuffer3
- text "!"
- done
-
-UnknownText_0x1b73c7:
- text "Yup, yup!"
- line "It's @"
- text_ram wStringBuffer3
- text "!"
-
- para "Hah, and here's"
- line "<PLAY_G>!"
- done
-
-UnknownText_0x1b73ef:
- text "Yup, yup!"
- line "It's @"
- text_ram wStringBuffer3
- text "!"
-
- para "Hah, and here's"
- line "<PLAY_G>!"
- done
-
-UnknownText_0x1b7417:
- text "Yup, yup!"
- line "It's @"
- text_ram wStringBuffer3
- text "!"
-
- para "Hah, and here's"
- line "<PLAY_G>!"
- done
-
-UnknownText_0x1b743f:
- text "<PLAY_G>, it's"
- line "@"
- text_ram wStringBuffer3
- text "!"
-
- para "Have you had a"
- line "proper breakfast?"
- done
-
-UnknownText_0x1b746f:
- text "<PLAY_G>, it's"
- line "@"
- text_ram wStringBuffer3
- text "!"
-
- para "Have you had a"
- line "proper lunch?"
- done
-
-UnknownText_0x1b749b:
- text "<PLAY_G>, it's"
- line "@"
- text_ram wStringBuffer3
- text "!"
-
- para "Have you had a"
- line "proper dinner?"
- done
-
-UnknownText_0x1b74c8:
- text "Are your #MON"
- line "looking good?"
-
- para "My @"
- text_ram wStringBuffer4
- text " and"
- line "me--we're looking"
-
- para "mighty dandy!"
- line "Hahahah!"
- done
-
-UnknownText_0x1b751a:
- text "Yes, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh. Hi, <PLAY_G>!"
- line "Good morning!"
- done
-
-UnknownText_0x1b7548:
- text "Yes, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, hi, <PLAY_G>!"
- line "Yahoo!"
- done
-
-UnknownText_0x1b756f:
- text "Yes, this is"
- line "@"
- text_ram wStringBuffer3
- text "…"
-
- para "Oh, hi, <PLAY_G>!"
- done
-
-UnknownText_0x1b758f:
- text "<PLAY_G>!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "!"
- line "Good morning!"
- done
-
-UnknownText_0x1b75ac:
- text "<PLAY_G>!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "!"
- line "Working hard?"
- done
-
-UnknownText_0x1b75c9:
- text "<PLAY_G>!"
-
- para "It's @"
- text_ram wStringBuffer3
- text "!"
- line "Were you up?"
- done
-
-UnknownText_0x1b75e5:
- text "Are you raising"
- line "your #MON?"
-
- para "Hey, @"
- text_ram wStringBuffer3
- text "'s"
- line "@"
- text_ram wStringBuffer4
- text " is"
- cont "looking good!"
- done
-
-UnusedPhoneText:
- text "Good morning."
- done
diff --git a/data/phone/text/tully_callee.asm b/data/phone/text/tully_callee.asm
new file mode 100644
index 000000000..9156cd1e6
--- /dev/null
+++ b/data/phone/text/tully_callee.asm
@@ -0,0 +1,67 @@
+UnknownText_0x1b6b39:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Oh, Good morning,"
+ line "<PLAY_G>."
+ done
+
+UnknownText_0x1b6b65:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "That voice…"
+ line "<PLAY_G>, right?"
+ done
+
+UnknownText_0x1b6b92:
+ text "Hello, this is"
+ line "@"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "This must be"
+ line "<PLAY_G>!"
+ done
+
+UnknownText_0x1b6bb9:
+ text "Hello!"
+ line "@"
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "Good morning! The"
+ line "weather's great!"
+ done
+
+UnknownText_0x1b6bef:
+ text "Hello!"
+ line "@"
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "What a perfect day"
+ line "for fishing!"
+ done
+
+UnknownText_0x1b6c23:
+ text "Hello!"
+ line "@"
+ text_ram wStringBuffer3
+ text " here…"
+
+ para "It's a great night"
+ line "for fishing!"
+ done
+
+UnknownText_0x1b6c56:
+ text "How's your trip"
+ line "coming along?"
+
+ para "I can't complain"
+ line "about my fishing!"
+ done
diff --git a/data/phone/text/tully_caller.asm b/data/phone/text/tully_caller.asm
new file mode 100644
index 000000000..cf1fc5d23
--- /dev/null
+++ b/data/phone/text/tully_caller.asm
@@ -0,0 +1,104 @@
+TullyGrownText:
+ text "My @"
+ text_ram wStringBuffer4
+ text " has"
+ line "grown again."
+
+ para "It was only about"
+ line "so big when I"
+
+ para "caught it, but now"
+ line "it's way bigger."
+ done
+
+UnknownText_0x65e42:
+ text "Oh yeah, I KO'd a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "It was huge, like"
+ line "this big even."
+
+ para "Heh, I guess you"
+ line "can't tell over"
+ cont "the phone…"
+ done
+
+UnknownText_0x65eac:
+ text "Oh yeah, I lost a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text "."
+
+ para "It was huge, like"
+ line "this big even."
+
+ para "Heh, I guess you"
+ line "can't tell over"
+ cont "the phone…"
+ done
+
+UnknownText_0x65f17:
+ text "We should get a"
+ line "battle going!"
+
+ para "I'll be fishing on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "Swing by if you"
+ line "have the time."
+ done
+
+UnknownText_0x65f6e:
+ text "Well, I'll be"
+ line "seeing you."
+ done
+
+UnknownText_0x65f88:
+ text "I picked up a good"
+ line "little thing at"
+ cont "the water's edge."
+
+ para "Like I promised,"
+ line "it's yours."
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x65ff2:
+ text "Have I found"
+ line "anything good?"
+
+ para "Nope, not yet."
+
+ para "It's like fishing,"
+ line "you need patience."
+ done
+
+UnknownText_0x66043:
+ text "Yup, TULLY here…"
+
+ para "<PLAY_G>? What?"
+ line "You're lost?"
+
+ para "Our battle will be"
+ line "on @"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x66087:
+ text "I've got something"
+ line "good for you."
+
+ para "Hustle over to"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
diff --git a/data/phone/text/unknown_callee.asm b/data/phone/text/unknown_callee.asm
new file mode 100644
index 000000000..570618b05
--- /dev/null
+++ b/data/phone/text/unknown_callee.asm
@@ -0,0 +1,30 @@
+UnknownText_0x1b518b:
+ text "How are your"
+ line "#MON doing?"
+
+ para "My #MON are a"
+ line "bit too energetic."
+
+ para "@"
+ text_ram wStringBuffer4
+ text ","
+ line "especially."
+
+ para "Every time it"
+ line "spots a trainer,"
+ cont "it has to battle."
+
+ para "It gets to be a"
+ line "bit much for me!"
+ done
+
+UnknownText_0x1b522b:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "looking tougher"
+ cont "than ever."
+
+ para "It looks even"
+ line "tougher than me!"
+ done
diff --git a/data/phone/text/unused.asm b/data/phone/text/unused.asm
new file mode 100644
index 000000000..cd1cf723f
--- /dev/null
+++ b/data/phone/text/unused.asm
@@ -0,0 +1,3 @@
+UnusedPhoneText:
+ text "Good morning."
+ done
diff --git a/data/phone/text/vance_callee.asm b/data/phone/text/vance_callee.asm
new file mode 100644
index 000000000..c1c8948b4
--- /dev/null
+++ b/data/phone/text/vance_callee.asm
@@ -0,0 +1,81 @@
+UnknownText_0x1b7019:
+ text "Yes, hello?"
+ line "@"
+ text_ram wStringBuffer3
+ text " here!"
+
+ para "Morning, <PLAY_G>!"
+
+ para "Are you using bird"
+ line "#MON?"
+ done
+
+UnknownText_0x1b7057:
+ text "Yes, hello?"
+ line "@"
+ text_ram wStringBuffer3
+ text " here!"
+
+ para "Hi, <PLAY_G>!"
+
+ para "Are your bird"
+ line "#MON flying?"
+ done
+
+UnknownText_0x1b7092:
+ text "Yes, hello?"
+ line "@"
+ text_ram wStringBuffer3
+ text " here!"
+
+ para "Evening, <PLAY_G>!"
+ line "Are you letting"
+
+ para "your bird #MON"
+ line "see some action?"
+ done
+
+UnknownText_0x1b70e7:
+ text "Good morning,"
+ line "<PLAY_G>!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b7112:
+ text "Hi, <PLAY_G>!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "!"
+ line "Remember me?"
+ done
+
+UnknownText_0x1b7132:
+ text "Good evening,"
+ line "<PLAY_G>!"
+
+ para "It's @"
+ text_ram wStringBuffer3
+ text "!"
+ line "Are you free now?"
+ done
+
+UnknownText_0x1b7161:
+ text "Are you and your"
+ line "#MON fine?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text_start
+ line "looks like it will"
+
+ para "get tough enough"
+ line "to face and beat"
+
+ para "the legendary bird"
+ line "#MON!"
+ done
diff --git a/data/phone/text/vance_caller.asm b/data/phone/text/vance_caller.asm
new file mode 100644
index 000000000..97cf2ec14
--- /dev/null
+++ b/data/phone/text/vance_caller.asm
@@ -0,0 +1,64 @@
+VanceLiftoffText:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "become tougher."
+
+ para "We've achieved"
+ line "liftoff!"
+ done
+
+UnknownText_0x669b2:
+ text "We can easily beat"
+ line "@"
+ text_ram wStringBuffer4
+ text "!"
+
+ para "…Huh? You too?"
+ line "Isn't that great?"
+ done
+
+UnknownText_0x669ed:
+ text "But get this, a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text_start
+ para "just barely eluded"
+ line "us."
+
+ para "I wanted to FLY"
+ line "after it…"
+ done
+
+UnknownText_0x66a3a:
+ text "Right now, I'm on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+
+ para "You know, where I"
+ line "first met you?"
+
+ para "Want to battle?"
+ line "I'll wait here."
+ done
+
+UnknownText_0x66a93:
+ text "OK, bye for now!"
+ done
+
+VanceLookingForwardText:
+ text "I'll be looking"
+ line "forward to our"
+ cont "next battle!"
+ done
+
+VanceHurryHurryText:
+ text "Oh, <PLAY_G>!"
+ line "Hurry, hurry!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "!"
+ line "FLY over now!"
+ done
diff --git a/data/phone/text/wade_callee.asm b/data/phone/text/wade_callee.asm
new file mode 100644
index 000000000..ab8a1cd3a
--- /dev/null
+++ b/data/phone/text/wade_callee.asm
@@ -0,0 +1,77 @@
+UnknownText_0x1b5a3b:
+ text "Hello? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking."
+
+ para "Oh. Hi, <PLAY_G>!"
+ line "Good morning!"
+ done
+
+UnknownText_0x1b5a74:
+ text "Hello? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking."
+
+ para "Oh, hi, <PLAY_G>!"
+ done
+
+UnknownText_0x1b5a9f:
+ text "Hello? This is"
+ line "@"
+ text_ram wStringBuffer3
+ text " speaking."
+
+ para "Oh, hi, <PLAY_G>!"
+ line "Good evening!"
+ done
+
+UnknownText_0x1b5ad8:
+ text "<PLAY_G>, good"
+ line "morning!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "Isn't it nice out?"
+ done
+
+UnknownText_0x1b5b0b:
+ text "<PLAY_G>, howdy!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "Isn't it nice out?"
+ done
+
+UnknownText_0x1b5b37:
+ text "Good evening,"
+ line "<PLAY_G>!"
+
+ para "It's me, @"
+ text_ram wStringBuffer3
+ text "."
+ line "Were you awake?"
+ done
+
+UnknownText_0x1b5b68:
+ text "How are your"
+ line "#MON doing?"
+
+ para "My #MON have"
+ line "too much energy to"
+
+ para "burn. It gets to"
+ line "be a problem."
+
+ para "Of all my #MON,"
+ line "@"
+ text_ram wStringBuffer4
+ text " is the"
+ cont "hardest to handle."
+
+ para "Working with it is"
+ line "exhausting."
+ done
diff --git a/data/phone/text/wade_caller.asm b/data/phone/text/wade_caller.asm
new file mode 100644
index 000000000..6f8ccc841
--- /dev/null
+++ b/data/phone/text/wade_caller.asm
@@ -0,0 +1,136 @@
+WadeAreYouGrowingText:
+ text "Are your #MON"
+ line "growing?"
+
+ para "My #MON are"
+ line "growing a bit too"
+
+ para "quickly for me."
+ line "It's overwhelming!"
+
+ para "@"
+ text_ram wStringBuffer4
+ text "'s grow-"
+ line "ing especially"
+
+ para "quickly. I think"
+ line "it'll get tough."
+ done
+
+UnknownText_0x175869:
+ text "Oh yeah, we KO'd a"
+ line "wild @"
+ text_ram wStringBuffer4
+ text_start
+ para "with one hit a"
+ line "while back."
+
+ para "It went down so"
+ line "easily, I felt a"
+
+ para "little sorry for"
+ line "the poor thing."
+ done
+
+UnknownText_0x1758e4:
+ text "Oh yeah, a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text " got"
+
+ para "away from me at"
+ line "the last second."
+
+ para "I know it's a"
+ line "common #MON…"
+
+ para "But it does annoy"
+ line "me that it got"
+
+ para "away when I almost"
+ line "had it."
+ done
+
+UnknownText_0x175976:
+ text "Do you feel like a"
+ line "#MON battle?"
+
+ para "It won't be like"
+ line "last time!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "'s"
+ line "where I'll be."
+
+ para "Let me know when"
+ line "you get there."
+ done
+
+UnknownText_0x1759e7:
+ text "See you later!"
+ done
+
+WadeBugCatchingContestText:
+ text "The Bug-Catching"
+ line "Contest is at the"
+
+ para "NATIONAL PARK"
+ line "today."
+
+ para "Are you going,"
+ line "<PLAY_G>?"
+
+ para "I'm trying to make"
+ line "up my mind."
+ done
+
+WadeFoundBerryText:
+ text "I found all kinds"
+ line "of BERRIES. If you"
+
+ para "want, I'll share"
+ line "some with you."
+
+ para "I'll be waiting on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+UnknownText_0x175abe:
+ text "Huh? BERRIES?"
+
+ para "Sorry, I haven't"
+ line "found any yet."
+
+ para "I'll call you if I"
+ line "find any. Will you"
+ cont "please wait?"
+ done
+
+UnknownText_0x175b1e:
+ text "Let's battle"
+ line "already!"
+
+ para "@"
+ text_ram wStringBuffer5
+ text " is"
+ line "where I am."
+
+ para "Please get here as"
+ line "soon as you can!"
+ done
+
+UnknownText_0x175b6d:
+ text "How come you're"
+ line "not here yet?"
+
+ para "@"
+ text_ram wStringBuffer5
+ text " is"
+ line "where I am."
+
+ para "Please get here as"
+ line "soon as you can!"
+ done
diff --git a/data/phone/text/wilton_callee.asm b/data/phone/text/wilton_callee.asm
new file mode 100644
index 000000000..2d9dd1813
--- /dev/null
+++ b/data/phone/text/wilton_callee.asm
@@ -0,0 +1,64 @@
+UnknownText_0x1b71d5:
+ text "Hello, you have"
+ line "reached @"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Ah, <PLAY_G>."
+ done
+
+UnknownText_0x1b71fc:
+ text "Hello, you have"
+ line "reached @"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Ah, <PLAY_G>, is"
+ line "it?"
+ done
+
+UnknownText_0x1b722a:
+ text "Hello, you have"
+ line "reached @"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Ah, if it isn't"
+ line "<PLAY_G>."
+ done
+
+UnknownText_0x1b725c:
+ text "Ah, it's @"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Have you got a"
+ line "moment?"
+ done
+
+UnknownText_0x1b7283:
+ text "Ah, it's @"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Can you talk now?"
+ done
+
+UnknownText_0x1b72a5:
+ text "Ah, it's @"
+ text_ram wStringBuffer3
+ text "…"
+
+ para "Sorry for calling"
+ line "so late."
+ done
+
+UnknownText_0x1b72d0:
+ text "Have your #MON"
+ line "grown any?"
+
+ para "My @"
+ text_ram wStringBuffer4
+ text " has"
+ line "grown quite a bit."
+ done
diff --git a/data/phone/text/wilton_caller.asm b/data/phone/text/wilton_caller.asm
new file mode 100644
index 000000000..9e95e95d6
--- /dev/null
+++ b/data/phone/text/wilton_caller.asm
@@ -0,0 +1,103 @@
+WiltonGrownText:
+ text "My @"
+ text_ram wStringBuffer4
+ text "'s"
+ line "grown impressive!"
+
+ para "My fishing skills"
+ line "have improved too!"
+ done
+
+UnknownText_0x66b3e:
+ text "We beat a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text "…"
+
+ para "You know, I have"
+ line "more fun fishing"
+
+ para "than beating wild"
+ line "#MON."
+ done
+
+UnknownText_0x66b8f:
+ text "But a while back,"
+ line "we came this close"
+
+ para "to landing a wild"
+ line "@"
+ text_ram wStringBuffer4
+ text "."
+
+ para "I tell you, it was"
+ line "huge. Believe me."
+ done
+
+UnknownText_0x66bf3:
+ text "I'm fishing on"
+ line "@"
+ text_ram wStringBuffer5
+ text ","
+
+ para "but nothing's"
+ line "biting today."
+
+ para "Help me while my"
+ line "time away, come"
+ cont "over for a battle."
+ done
+
+UnknownText_0x66c58:
+ text "All right, later."
+ done
+
+UnknownText_0x66c6b:
+ text "I snagged an item"
+ line "while fishing."
+
+ para "Come pick it up on"
+ line "@"
+ text_ram wStringBuffer5
+ text "."
+ done
+
+WiltonHaventFoundAnythingText:
+ text "Nah, I haven't"
+ line "found anything"
+
+ para "that's worth your"
+ line "time."
+
+ para "You have to have"
+ line "patience."
+ done
+
+WiltonNotBitingText:
+ text "Sigh…"
+ line "They're not biting"
+
+ para "like before on"
+ line "@"
+ text_ram wStringBuffer5
+ text "…"
+
+ para "You have to come"
+ line "for a battle!"
+ done
+
+WiltonWantThisText:
+ text "Don't you want"
+ line "this item?"
+
+ para "Hah? You don't"
+ line "know where?"
+
+ para "@"
+ text_ram wStringBuffer5
+ text "…"
+ line "Just head from"
+
+ para "MAHOGANY toward"
+ line "BLACKTHORN!"
+ done
diff --git a/data/text/std_text.asm b/data/text/std_text.asm
index 18edf239b..d431a0fd1 100644
--- a/data/text/std_text.asm
+++ b/data/text/std_text.asm
@@ -219,8 +219,8 @@ ContestResults_ReadyToJudgeText:
line "the #MON you've"
cont "caught."
- para $56
- line $56
+ para "<……>"
+ line "<……>"
para "We have chosen the"
line "winners!"
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md
index d4d8c7870..93c759915 100644
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -2,7 +2,8 @@
These are known bugs and glitches in the original Pokémon Crystal game: code that clearly does not work as intended, or that only works in limited circumstances but has the possibility to fail or crash.
-Fixes are written in the `diff` format. If you're familiar with git, this should look farmiliar:
+Fixes are written in the `diff` format. If you've used Git before, this should look familiar:
+
```diff
this is some code
-delete red - lines
@@ -15,6 +16,7 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
- [Thick Club and Light Ball can make (Special) Attack wrap around above 1024](#thick-club-and-light-ball-can-make-special-attack-wrap-around-above-1024)
- [Metal Powder can increase damage taken with boosted (Special) Defense](#metal-powder-can-increase-damage-taken-with-boosted-special-defense)
- [Reflect and Light Screen can make (Special) Defense wrap around above 1024](#reflect-and-light-screen-can-make-special-defense-wrap-around-above-1024)
+- [Moves with a 100% secondary effect chance will not trigger it in 1/256 uses](#moves-with-a-100-secondary-effect-chance-will-not-trigger-it-in-1256-uses)
- [Belly Drum sharply boosts Attack even with under 50% HP](#belly-drum-sharply-boosts-attack-even-with-under-50-hp)
- [Confusion damage is affected by type-boosting items and Explosion/Self-Destruct doubling](#confusion-damage-is-affected-by-type-boosting-items-and-explosionself-destruct-doubling)
- [Moves that lower Defense can do so after breaking a Substitute](#moves-that-lower-defense-can-do-so-after-breaking-a-substitute)
@@ -39,6 +41,7 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
- [Love Ball boosts catch rate for the wrong gender](#love-ball-boosts-catch-rate-for-the-wrong-gender)
- [Fast Ball only boosts catch rate for three Pokémon](#fast-ball-only-boosts-catch-rate-for-three-pokémon)
- [Dragon Scale, not Dragon Fang, boosts Dragon-type moves](#dragon-scale-not-dragon-fang-boosts-dragon-type-moves)
+- [Clair can give TM24 Dragonbreath twice](#clair-can-give-tm24-dragonbreath-twice)
- [Daisy's grooming doesn't always increase happiness](#daisys-grooming-doesnt-always-increase-happiness)
- [Magikarp in Lake of Rage are shorter, not longer](#magikarp-in-lake-of-rage-are-shorter-not-longer)
- [Magikarp length limits have a unit conversion error](#magikarp-length-limits-have-a-unit-conversion-error)
@@ -88,8 +91,7 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
+ ret nc
+
+.cap
-+ ld h, HIGH(MAX_STAT_VALUE)
-+ ld l, LOW(MAX_STAT_VALUE)
++ ld hl, MAX_STAT_VALUE
ret
```
@@ -126,8 +128,7 @@ Fixes are written in the `diff` format. If you're familiar with git, this should
+ ret nc
+
+.cap
-+ ld b, HIGH(MAX_STAT_VALUE)
-+ ld c, LOW(MAX_STAT_VALUE)
++ ld bc, MAX_STAT_VALUE
ret
```
@@ -160,6 +161,35 @@ This bug existed for all battles in Gold and Silver, and was only fixed for sing
(This fix also affects Thick Club, Light Ball, and Metal Powder, as described above, but their specific fixes in the above bugs allow more accurate damage calculations.)
+## Moves with a 100% secondary effect chance will not trigger it in 1/256 uses
+
+*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
+
+([Video](https://www.youtube.com/watch?v=mHkyO5T5wZU&t=206))
+
+**Fix:** Edit `BattleCommand_EffectChance` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
+
+```diff
+- ; BUG: 1/256 chance to fail even for a 100% effect chance,
+- ; since carry is not set if BattleRandom == [hl] == 255
++ ld a, [hl]
++ cp 100 percent
++ jr z, .ok
+ call BattleRandom
+ cp [hl]
+- pop hl
+- ret c
++ jr c, .ok
+
+ .failed
+ ld a, 1
+ ld [wEffectFailed], a
+ and a
++.ok
++ pop hl
+ ret
+```
+
## Belly Drum sharply boosts Attack even with under 50% HP
*Fixing this bug will break compatibility with standard Pokémon Crystal for link battles.*
@@ -251,7 +281,7 @@ This bug affects Acid, Iron Tail, and Rock Smash.
ld a, [hli]
or [hl]
- ret z
-+ jp z, .failed
++ jr z, .failed
```
Add this to the end of each file:
@@ -482,32 +512,33 @@ This bug existed for all battles in Gold and Silver, and was only fixed for sing
## AI makes a false assumption about `CheckTypeMatchup`
-In [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm).
+**Fix:** Edit `BattleCheckTypeMatchup` in [engine/battle/effect_commands.asm](/engine/battle/effect_commands.asm):
-```asm
-BattleCheckTypeMatchup:
- ld hl, wEnemyMonType1
- ldh a, [hBattleTurn]
- and a
- jr z, CheckTypeMatchup
- ld hl, wBattleMonType1
-CheckTypeMatchup:
-; There is an incorrect assumption about this function made in the AI related code: when
-; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing the
-; offensive type in a will make this function do the right thing. Since a is overwritten,
-; this assumption is incorrect. A simple fix would be to load the move type for the
-; current move into a in BattleCheckTypeMatchup, before falling through, which is
-; consistent with how the rest of the code assumes this code works like.
- push hl
- push de
- push bc
- ld a, BATTLE_VARS_MOVE_TYPE
- call GetBattleVar
- ld d, a
+```diff
+ BattleCheckTypeMatchup:
+ ld hl, wEnemyMonType1
+ ldh a, [hBattleTurn]
+ and a
+ jr z, CheckTypeMatchup
+ ld hl, wBattleMonType1
++ ld a, BATTLE_VARS_MOVE_TYPE
++ call GetBattleVar ; preserves hl, de, and bc
+ CheckTypeMatchup:
+-; There is an incorrect assumption about this function made in the AI related code: when
+-; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing the
+-; offensive type in a will make this function do the right thing. Since a is overwritten,
+-; this assumption is incorrect. A simple fix would be to load the move type for the
+-; current move into a in BattleCheckTypeMatchup, before falling through, which is
+-; consistent with how the rest of the code assumes this code works like.
+ push hl
+ push de
+ push bc
+- ld a, BATTLE_VARS_MOVE_TYPE
+- call GetBattleVar
+ ld d, a
+ ...
```
-*To do:* Fix this bug.
-
## NPC use of Full Heal or Full Restore does not cure Nightmare status
@@ -612,7 +643,7 @@ This can bring Pokémon straight from level 1 to 100 by gaining just a few exper
+ ld [hl], a
+ ret
+
- +.UseExpFormula
++.UseExpFormula
ld a, [wBaseGrowthRate]
add a
add a
@@ -681,7 +712,7 @@ This can bring Pokémon straight from level 1 to 100 by gaining just a few exper
## Moon Ball does not boost catch rate
-**Fix:** Edit `MoonBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
+**Fix:** Edit `MoonBallMultiplier` in [items/item_effects.asm](/engine/items/item_effects.asm):
```diff
-; Moon Stone's constant from Pokémon Red is used.
@@ -699,7 +730,7 @@ This can bring Pokémon straight from level 1 to 100 by gaining just a few exper
## Love Ball boosts catch rate for the wrong gender
-**Fix:** Edit `LoveBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
+**Fix:** Edit `LoveBallMultiplier` in [items/item_effects.asm](/engine/items/item_effects.asm):
```diff
.wildmale
@@ -715,7 +746,7 @@ This can bring Pokémon straight from level 1 to 100 by gaining just a few exper
## Fast Ball only boosts catch rate for three Pokémon
-**Fix:** Edit `FastBallMultiplier` in [items/item_effects.asm](/items/item_effects.asm):
+**Fix:** Edit `FastBallMultiplier` in [items/item_effects.asm](/engine/items/item_effects.asm):
```diff
.loop
@@ -750,6 +781,23 @@ This can bring Pokémon straight from level 1 to 100 by gaining just a few exper
```
+## Clair can give TM24 Dragonbreath twice
+
+([Video](https://www.youtube.com/watch?v=8BvBjqxmyOk))
+
+**Fix:** Edit `DragonsDen1F_MapScripts` in [maps/DragonsDen1F.asm](/maps/DragonsDen1F.asm):
+
+```diff
+- db 0 ; callbacks
++ db 1 ; callbacks
++ callback MAPCALLBACK_NEWMAP, .UnsetClairScene
++
++.UnsetClairScene:
++ setmapscene DRAGONS_DEN_B1F, SCENE_DRAGONSDENB1F_NOTHING
++ end
+```
+
+
## Daisy's grooming doesn't always increase happiness
This is a bug with `HaircutOrGrooming` in [engine/events/haircut.asm](/engine/events/haircut.asm):
@@ -924,7 +972,7 @@ First, edit [engine/battle/battle_transition.asm](/engine/battle/battle_transiti
+ jr nz, .loop
+
+.okay
-+ ld de, MON_LEVEL - MON_HP
++ ld de, MON_LEVEL - MON_HP - 1
+ add hl, de
ld de, 0
- ld a, [wBattleMonLevel]
@@ -1019,10 +1067,10 @@ Finally, edit [engine/battle/read_trainer_party.asm](/engine/battle/read_trainer
+.skip_trainer
+ dec b
+ jr z, .got_trainer
-+.loop1
++.skip_party
+ ld a, [hli]
+ cp $ff
-+ jr nz, .loop1
++ jr nz, .skip_party
+ jr .skip_trainer
+.got_trainer
+
@@ -1390,43 +1438,46 @@ This supports up to six entries.
## `ScriptCall` can overflow `wScriptStack` and crash
-In [engine/overworld/scripting.asm](/engine/overworld/scripting.asm):
+**Fix:** Edit `ScriptCall` in [engine/overworld/scripting.asm](/engine/overworld/scripting.asm):
-```asm
-ScriptCall:
-; Bug: The script stack has a capacity of 5 scripts, yet there is
-; nothing to stop you from pushing a sixth script. The high part
-; of the script address can then be overwritten by modifications
-; to wScriptDelay, causing the script to return to the rst/interrupt
-; space.
-
- push de
- ld hl, wScriptStackSize
- ld e, [hl]
- inc [hl]
- ld d, $0
- ld hl, wScriptStack
- add hl, de
- add hl, de
- add hl, de
- pop de
- ld a, [wScriptBank]
- ld [hli], a
- ld a, [wScriptPos]
- ld [hli], a
- ld a, [wScriptPos + 1]
- ld [hl], a
- ld a, b
- ld [wScriptBank], a
- ld a, e
- ld [wScriptPos], a
- ld a, d
- ld [wScriptPos + 1], a
- ret
+```diff
+ ScriptCall:
+-; Bug: The script stack has a capacity of 5 scripts, yet there is
+-; nothing to stop you from pushing a sixth script. The high part
+-; of the script address can then be overwritten by modifications
+-; to wScriptDelay, causing the script to return to the rst/interrupt
+-; space.
+-
++ ld hl, wScriptStackSize
++ ld a, [hl]
++ cp 5
++ ret nc
+ push de
+- ld hl, wScriptStackSize
+- ld e, [hl]
+ inc [hl]
++ ld e, a
+ ld d, 0
+ ld hl, wScriptStack
+ add hl, de
+ add hl, de
+ add hl, de
+ pop de
+ ld a, [wScriptBank]
+ ld [hli], a
+ ld a, [wScriptPos]
+ ld [hli], a
+ ld a, [wScriptPos + 1]
+ ld [hl], a
+ ld a, b
+ ld [wScriptBank], a
+ ld a, e
+ ld [wScriptPos], a
+ ld a, d
+ ld [wScriptPos + 1], a
+ ret
```
-*To do:* Fix this bug.
-
## `LoadSpriteGFX` does not limit the capacity of `UsedSprites`
diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm
index 499c21adb..654bc6da8 100644
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -138,7 +138,7 @@ ConvertTrainerBattlePokeballTilesTo2bpp:
pop hl
ld de, wDecompressScratch
- ld b, BANK(ConvertTrainerBattlePokeballTilesTo2bpp) ; BANK(@)
+ ld b, BANK(@)
ld c, $28
call Request2bpp
pop af
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 56d42974f..3241e5022 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3551,17 +3551,20 @@ Function_SetEnemyMonAndSendOutAnimation:
call BattleCheckEnemyShininess
jr nc, .not_shiny
+
ld a, 1 ; shiny anim
ld [wBattleAnimParam], a
ld de, ANIM_SEND_OUT_MON
call Call_PlayBattleAnim
-.not_shiny
+.not_shiny
ld bc, wTempMonSpecies
farcall CheckFaintedFrzSlp
jr c, .skip_cry
+
farcall CheckBattleScene
jr c, .cry_no_anim
+
hlcoord 12, 0
ld d, $0
ld e, ANIM_MON_SLOW
@@ -4154,7 +4157,7 @@ PursuitSwitch:
ld a, [wLastPlayerMon]
ld [wCurBattleMon], a
.do_turn
- ld a, BANK(DoPlayerTurn) ; and BANK(DoEnemyTurn)
+ ld a, BANK(DoPlayerTurn) ; aka BANK(DoEnemyTurn)
rst FarCall
ld a, BATTLE_VARS_MOVE
@@ -4404,7 +4407,7 @@ UseHeldStatusHealingItem:
.got_pointer
call SwitchTurnCore
- ld a, BANK(CalcPlayerStats) ; and BANK(CalcEnemyStats)
+ ld a, BANK(CalcPlayerStats) ; aka BANK(CalcEnemyStats)
rst FarCall
call SwitchTurnCore
call ItemRecoveryAnim
@@ -5376,14 +5379,14 @@ MoveSelectionScreen:
.skip_inc
ld [wMenuCursorY], a
- ld a, $1
+ ld a, 1
ld [wMenuCursorX], a
ld a, [wNumMoves]
inc a
ld [w2DMenuNumRows], a
- ld a, $1
+ ld a, 1
ld [w2DMenuNumCols], a
- ld c, $2c
+ ld c, STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP
ld a, [wMoveSelectionMenuType]
dec a
ld b, D_DOWN | D_UP | A_BUTTON
diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm
index 76d6ee375..69171740b 100644
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -1877,6 +1877,8 @@ BattleCommand_EffectChance:
ld hl, wEnemyMoveStruct + MOVE_CHANCE
.got_move_chance
+ ; BUG: 1/256 chance to fail even for a 100% effect chance,
+ ; since carry is not set if BattleRandom == [hl] == 255
call BattleRandom
cp [hl]
pop hl
diff --git a/engine/battle/move_effects/present.asm b/engine/battle/move_effects/present.asm
index 058bbad90..bfc334cc7 100644
--- a/engine/battle/move_effects/present.asm
+++ b/engine/battle/move_effects/present.asm
@@ -59,7 +59,7 @@ BattleCommand_Present:
jr z, .got_hp_fn_pointer
ld hl, AICheckEnemyMaxHP
.got_hp_fn_pointer
- ld a, BANK(AICheckPlayerMaxHP) ; and BANK(AICheckEnemyMaxHP)
+ ld a, BANK(AICheckPlayerMaxHP) ; aka BANK(AICheckEnemyMaxHP)
rst FarCall
jr c, .already_fully_healed
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm
index 48ba967f2..f6c6b06a6 100644
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -601,7 +601,7 @@ BattleAnimCmd_Obj:
call GetBattleAnimByte
ld [wBattleObjectTempYCoord], a
call GetBattleAnimByte
- ld [wBattleObjectTemp0b], a
+ ld [wBattleObjectTempParam], a
call QueueBattleAnimation
ret
diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm
index 05d086f7c..0f2e716ca 100644
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -440,7 +440,7 @@ BattleBGEffect_BattlerObj_1Row:
ld a, 8 * TILE_WIDTH
ld [wBattleObjectTempYCoord], a
xor a
- ld [wBattleObjectTemp0b], a
+ ld [wBattleObjectTempParam], a
call _QueueBattleAnimation
pop bc
ret
@@ -507,7 +507,7 @@ BattleBGEffect_BattlerObj_2Row:
ld a, 8 * TILE_WIDTH
ld [wBattleObjectTempYCoord], a
xor a
- ld [wBattleObjectTemp0b], a
+ ld [wBattleObjectTempParam], a
call _QueueBattleAnimation
pop bc
ret
diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm
index b71303afc..65e16c792 100644
--- a/engine/battle_anims/core.asm
+++ b/engine/battle_anims/core.asm
@@ -65,8 +65,8 @@ endr
xor a
ld [hli], a ; X Offset
ld [hli], a ; Y Offset
- ld a, [wBattleObjectTemp0b]
- ld [hli], a ; 0b
+ ld a, [wBattleObjectTempParam]
+ ld [hli], a ; Param
xor a
ld [hli], a ; 0c
dec a
diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm
index 5ca4e42c6..6706bd364 100644
--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -130,7 +130,7 @@ BattleAnimFunction_ThrowFromPlayerToEnemy:
ld a, [hl]
dec [hl]
; Get ???, which is the amplitude of the sine function
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld d, [hl]
call BattleAnim_Sine
@@ -190,7 +190,7 @@ BattleAnimFunction_03:
dw .one
.zero
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
bit 7, [hl]
ld a, $0
@@ -200,7 +200,7 @@ BattleAnimFunction_03:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $7f
@@ -209,7 +209,7 @@ BattleAnimFunction_03:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld a, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld d, [hl]
push af
@@ -244,7 +244,7 @@ BattleAnimFunction_01:
ld a, [hl]
cp $84
ret nc
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
call Functionce70a
@@ -256,7 +256,7 @@ BattleAnimFunction_02:
ld a, [hl]
cp $84
jr nc, .asm_cd158
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
call Functionce70a
@@ -460,7 +460,7 @@ BattleAnimFunction_10:
dw .three
dw .four
.zero
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
swap a
@@ -476,7 +476,7 @@ BattleAnimFunction_10:
ld a, [hl]
cp $88
ret nc
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
call Functionce70a
@@ -526,7 +526,7 @@ BattleAnimFunction_07:
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld a, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
sub [hl]
jr z, .done
@@ -587,7 +587,7 @@ BattleAnimFunction_08:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
@@ -598,7 +598,7 @@ BattleAnimFunction_08:
ret
.loop_back
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f0
@@ -630,7 +630,7 @@ BattleAnimFunction_08:
ret
.SetCoords:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
@@ -638,7 +638,7 @@ BattleAnimFunction_08:
add hl, bc
add [hl]
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
@@ -663,7 +663,7 @@ BattleAnimFunction_09:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], $0
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
@@ -680,7 +680,7 @@ BattleAnimFunction_09:
ret
.done_one
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
swap a
@@ -714,7 +714,7 @@ BattleAnimFunction_0A:
dw .eight
dw .nine
.zero
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX
@@ -827,7 +827,7 @@ BattleAnimFunction_RazorLeaf:
ld [hl], a
ld a, BATTLEANIMFRAMESET_17
call ReinitBattleAnimFrameset
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
bit 6, [hl]
ret z
@@ -837,7 +837,7 @@ BattleAnimFunction_RazorLeaf:
ret
.sine_cosine
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $3f
@@ -887,7 +887,7 @@ BattleAnimFunction_RazorLeaf:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
bit 6, [hl]
jr nz, .decrease
@@ -944,7 +944,7 @@ BattleAnimFunction_RazorLeaf:
ret
Functioncd557:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
bit 7, a
@@ -987,7 +987,7 @@ BattleAnimFunction_4E:
dw .zero
dw .one
.zero
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $40
@@ -1011,7 +1011,7 @@ BattleAnimFunction_4E:
ret
.sine_cosine
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $3f
@@ -1061,7 +1061,7 @@ BattleAnimFunction_0C:
and a
jr z, .next
dec [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
call Functionce70a
@@ -1103,7 +1103,7 @@ BattleAnimFunction_0C:
ld a, [hl]
cp $20
ret c
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f0
@@ -1146,7 +1146,7 @@ BattleAnimFunction_0D:
ret
.one
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld e, [hl]
ld hl, BATTLEANIMSTRUCT_YCOORD
@@ -1220,10 +1220,10 @@ BattleAnimFunction_0E:
Functioncd6ea:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, BATTLEANIMFRAMESET_24
- add [hl] ; offset
+ add [hl] ; BATTLEANIMFRAMESET_25 BATTLEANIMFRAMESET_26
call ReinitBattleAnimFrameset
Functioncd6f7:
@@ -1349,14 +1349,14 @@ BattleAnimFunction_14:
Functioncd7ab:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f0
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
@@ -1366,7 +1366,7 @@ Functioncd7ab:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld [hl], $1
Functioncd7d2:
@@ -1398,7 +1398,7 @@ Functioncd7d2:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
xor $1
@@ -1447,7 +1447,7 @@ Functioncd835:
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
bit 7, [hl]
jr nz, .asm_cd852
@@ -1461,7 +1461,7 @@ Functioncd835:
add hl, bc
ld [hl], $30
.asm_cd858
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $7f
@@ -1470,7 +1470,7 @@ Functioncd860:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld a, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld d, [hl]
call BattleAnim_Sine
@@ -1482,13 +1482,15 @@ Functioncd860:
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld a, [hl]
- inc a
+ inc a ; BATTLEANIMFRAMESET_3B
+ ; BATTLEANIMFRAMESET_A1
jr .reinit
.load_no_inc
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
- ld a, [hl]
+ ld a, [hl] ; BATTLEANIMFRAMESET_3A
+ ; BATTLEANIMFRAMESET_A0
.reinit
call ReinitBattleAnimFrameset
ld hl, BATTLEANIMSTRUCT_0F
@@ -1520,7 +1522,7 @@ BattleAnimFunction_17:
Functioncd8ab:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
bit 7, [hl]
jr nz, .asm_cd8be
@@ -1534,7 +1536,7 @@ Functioncd8ab:
add hl, bc
ld [hl], $30
.asm_cd8c4
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $7f
@@ -1544,7 +1546,7 @@ Functioncd8cc:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld a, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld d, [hl]
call BattleAnim_Sine
@@ -1553,11 +1555,11 @@ Functioncd8cc:
ld [hl], a
bit 7, a
jr nz, .asm_cd8e6
- ld a, $3d
+ ld a, BATTLEANIMFRAMESET_3D
jr .asm_cd8e8
.asm_cd8e6
- ld a, $3c
+ ld a, BATTLEANIMFRAMESET_3C
.asm_cd8e8
call ReinitBattleAnimFrameset
ld hl, BATTLEANIMSTRUCT_0F
@@ -1592,7 +1594,7 @@ Functioncd907:
inc hl
ld [hl], $0
Functioncd913:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_0F
@@ -1646,7 +1648,7 @@ BattleAnimFunction_19:
Functioncd961:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld [hl], $0
Functioncd96a:
@@ -1696,7 +1698,7 @@ Functioncd99a:
sra a
sra a
sra a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
add [hl]
ld hl, BATTLEANIMSTRUCT_YOFFSET
@@ -1713,7 +1715,7 @@ Functioncd99a:
ld a, [hl]
sub $8
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and a
@@ -1735,7 +1737,7 @@ Functioncd99a:
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld [hl], a
ld hl, BATTLEANIMSTRUCT_XOFFSET
@@ -1767,7 +1769,7 @@ BattleAnimFunction_1C:
ret
.asm_cda17
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
@@ -1797,7 +1799,8 @@ Functioncda3a:
ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
add hl, bc
ld a, [hl]
- inc a
+ inc a ; BATTLEANIMFRAMESET_53
+ ; BATTLEANIMFRAMESET_55
call ReinitBattleAnimFrameset
call BattleAnim_IncAnonJumptableIndex
ld hl, BATTLEANIMSTRUCT_0F
@@ -1870,7 +1873,7 @@ Functioncda8d:
ld hl, BATTLEANIMSTRUCT_XCOORD
add hl, bc
ld d, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld h, [hl]
ld a, h
@@ -2044,7 +2047,7 @@ Functioncdb9f:
ld [hl], $28
inc hl
ld [hl], $10
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX
@@ -2235,7 +2238,7 @@ BattleAnimFunction_1E:
ret
.asm_cdcb6
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld d, [hl]
ld hl, BATTLEANIMSTRUCT_YOFFSET
@@ -2255,7 +2258,7 @@ Functioncdcca:
ldh a, [hBattleTurn]
and a
jr z, .asm_cdcd9
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
xor $ff
@@ -2266,10 +2269,10 @@ Functioncdcca:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], $8
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, BATTLEANIMFRAMESET_59
- add [hl]
+ add [hl] ; BATTLEANIMFRAMESET_5A BATTLEANIMFRAMESET_5B
call ReinitBattleAnimFrameset
ret
@@ -2299,7 +2302,7 @@ Functioncdcfe:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and a
@@ -2328,25 +2331,25 @@ BattleAnimFunction_22:
Functioncdd31:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $3f
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $80
rlca
ld [hl], a
- add BATTLEANIMFRAMESET_5D
+ add BATTLEANIMFRAMESET_5D ; BATTLEANIMFRAMESET_5E
call ReinitBattleAnimFrameset
ret
Functioncdd4f:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
swap a
@@ -2402,22 +2405,23 @@ Functioncdd97:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $80
rlca
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
- add [hl]
+ add [hl] ; BATTLEANIMFRAMESET_61 BATTLEANIMFRAMESET_62
+ ; BATTLEANIMFRAMESET_9C BATTLEANIMFRAMESET_9D
call ReinitBattleAnimFrameset
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $7f
ld [hl], a
Functioncddbc:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $10
@@ -2435,7 +2439,7 @@ Functioncddbc:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -2446,13 +2450,15 @@ Functioncddbc:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld a, [hl]
- inc a
+ inc a ; BATTLEANIMFRAMESET_62
+ ; BATTLEANIMFRAMESET_9D
jr .asm_cddf5
.asm_cddf0
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
- ld a, [hl]
+ ld a, [hl] ; BATTLEANIMFRAMESET_61
+ ; BATTLEANIMFRAMESET_9C
.asm_cddf5
call ReinitBattleAnimFrameset
ret
@@ -2466,12 +2472,12 @@ BattleAnimFunction_24:
Functioncde02:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
- add BATTLEANIMFRAMESET_63
+ add BATTLEANIMFRAMESET_63 ; BATTLEANIMFRAMESET_64 BATTLEANIMFRAMESET_65
call ReinitBattleAnimFrameset
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld e, [hl]
ld d, 0
@@ -2544,7 +2550,7 @@ BattleAnimFunction_27:
Functioncde72:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and a
@@ -2553,7 +2559,7 @@ Functioncde72:
add hl, bc
set 6, [hl]
.asm_cde83
- add BATTLEANIMFRAMESET_6A
+ add BATTLEANIMFRAMESET_6A ; BATTLEANIMFRAMESET_6B BATTLEANIMFRAMESET_6C
call ReinitBattleAnimFrameset
Functioncde88:
ret
@@ -2569,7 +2575,7 @@ Functioncde90:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], $0
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld e, [hl]
ld a, e
@@ -2606,7 +2612,7 @@ Functioncdebf:
ret
.asm_cdec9
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_0F
@@ -2739,7 +2745,7 @@ Functioncdf60:
ret
BattleAnimFunction_34:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $18
@@ -2761,7 +2767,7 @@ BattleAnimFunction_34:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
inc [hl]
inc [hl]
@@ -2781,7 +2787,7 @@ BattleAnimFunction_34:
ret
BattleAnimFunction_3C:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $18
@@ -2803,7 +2809,7 @@ BattleAnimFunction_3C:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
inc [hl]
inc [hl]
@@ -2889,7 +2895,7 @@ BattleAnimFunction_Horn:
dw .two
dw Functionce09e
.zero:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX
@@ -2955,7 +2961,7 @@ BattleAnimFunction_2C:
dw Functionce0dd
Functionce0ce:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f0
@@ -2992,7 +2998,7 @@ Functionce0f8:
ret
.asm_ce105
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
call Functionce70a
@@ -3028,7 +3034,7 @@ Functionce12a:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld a, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
and [hl]
jr nz, .asm_ce149
@@ -3050,7 +3056,7 @@ Functionce12a:
ret
BattleAnimFunction_2F:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_0F
@@ -3068,7 +3074,7 @@ BattleAnimFunction_2F:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
inc [hl]
ld a, [hl]
@@ -3078,7 +3084,7 @@ BattleAnimFunction_2F:
add hl, bc
dec [hl]
.asm_ce189
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $3
@@ -3109,7 +3115,7 @@ BattleAnimFunction_2F:
ret
BattleAnimFunction_42:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -3162,7 +3168,7 @@ Functionce1ee:
add hl, bc
ld [hl], a
Functionce1fb:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $30
@@ -3173,7 +3179,7 @@ Functionce1fb:
ld hl, BATTLEANIMSTRUCT_YCOORD
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
add $8
@@ -3182,7 +3188,7 @@ Functionce1fb:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
inc [hl]
ret
@@ -3195,7 +3201,7 @@ BattleAnimFunction_31:
Functionce22d:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $10
@@ -3203,7 +3209,7 @@ Functionce22d:
ld hl, BATTLEANIMSTRUCT_YOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $10
@@ -3303,7 +3309,7 @@ Unknown_ce2c8:
db $ff, $ff, $00, $00
BattleAnimFunction_33:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $18
@@ -3317,7 +3323,7 @@ BattleAnimFunction_33:
ld hl, BATTLEANIMSTRUCT_YOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -3413,14 +3419,14 @@ BattleAnimFunction_37:
Functionce366:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $7f
- add BATTLEANIMFRAMESET_81
+ add BATTLEANIMFRAMESET_81 ; BATTLEANIMFRAMESET_82 BATTLEANIMFRAMESET_83
call ReinitBattleAnimFrameset
Functionce375:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
bit 7, [hl]
jr nz, .asm_ce383
@@ -3498,7 +3504,7 @@ BattleAnimFunction_3A:
ret
.asm_ce3df
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $8
@@ -3506,7 +3512,7 @@ BattleAnimFunction_3A:
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
add $2
@@ -3525,7 +3531,7 @@ BattleAnimFunction_3B:
dw Functionce412
Functionce406:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_XCOORD
@@ -3539,7 +3545,7 @@ Functionce412:
ret
BattleAnimFunction_3D:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld d, $18
@@ -3556,7 +3562,7 @@ BattleAnimFunction_3D:
add hl, bc
sra a
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -3574,15 +3580,16 @@ Functionce443:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld [hl], $28
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f
ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
add hl, bc
- add [hl]
+ add [hl] ; BATTLEANIMFRAMESET_8F BATTLEANIMFRAMESET_90 BATTLEANIMFRAMESET_91
+ ; BATTLEANIMFRAMESET_93 BATTLEANIMFRAMESET_94 BATTLEANIMFRAMESET_95
call ReinitBattleAnimFrameset
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and $f0
@@ -3597,7 +3604,7 @@ Functionce465:
dec [hl]
add $8
ld d, a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
push af
@@ -3635,10 +3642,10 @@ BattleAnimFunction_40:
Functionce4a3:
call BattleAnim_IncAnonJumptableIndex
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, BATTLEANIMFRAMESET_24
- add [hl]
+ add [hl] ; BATTLEANIMFRAMESET_25 BATTLEANIMFRAMESET_26
call ReinitBattleAnimFrameset
Functionce4b0:
ld hl, BATTLEANIMSTRUCT_YOFFSET
@@ -3671,7 +3678,7 @@ Functionce4b0:
ret
BattleAnimFunction_41:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and a
@@ -3695,7 +3702,7 @@ BattleAnimFunction_41:
ld a, [hl]
and $1f
ret nz
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
srl [hl]
ret
@@ -3709,7 +3716,7 @@ BattleAnimFunction_43:
inc [hl]
inc [hl]
ld d, a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
push af
@@ -3731,7 +3738,7 @@ BattleAnimFunction_43:
ret
BattleAnimFunction_44:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld e, [hl]
ld hl, BATTLEANIMSTRUCT_0F
@@ -3768,7 +3775,7 @@ BattleAnimFunction_45:
Functionce564:
ld d, $18
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -3788,7 +3795,7 @@ Functionce577:
ld d, a
add $8
ld [hl], a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
jr asm_ce58f
@@ -3830,7 +3837,7 @@ Functionce5b3:
BattleAnimFunction_47:
ld d, $50
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -3880,7 +3887,7 @@ BattleAnimFunction_49:
dw Functionce618
Functionce5f9:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
and a
@@ -3929,7 +3936,7 @@ BattleAnimFunction_4A:
dw Functionce672
Functionce63a:
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX
@@ -3995,7 +4002,7 @@ BattleAnimFunction_4B:
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld e, [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
ld l, a
@@ -4021,7 +4028,7 @@ BattleAnimFunction_4B:
BattleAnimFunction_4C:
ld d, $18
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld a, [hl]
inc [hl]
@@ -4035,7 +4042,7 @@ BattleAnimFunction_4F:
ld a, [hl]
inc [hl]
srl a
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
add [hl]
call Functionce6f1
@@ -4048,7 +4055,7 @@ BattleAnimFunction_4D:
cp $20
jr nc, .asm_ce6ed
inc [hl]
- ld hl, BATTLEANIMSTRUCT_0B
+ ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld d, [hl]
call BattleAnim_Sine
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm
index 981491547..dcfe6ae22 100644
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -480,7 +480,7 @@ endr
ld a, [hl]
ld [de], a
pop hl
- ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH
add hl, bc
pop de
dec d
diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm
index 517b0e48e..0e4c9d04a 100644
--- a/engine/events/battle_tower/load_trainer.asm
+++ b/engine/events/battle_tower/load_trainer.asm
@@ -7,7 +7,7 @@ Function_LoadOpponentTrainerAndPokemons:
; Fill wBT_OTTrainer with zeros
xor a
ld hl, wBT_OTTrainer
- ld bc, wBT_OTTrainerEnd - wBT_OTTrainer
+ ld bc, BATTLE_TOWER_STRUCT_LENGTH
call ByteFill
; Write $ff into the Item-Slots
@@ -104,7 +104,7 @@ Function_LoadRandomBattleTowerMon:
ld a, [wBTChoiceOfLvlGroup]
dec a
ld hl, BattleTowerMons
- ld bc, BattleTowerMons2 - BattleTowerMons1 ; size of one level group
+ ld bc, BATTLETOWER_NUM_UNIQUE_MON * NICKNAMED_MON_STRUCT_LENGTH
call AddNTimes
ldh a, [hRandomAdd]
@@ -122,7 +122,7 @@ Function_LoadRandomBattleTowerMon:
; Check if mon was already loaded before
; Check current and the 2 previous teams
; includes check if item is double at the current team
- ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH
call AddNTimes
ld a, [hli]
ld b, a
@@ -165,13 +165,13 @@ Function_LoadRandomBattleTowerMon:
cp b
jr z, .FindARandomBattleTowerMon
- ld bc, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH
call CopyBytes
ld a, [wNamedObjectIndexBuffer]
push af
push de
- ld hl, - (PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH)
+ ld hl, -NICKNAMED_MON_STRUCT_LENGTH
add hl, de
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
diff --git a/engine/events/checksave.asm b/engine/events/checksave.asm
index 1e9d18e71..67efaf9e3 100644
--- a/engine/events/checksave.asm
+++ b/engine/events/checksave.asm
@@ -1,5 +1,5 @@
CheckSave::
- ld a, BANK(sCheckValue1) ; BANK(sCheckValue2)
+ ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
call GetSRAMBank
ld a, [sCheckValue1]
ld b, a
diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm
index 0b6b2b203..6162378a9 100644
--- a/engine/events/map_name_sign.asm
+++ b/engine/events/map_name_sign.asm
@@ -242,7 +242,7 @@ PlaceMapNameFrame:
ret
.FillTopBottom:
- ld c, 5
+ ld c, (SCREEN_WIDTH - 2) / 4 + 1
jr .enterloop
.continueloop
diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm
index 6e14e33d9..0a8dbef29 100644
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -1,7 +1,7 @@
NUM_MOM_ITEMS_1 EQUS "((MomItems_1.End - MomItems_1) / 8)"
NUM_MOM_ITEMS_2 EQUS "((MomItems_2.End - MomItems_2) / 8)"
-const_value = 1
+ const_def 1
const MOM_ITEM
const MOM_DOLL
diff --git a/engine/events/odd_egg.asm b/engine/events/odd_egg.asm
index 74b971806..a6ca15b8c 100644
--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -39,11 +39,13 @@ _GiveOddEgg:
.done
ld hl, OddEggs
- ld a, OddEgg1End - OddEgg1
+ ld a, NICKNAMED_MON_STRUCT_LENGTH
call AddNTimes
- ld de, wOddEggSpecies
- ld bc, PARTYMON_STRUCT_LENGTH + 2 * MON_NAME_LENGTH
+ ; Writes to wOddEgg, wOddEggName, and wOddEggOTName,
+ ; even though OddEggs does not have data for wOddEggOTName
+ ld de, wOddEgg
+ ld bc, NICKNAMED_MON_STRUCT_LENGTH + NAME_LENGTH
call CopyBytes
ld a, EGG_TICKET
@@ -64,10 +66,10 @@ _GiveOddEgg:
ld [wMobileMonSpeciesPointerBuffer], a
ld a, HIGH(wMobileMonSpeciesBuffer - 1)
ld [wMobileMonSpeciesPointerBuffer + 1], a
- ; load pointer to wOddEggSpecies in wMobileMonStructurePointerBuffer
- ld a, LOW(wOddEggSpecies)
+ ; load pointer to wOddEgg in wMobileMonStructurePointerBuffer
+ ld a, LOW(wOddEgg)
ld [wMobileMonStructurePointerBuffer], a
- ld a, HIGH(wOddEggSpecies)
+ ld a, HIGH(wOddEgg)
ld [wMobileMonStructurePointerBuffer + 1], a
; load Odd Egg Name in wTempOddEggNickname
diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm
index f6bbd18d2..4dfebb9b0 100644
--- a/engine/games/unown_puzzle.asm
+++ b/engine/games/unown_puzzle.asm
@@ -14,8 +14,8 @@ _UnownPuzzle:
xor a
ldh [hBGMapMode], a
call DisableLCD
- ld hl, wc608 ; includes wPuzzlePieces
- ld bc, wc7e8 - wc608
+ ld hl, wUnownPuzzle ; includes wPuzzlePieces
+ ld bc, wUnownPuzzleEnd - wUnownPuzzle
xor a
call ByteFill
ld hl, UnownPuzzleCursorGFX
diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm
index 6d8b52d44..88dc1f6d9 100644
--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -892,12 +892,12 @@ GetMonAnimPointer:
call PokeAnim_IsEgg
jr z, .egg
- ld c, BANK(UnownAnimations)
+ ld c, BANK(UnownAnimationPointers) ; aka BANK(UnownAnimationIdlePointers)
ld hl, UnownAnimationPointers
ld de, UnownAnimationIdlePointers
call PokeAnim_IsUnown
jr z, .unown
- ld c, BANK(PicAnimations)
+ ld c, BANK(AnimationPointers) ; aka BANK(AnimationIdlePointers)
ld hl, AnimationPointers
ld de, AnimationIdlePointers
.unown
diff --git a/engine/gfx/player_gfx.asm b/engine/gfx/player_gfx.asm
index cd1aca9d3..bd0fd0ce7 100644
--- a/engine/gfx/player_gfx.asm
+++ b/engine/gfx/player_gfx.asm
@@ -111,7 +111,7 @@ GetCardPic:
.GotClass:
ld de, vTiles2 tile $00
ld bc, $23 tiles
- ld a, BANK(ChrisCardPic) ; BANK(KrisCardPic)
+ ld a, BANK(ChrisCardPic) ; aka BANK(KrisCardPic)
call FarCopyBytes
ld hl, CardGFX
ld de, vTiles2 tile $23
@@ -165,7 +165,7 @@ HOF_LoadTrainerFrontpic:
.GotPic:
ld hl, vTiles2
- ld b, BANK(ChrisPic) ; BANK(KrisPic)
+ ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
ld c, 7 * 7
call Get2bpp
call WaitBGMap
@@ -194,7 +194,7 @@ DrawIntroPlayerPic:
ld de, KrisPic
.GotPic:
ld hl, vTiles2
- ld b, BANK(ChrisPic) ; BANK(KrisPic)
+ ld b, BANK(ChrisPic) ; aka BANK(KrisPic)
ld c, 7 * 7 ; dimensions
call Get2bpp
diff --git a/engine/menus/debug.asm b/engine/menus/debug.asm
index 4b951ae8d..4c8c5edc8 100644
--- a/engine/menus/debug.asm
+++ b/engine/menus/debug.asm
@@ -101,22 +101,22 @@ Function81911:
ret
Function81928:
- ld a, BANK(PokemonPalettes) ; BANK(TrainerPalettes)
+ ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
inc hl
- ld a, BANK(PokemonPalettes) ; BANK(TrainerPalettes)
+ ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
inc hl
- ld a, BANK(PokemonPalettes) ; BANK(TrainerPalettes)
+ ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
inc hl
- ld a, BANK(PokemonPalettes) ; BANK(TrainerPalettes)
+ ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
diff --git a/engine/menus/save.asm b/engine/menus/save.asm
index a5ddfae47..34b38a25b 100644
--- a/engine/menus/save.asm
+++ b/engine/menus/save.asm
@@ -462,7 +462,7 @@ HallOfFame_InitSaveIfNeeded:
ret
ValidateSave:
- ld a, BANK(sCheckValue1) ; BANK(sCheckValue2)
+ ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
call GetSRAMBank
ld a, SAVE_CHECK_VALUE_1
ld [sCheckValue1], a
@@ -524,7 +524,7 @@ SaveChecksum:
ret
ValidateBackupSave:
- ld a, BANK(sBackupCheckValue1) ; BANK(sBackupCheckValue2)
+ ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2)
call GetSRAMBank
ld a, SAVE_CHECK_VALUE_1
ld [sBackupCheckValue1], a
@@ -677,7 +677,7 @@ TryLoadSaveData:
INCLUDE "data/default_options.asm"
CheckPrimarySaveFile:
- ld a, BANK(sCheckValue1) ; BANK(sCheckValue2)
+ ld a, BANK(sCheckValue1) ; aka BANK(sCheckValue2)
call GetSRAMBank
ld a, [sCheckValue1]
cp SAVE_CHECK_VALUE_1
@@ -698,7 +698,7 @@ CheckPrimarySaveFile:
ret
CheckBackupSaveFile:
- ld a, BANK(sBackupCheckValue1) ; BANK(sBackupCheckValue2)
+ ld a, BANK(sBackupCheckValue1) ; aka BANK(sBackupCheckValue2)
call GetSRAMBank
ld a, [sBackupCheckValue1]
cp SAVE_CHECK_VALUE_1
diff --git a/engine/movie/title.asm b/engine/movie/title.asm
index 26b30c3ee..a48b71e62 100644
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -208,7 +208,7 @@ _TitleScreen:
ldh [hBGMapMode], a
xor a
- ld [wd002], a
+ ld [wSuicuneFrame], a
; Play starting sound effect
call SFXChannelsOff
@@ -218,7 +218,7 @@ _TitleScreen:
ret
SuicuneFrameIterator:
- ld hl, wd002
+ ld hl, wSuicuneFrame
ld a, [hl]
ld c, a
inc [hl]
diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm
index e9fcc108c..ec81f1c27 100644
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -4,19 +4,20 @@ INCLUDE "constants.asm"
SECTION "Events", ROMX
OverworldLoop::
- xor a
+ xor a ; MAPSTATUS_START
ld [wMapStatus], a
.loop
ld a, [wMapStatus]
ld hl, .jumps
rst JumpTable
ld a, [wMapStatus]
- cp 3 ; done
+ cp MAPSTATUS_DONE
jr nz, .loop
.done
ret
.jumps
+; entries correspond to MAPSTATUS_* constants
dw StartMap
dw EnterMap
dw HandleMap
@@ -130,7 +131,7 @@ EnterMap:
xor a ; end map entry
ldh [hMapEntryMethod], a
- ld a, 2 ; HandleMap
+ ld a, MAPSTATUS_HANDLE
ld [wMapStatus], a
ret
@@ -147,7 +148,7 @@ HandleMap:
; Not immediately entering a connected map will cause problems.
ld a, [wMapStatus]
- cp 2 ; HandleMap
+ cp MAPSTATUS_HANDLE
ret nz
call HandleMapObjects
@@ -163,6 +164,7 @@ MapEvents:
ret
.jumps
+; entries correspond to MAPEVENTS_* constants
dw .events
dw .no_events
@@ -193,7 +195,7 @@ NextOverworldFrame:
HandleMapTimeAndJoypad:
ld a, [wMapEventStatus]
- cp 1 ; no events
+ cp MAPEVENTS_OFF
ret z
call UpdateTime
@@ -215,26 +217,26 @@ HandleMapBackground:
CheckPlayerState:
ld a, [wPlayerStepFlags]
- bit 5, a ; in the middle of step
+ bit PLAYERSTEP_CONTINUE_F, a
jr z, .events
- bit 6, a ; stopping step
+ bit PLAYERSTEP_STOP_F, a
jr z, .noevents
- bit 4, a ; in midair
+ bit PLAYERSTEP_MIDAIR_F, a
jr nz, .noevents
call EnableEvents
.events
- ld a, 0 ; events
+ ld a, MAPEVENTS_ON
ld [wMapEventStatus], a
ret
.noevents
- ld a, 1 ; no events
+ ld a, MAPEVENTS_OFF
ld [wMapEventStatus], a
ret
_CheckObjectEnteringVisibleRange:
ld hl, wPlayerStepFlags
- bit 6, [hl]
+ bit PLAYERSTEP_STOP_F, [hl]
ret z
farcall CheckObjectEnteringVisibleRange
ret
diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm
index 02b9cbdda..26152625d 100644
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -36,7 +36,7 @@ Function437b:
.CheckObjectStillVisible:
ld hl, OBJECT_FLAGS2
add hl, bc
- res 6, [hl]
+ res OBJ_FLAGS2_6, [hl]
ld a, [wXCoord]
ld e, a
ld hl, OBJECT_NEXT_MAP_X
@@ -62,7 +62,7 @@ Function437b:
.ok
ld hl, OBJECT_FLAGS2
add hl, bc
- set 6, [hl]
+ set OBJ_FLAGS2_6, [hl]
ld a, [wXCoord]
ld e, a
ld hl, OBJECT_INIT_X
@@ -99,7 +99,7 @@ Function437b:
.yes2
ld hl, OBJECT_FLAGS2
add hl, bc
- set 6, [hl]
+ set OBJ_FLAGS2_6, [hl]
and a
ret
@@ -111,7 +111,7 @@ Function437b:
jr z, .zero
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 5, [hl]
+ bit OBJ_FLAGS2_5, [hl]
jr nz, .bit5
cp STEP_TYPE_SLEEP
jr z, .one
@@ -121,7 +121,7 @@ Function437b:
call ObjectMovementReset
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 5, [hl]
+ bit OBJ_FLAGS2_5, [hl]
jr nz, .bit5
.one
call MapObjectMovementPattern
@@ -147,9 +147,9 @@ Function437b:
jr nz, SetFacingStanding
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 6, [hl]
+ bit OBJ_FLAGS2_6, [hl]
jr nz, SetFacingStanding
- bit 5, [hl]
+ bit OBJ_FLAGS2_5, [hl]
jr nz, asm_4448
ld de, ObjectActionPairPointers ; use first column
jr _HandleObjectAction
@@ -399,7 +399,7 @@ UpdatePlayerStep:
add e
ld [wPlayerStepVectorY], a
ld hl, wPlayerStepFlags
- set 5, [hl]
+ set PLAYERSTEP_CONTINUE_F, [hl]
ret
Unreferenced_Function4759:
@@ -657,8 +657,8 @@ MapObjectMovementPattern:
jr z, .on_pit
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 2, [hl]
- res 2, [hl]
+ bit OBJ_FLAGS2_2, [hl]
+ res OBJ_FLAGS2_2, [hl]
jr z, .ok
ld hl, OBJECT_RANGE
add hl, bc
@@ -1124,7 +1124,7 @@ NPCJump:
call GetNextTile
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD_F, [hl]
call IncrementObjectStructField1c
ret
@@ -1151,7 +1151,7 @@ PlayerJump:
.initjump
ld hl, wPlayerStepFlags
- set 7, [hl]
+ set PLAYERSTEP_START_F, [hl]
call IncrementObjectStructField1c
.stepjump
call UpdateJumpPosition
@@ -1163,17 +1163,17 @@ PlayerJump:
call CopyNextCoordsTileToStandingCoordsTile
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD_F, [hl]
ld hl, wPlayerStepFlags
- set 6, [hl]
- set 4, [hl]
+ set PLAYERSTEP_STOP_F, [hl]
+ set PLAYERSTEP_MIDAIR_F, [hl]
call IncrementObjectStructField1c
ret
.initland
call GetNextTile
ld hl, wPlayerStepFlags
- set 7, [hl]
+ set PLAYERSTEP_START_F, [hl]
call IncrementObjectStructField1c
.stepland
call UpdateJumpPosition
@@ -1183,7 +1183,7 @@ PlayerJump:
dec [hl]
ret nz
ld hl, wPlayerStepFlags
- set 6, [hl]
+ set PLAYERSTEP_STOP_F, [hl]
call CopyNextCoordsTileToStandingCoordsTile
ld hl, OBJECT_STEP_TYPE
add hl, bc
@@ -1229,7 +1229,7 @@ TeleportFrom:
ld [hl], 16
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD_F, [hl]
call IncrementObjectStructField1c
.DoSpinRise:
ld hl, OBJECT_ACTION
@@ -1559,7 +1559,7 @@ PlayerStep:
.init
ld hl, wPlayerStepFlags
- set 7, [hl]
+ set PLAYERSTEP_START_F, [hl]
call IncrementObjectStructField1c
.step
call UpdatePlayerStep
@@ -1568,7 +1568,7 @@ PlayerStep:
dec [hl]
ret nz
ld hl, wPlayerStepFlags
- set 6, [hl]
+ set PLAYERSTEP_STOP_F, [hl]
call CopyNextCoordsTileToStandingCoordsTile
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
@@ -1646,7 +1646,7 @@ StepType0f:
pop bc
ld hl, OBJECT_FLAGS2
add hl, bc
- res 2, [hl]
+ res OBJ_FLAGS2_2, [hl]
call CopyNextCoordsTileToStandingCoordsTile
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
@@ -2408,7 +2408,7 @@ HandleNPCStep::
ld [wPlayerStepVectorX], a
ld [wPlayerStepVectorY], a
ld [wPlayerStepFlags], a
- ld a, -1
+ ld a, STANDING
ld [wPlayerStepDirection], a
ret
@@ -2558,7 +2558,7 @@ SetFlagsForMovement_1::
pop bc
ld hl, OBJECT_FLAGS2
add hl, bc
- res 5, [hl]
+ res OBJ_FLAGS2_5, [hl]
xor a
ret
@@ -2567,7 +2567,7 @@ Function586e:
ret c
ld hl, OBJECT_FLAGS2
add hl, bc
- set 5, [hl]
+ set OBJ_FLAGS2_5, [hl]
xor a
ret
@@ -2580,7 +2580,7 @@ Function587a:
jr z, .next
ld hl, OBJECT_FLAGS2
add hl, bc
- set 5, [hl]
+ set OBJ_FLAGS2_5, [hl]
.next
ld hl, OBJECT_STRUCT_LENGTH
add hl, bc
@@ -2610,7 +2610,7 @@ _SetFlagsForMovement_2::
call GetObjectStruct
ld hl, OBJECT_FLAGS2
add hl, bc
- res 5, [hl]
+ res OBJ_FLAGS2_5, [hl]
ret
Function58b9::
@@ -2623,7 +2623,7 @@ Function58b9::
jr z, .next
ld hl, OBJECT_FLAGS2
add hl, bc
- res 5, [hl]
+ res OBJ_FLAGS2_5, [hl]
.next
ld hl, OBJECT_STRUCT_LENGTH
add hl, bc
@@ -2641,7 +2641,7 @@ Function58d8:
ret c
ld hl, OBJECT_FLAGS2
add hl, bc
- res 5, [hl]
+ res OBJ_FLAGS2_5, [hl]
ret
Function58e3:
@@ -2865,7 +2865,7 @@ InitSprites:
ld hl, OBJECT_FLAGS2
add hl, bc
ld e, [hl]
- bit 7, e
+ bit OBJ_FLAGS2_7, e
jr z, .skip2
or PRIORITY
.skip2
diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm
index ab9770ee5..e47645f2c 100644
--- a/engine/overworld/overworld.asm
+++ b/engine/overworld/overworld.asm
@@ -594,7 +594,7 @@ endr
jr c, .done
ld a, h
- add $8
+ add HIGH(vTiles1 - vTiles0)
ld h, a
call .CopyToVram
diff --git a/engine/overworld/player_step.asm b/engine/overworld/player_step.asm
index 797c4b12a..eb1e88cf4 100644
--- a/engine/overworld/player_step.asm
+++ b/engine/overworld/player_step.asm
@@ -2,11 +2,11 @@ _HandlePlayerStep::
ld a, [wPlayerStepFlags]
and a
ret z
- bit 7, a ; starting step
+ bit PLAYERSTEP_START_F, a
jr nz, .update_overworld_map
- bit 6, a ; finishing step
+ bit PLAYERSTEP_STOP_F, a
jr nz, .update_player_coords
- bit 5, a ; ongoing step
+ bit PLAYERSTEP_CONTINUE_F, a
jr nz, .finish
ret
diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm
index 5b72bd83d..f500d3c0e 100644
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -511,7 +511,7 @@ Script_verbosegiveitem:
call Script_giveitem
call CurItemName
ld de, wStringBuffer1
- ld a, 1
+ ld a, MEM_BUFFER_1
call CopyConvertedText
ld b, BANK(GiveItemScript)
ld de, GiveItemScript
@@ -544,7 +544,7 @@ Script_verbosegiveitem2:
; parameters: item, var
call GetScriptByte
- cp -1
+ cp ITEM_FROM_MEM
jr nz, .ok
ld a, [wScriptVar]
.ok
@@ -562,7 +562,7 @@ Script_verbosegiveitem2:
ld [wScriptVar], a
call CurItemName
ld de, wStringBuffer1
- ld a, 1
+ ld a, MEM_BUFFER_1
call CopyConvertedText
ld b, BANK(GiveItemScript)
ld de, GiveItemScript
@@ -1222,7 +1222,7 @@ Script_loademote:
; parameters: bubble
call GetScriptByte
- cp -1
+ cp EMOTE_FROM_MEM
jr nz, .not_var_emote
ld a, [wScriptVar]
.not_var_emote
@@ -1249,7 +1249,7 @@ Script_showemote:
jp ScriptCall
ShowEmoteScript:
- loademote EMOTE_MEM
+ loademote EMOTE_FROM_MEM
applymovement2 .Show
pause 0
applymovement2 .Hide
@@ -1399,7 +1399,7 @@ Script_reloadmap:
ld [wBattleScriptFlags], a
ld a, MAPSETUP_RELOADMAP
ldh [hMapEntryMethod], a
- ld a, $1
+ ld a, MAPSTATUS_ENTER
call LoadMapStatus
call StopScript
ret
@@ -1454,7 +1454,7 @@ ScriptCall:
ld hl, wScriptStackSize
ld e, [hl]
inc [hl]
- ld d, $0
+ ld d, 0
ld hl, wScriptStack
add hl, de
add hl, de
@@ -2473,11 +2473,11 @@ Script_warp:
ld [wXCoord], a
call GetScriptByte
ld [wYCoord], a
- ld a, -1
+ ld a, SPAWN_N_A
ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_WARP
ldh [hMapEntryMethod], a
- ld a, 1
+ ld a, MAPSTATUS_ENTER
call LoadMapStatus
call StopScript
ret
@@ -2486,11 +2486,11 @@ Script_warp:
call GetScriptByte
call GetScriptByte
call GetScriptByte
- ld a, -1
+ ld a, SPAWN_N_A
ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_BADWARP
ldh [hMapEntryMethod], a
- ld a, 1
+ ld a, MAPSTATUS_ENTER
call LoadMapStatus
call StopScript
ret
@@ -2520,7 +2520,7 @@ Script_blackoutmod:
Script_dontrestartmapmusic:
; script command 0x83
- ld a, 1
+ ld a, TRUE
ld [wDontPlayMapMusicOnReload], a
ret
@@ -2547,7 +2547,7 @@ Script_delcmdqueue:
ld b, a
farcall DelCmdQueue ; no need to farcall
ret c
- ld a, 1
+ ld a, TRUE
ld [wScriptVar], a
ret
@@ -2611,7 +2611,7 @@ Script_newloadmap:
call GetScriptByte
ldh [hMapEntryMethod], a
- ld a, 1
+ ld a, MAPSTATUS_ENTER
call LoadMapStatus
call StopScript
ret
@@ -2793,7 +2793,7 @@ Script_credits:
farcall RedCredits
ReturnFromCredits:
call Script_endall
- ld a, $3
+ ld a, MAPSTATUS_DONE
call LoadMapStatus
call StopScript
ret
diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm
index 0f040a624..2630ad913 100644
--- a/engine/overworld/warp_connection.asm
+++ b/engine/overworld/warp_connection.asm
@@ -1,6 +1,6 @@
HandleNewMap:
- call Clearwc7e8
+ call ClearUnusedC7E8
call ResetMapBufferEventFlags
call ResetFlashIfOutOfCave
call GetCurrentMapSceneID
@@ -176,7 +176,7 @@ LoadWarpData:
; MOUNT_MOON_SQUARE and TIN_TOWER_ROOF are outdoor maps within indoor maps.
; Dig and Escape Rope should not take you to them.
ld a, [wPrevMapGroup]
- cp GROUP_MOUNT_MOON_SQUARE ; GROUP_TIN_TOWER_ROOF
+ cp GROUP_MOUNT_MOON_SQUARE ; aka GROUP_TIN_TOWER_ROOF
jr nz, .not_mt_moon_or_tin_tower
ld a, [wPrevMapNumber]
cp MAP_MOUNT_MOON_SQUARE
diff --git a/engine/phone/phone_gossip.asm b/engine/phone/phone_gossip.asm
deleted file mode 100644
index bf3da8d30..000000000
--- a/engine/phone/phone_gossip.asm
+++ /dev/null
@@ -1,698 +0,0 @@
-JackTriviaScript:
- random 11
- ifequal 0, .Thunder
- ifequal 1, .Rollout
- ifequal 2, .Solarbeam
- ifequal 3, .Stomp
- ifequal 4, .Gust
- ifequal 5, .Twister
- ifequal 6, .Earthquake
- ifequal 7, .Magnitude
- ifequal 8, .Sandstorm
- ifequal 9, .SunnyDay
- ifequal 10, .RainDance
-
-.Thunder:
- farwritetext JackThunderTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Rollout:
- farwritetext JackRolloutTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Solarbeam:
- farwritetext JackSolarbeamTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Stomp:
- farwritetext JackStompTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Gust:
- farwritetext JackGustTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Twister:
- farwritetext JackTwisterTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Earthquake:
- farwritetext JackEarthquakeTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Magnitude:
- farwritetext JackMagnitudeTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Sandstorm:
- farwritetext JackSandstormTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.SunnyDay:
- farwritetext JackSunnyDayTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.RainDance:
- farwritetext JackRainDanceTriviaText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa06da:
- random 10
- ifequal 0, .RuinsOfAlph
- ifequal 1, .Falkner
- ifequal 2, .Earl
- ifequal 3, .SurfPikachu
- ifequal 4, .MooMooMilk
- ifequal 5, .Salon
- ifequal 6, .Whitney
- ifequal 7, .BugCatchingContest
- ifequal 8, .BeautifulMon
- ifequal 9, .Forgot
-
-.RuinsOfAlph:
- farwritetext UnknownText_0x176223
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.Falkner:
- farwritetext UnknownText_0x1762c3
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.Earl:
- farwritetext UnknownText_0x17638a
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.SurfPikachu:
- farwritetext UnknownText_0x176424
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.MooMooMilk:
- farwritetext UnknownText_0x1764eb
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.Salon:
- farwritetext UnknownText_0x176599
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.Whitney:
- farwritetext UnknownText_0x1766ac
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.BugCatchingContest:
- farwritetext UnknownText_0x17674f
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.BeautifulMon:
- farwritetext UnknownText_0x176816
- buttonsound
- jump PhoneScript_HangupText_Female
-
-.Forgot:
- farwritetext UnknownText_0x17686d
- buttonsound
- jump PhoneScript_HangupText_Female
-
-ChadOakGossipScript:
- random 10
- ifequal 0, .Blue
- ifequal 1, .Daisy
- ifequal 2, .ProfElm
- ifequal 3, .Dream
- ifequal 4, .Kurt
- ifequal 5, .League
- ifequal 6, .RadioShow
- ifequal 7, .Battling
- ifequal 8, .DaisyTea
- ifequal 9, .Traveled
-
-.Blue:
- farwritetext ChadBlueGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Daisy:
- farwritetext ChadDaisyGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.ProfElm:
- farwritetext ChadProfElmGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Dream:
- farwritetext ChadDreamGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Kurt:
- farwritetext ChadKurtGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.League:
- farwritetext ChadLeagueGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.RadioShow:
- farwritetext ChadRadioShowGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Battling:
- farwritetext ChadBattlingGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.DaisyTea:
- farwritetext ChadDaisyTeaGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Traveled:
- farwritetext ChadTravelGossipText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-BrentBillTriviaScript:
- random 10
- ifequal 0, .Father
- ifequal 1, .Grandpa
- ifequal 2, .Goldenrod
- ifequal 3, .Route25
- ifequal 4, .Abra
- ifequal 5, .Sister
- ifequal 6, .Milk
- ifequal 7, .Battling
- ifequal 8, .FlowerShop
- ifequal 9, .KimonoGirl
-
-.Father:
- farwritetext UnknownText_0x662bc
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Grandpa:
- farwritetext UnknownText_0x662fc
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Goldenrod:
- farwritetext UnknownText_0x66335
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Route25:
- farwritetext UnknownText_0x66366
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Abra:
- farwritetext UnknownText_0x663a1
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Sister:
- farwritetext UnknownText_0x663e6
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Milk:
- farwritetext UnknownText_0x66421
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Battling:
- farwritetext UnknownText_0x6645f
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.FlowerShop:
- farwritetext UnknownText_0x6649b
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.KimonoGirl:
- farwritetext UnknownText_0x664dd
- buttonsound
- jump PhoneScript_HangupText_Male
-
-IrwinRumorScript:
- checkevent EVENT_OPENED_MT_SILVER
- iftrue .MtSilver
- checkevent EVENT_FOUGHT_SNORLAX
- iftrue .Snorlax
- checkevent EVENT_GOT_PASS_FROM_COPYCAT
- iftrue .TrainPass
- checkflag ENGINE_MARSHBADGE
- iftrue .MarshBadge
- checkflag ENGINE_FLYPOINT_VERMILION
- iftrue .VermilionCity
- checkevent EVENT_BEAT_ELITE_FOUR
- iftrue .EliteFour
- checkflag ENGINE_RISINGBADGE
- iftrue .RisingBadge
- checkevent EVENT_CLEARED_RADIO_TOWER
- iftrue .RadioTower
- checkevent EVENT_CLEARED_ROCKET_HIDEOUT
- iftrue .RocketHideout
- checkevent EVENT_JASMINE_RETURNED_TO_GYM
- iftrue .JasmineReturned
- checkflag ENGINE_FOGBADGE
- iftrue .FogBadge
- checkflag ENGINE_PLAINBADGE
- iftrue .PlainBadge
- farwritetext IrwinCalledRightAwayText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.PlainBadge:
- farwritetext UnknownText_0x64099
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.JasmineReturned:
- farwritetext UnknownText_0x640e6
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.RocketHideout:
- farwritetext UnknownText_0x6416d
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.RadioTower:
- farwritetext UnknownText_0x641e8
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.RisingBadge:
- farwritetext UnknownText_0x64247
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.EliteFour:
- farwritetext UnknownText_0x642bb
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.VermilionCity:
- farwritetext UnknownText_0x643d4
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.TrainPass:
- farwritetext UnknownText_0x64448
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Snorlax:
- farwritetext UnknownText_0x6455b
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.MtSilver:
- farwritetext UnknownText_0x645ff
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.FogBadge:
- farwritetext UnknownText_0x646df
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.MarshBadge:
- farwritetext UnknownText_0x647d8
- buttonsound
- jump PhoneScript_HangupText_Male
-
-JackPhoneTips:
- farwritetext UnknownText_0x1745c2
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0900:
- farwritetext UnknownText_0x17485b
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0908:
- farwritetext UnknownText_0x17496b
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0910:
- farwritetext UnknownText_0x174c29
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0918:
- farwritetext UnknownText_0x174ec5
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0920:
- farwritetext UnknownText_0x17519b
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0928:
- farwritetext UnknownText_0x17549b
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0930:
- farwritetext UnknownText_0x17571d
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0938:
- farwritetext UnknownText_0x175abe
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0940:
- farwritetext UnknownText_0x175eaf
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0948:
- farwritetext UnknownText_0x1768b0
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0950:
- farwritetext UnknownText_0x176d32
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0958:
- farwritetext UnknownText_0x1770fb
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0960:
- farwritetext UnknownText_0x177465
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0968:
- farwritetext UnknownText_0x64bc6
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0970:
- farwritetext UnknownText_0x64e90
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0978:
- farwritetext UnknownText_0x65161
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0980:
- farwritetext UnknownText_0x65a23
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0988:
- farwritetext UnknownText_0x65d5c
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0990:
- farwritetext UnknownText_0x65ff2
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0998:
- farwritetext UnknownText_0x6651e
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa09a0:
- farwritetext UnknownText_0x66882
- buttonsound
- jump PhoneScript_HangupText_Female
-
-VanceLookingForward:
- farwritetext VanceLookingForwardText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-WiltonHaventFoundAnything:
- farwritetext WiltonHaventFoundAnythingText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-ParryBattleWithMe:
- farwritetext ParryBattleWithMeText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-ErinWorkingHardScript:
- farwritetext ErinWorkingHardText
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa09c8:
- random 3
- ifequal 0, UnknownScript_0xa09d6
- ifequal 1, UnknownScript_0xa09de
- ifequal 2, UnknownScript_0xa09e6
-
-UnknownScript_0xa09d6:
- farwritetext UnknownText_0x64846
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa09de:
- farwritetext UnknownText_0x64881
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa09e6:
- farwritetext UnknownText_0x648dc
- buttonsound
- jump PhoneScript_HangupText_Male
-
-KenjiAnswerPhoneScript:
- checkcode VAR_KENJI_BREAK
- ifequal 2, .Training
- ifequal 1, .OnBreak
- farwritetext UnknownText_0x66e17
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Training:
- farwritetext UnknownText_0x66e67
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.OnBreak:
- checktime MORN
- iftrue .Morning
- checktime NITE
- iftrue .Night
- setevent EVENT_KENJI_ON_BREAK
- farwritetext KenjiBreakText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Morning:
- farwritetext UnknownText_0x66ed3
- buttonsound
- jump PhoneScript_HangupText_Male
-
-.Night:
- farwritetext UnknownText_0x66f52
- buttonsound
- jump PhoneScript_HangupText_Male
-
-JackWantsBattleScript:
- farwritetext UnknownText_0x174638
- end
-
-HueyWantsBattleScript:
- farwritetext UnknownText_0x1749c7
- end
-
-UnknownScript_0xa0a37:
- farwritetext UnknownText_0x174c49
- end
-
-BethBattleReminderScript:
- farwritetext BethForgetDealText
- end
-
-UnknownScript_0xa0a41:
- farwritetext UnknownText_0x17520a
- end
-
-UnknownScript_0xa0a46:
- farwritetext UnknownText_0x1754e5
- end
-
-UnknownScript_0xa0a4b:
- farwritetext UnknownText_0x175786
- end
-
-UnknownScript_0xa0a50:
- farwritetext UnknownText_0x175b1e
- end
-
-UnknownScript_0xa0a55:
- farwritetext UnknownText_0x175f11
- end
-
-UnknownScript_0xa0a5a:
- farwritetext UnknownText_0x1769da
- end
-
-UnknownScript_0xa0a5f:
- farwritetext UnknownText_0x176d85
- end
-
-UnknownScript_0xa0a64:
- farwritetext UnknownText_0x177138
- end
-
-UnknownScript_0xa0a69:
- farwritetext UnknownText_0x1774c1
- end
-
-UnknownScript_0xa0a6e:
- farwritetext UnknownText_0x64c13
- end
-
-UnknownScript_0xa0a73:
- farwritetext UnknownText_0x64ed4
- end
-
-UnknownScript_0xa0a78:
- farwritetext UnknownText_0x651bf
- end
-
-UnknownScript_0xa0a7d:
- farwritetext UnknownText_0x65a63
- end
-
-UnknownScript_0xa0a82:
- farwritetext UnknownText_0x66043
- end
-
-UnknownScript_0xa0a87:
- farwritetext UnknownText_0x66579
- end
-
-UnknownScript_0xa0a8c:
- farwritetext UnknownText_0x668a3
- end
-
-VanceHurryHurry:
- farwritetext VanceHurryHurryText
- end
-
-WiltonNotBiting:
- farwritetext WiltonNotBitingText
- end
-
-ParryHaventYouGottenTo:
- farwritetext ParryHaventYouGottenToText
- end
-
-ErinComeBattleScript:
- farwritetext ErinComeBattleText
- end
-
-UnknownScript_0xa0aa5:
- farwritetext UnknownText_0x174895
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0aad:
- farwritetext UnknownText_0x17529c
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0ab5:
- farwritetext UnknownText_0x175b6d
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0abd:
- farwritetext UnknownText_0x17750e
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0ac5:
- farwritetext UnknownText_0x64f1a
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0acd:
- farwritetext UnknownText_0x6520f
- buttonsound
- jump PhoneScript_HangupText_Female
-
-UnknownScript_0xa0ad5:
- farwritetext UnknownText_0x65da6
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0add:
- farwritetext UnknownText_0x66087
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0ae5:
- farwritetext UnknownText_0x6691d
- buttonsound
- jump PhoneScript_HangupText_Female
-
-WiltonWantThis:
- farwritetext WiltonWantThisText
- buttonsound
- jump PhoneScript_HangupText_Male
-
-UnknownScript_0xa0af5:
- farwritetext UnknownText_0x175f70
- end
-
-UnknownScript_0xa0afa:
- farwritetext UnknownText_0x176dd1
- end
-
-UnknownScript_0xa0aff:
- farwritetext UnknownText_0x64c5a
- end
-
-UnknownScript_0xa0b04:
- farwritetext UnknownText_0x17717c
- end
-
-BikeShopPhoneScript:
- farwritetext UnknownText_0x174000
- clearflag ENGINE_BIKE_SHOP_CALL_ENABLED
- specialphonecall SPECIALCALL_NONE
- end
diff --git a/engine/phone/phone_scripts.asm b/engine/phone/phone_scripts.asm
deleted file mode 100644
index 4296b9023..000000000
--- a/engine/phone/phone_scripts.asm
+++ /dev/null
@@ -1,1885 +0,0 @@
-UnusedPhoneScript:
- farwritetext UnusedPhoneText
- end
-
-; Mom
-
-MomPhoneScript:
- checkevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
- iftrue .bcec5
- checkevent EVENT_DUDE_TALKED_TO_YOU
- iftrue MomPhoneLectureScript
- checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
- iftrue MomPhoneNoGymQuestScript
- checkevent EVENT_GOT_A_POKEMON_FROM_ELM
- iftrue MomPhoneNoPokedexScript
- jump MomPhoneNoPokemonScript
-
-.bcec5
- checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_8
- iftrue MomPhoneHangUpScript
- farwritetext MomPhoneGreetingText
- buttonsound
- mapnametotext MEM_BUFFER_0
- checkcode VAR_ROOFPALETTE
- ifequal 1, MomPhonePalette1
- ifequal 2, MomPhonePalette2
- jump MomPhoneOther
-
-MomPhoneLandmark:
- farwritetext MomPhoneLandmarkText
- buttonsound
- jump MomSavingMoney
-
-MomPhonePalette1:
- checkcode VAR_MAPGROUP
- ifequal GROUP_NEW_BARK_TOWN, .newbark
- ifequal GROUP_CHERRYGROVE_CITY, .cherrygrove
- ifequal GROUP_VIOLET_CITY, .violet
- ifequal GROUP_AZALEA_TOWN, .azalea
- ifequal GROUP_GOLDENROD_CITY, .goldenrod
- farwritetext MomPhoneGenericAreaText
- buttonsound
- jump MomSavingMoney
-
-.newbark
- farwritetext MomPhoneNewBarkText
- buttonsound
- jump MomSavingMoney
-
-.cherrygrove
- farwritetext MomPhoneCherrygroveText
- buttonsound
- jump MomSavingMoney
-
-.violet
- landmarktotext SPROUT_TOWER, MEM_BUFFER_1
- jump MomPhoneLandmark
-.azalea
- landmarktotext SLOWPOKE_WELL, MEM_BUFFER_1
- jump MomPhoneLandmark
-.goldenrod
- landmarktotext RADIO_TOWER, MEM_BUFFER_1
- jump MomPhoneLandmark
-
-MomPhonePalette2:
- farwritetext MomOtherAreaText
- buttonsound
- jump MomSavingMoney
-
-MomPhoneOther:
- farwritetext MomDeterminedText
- buttonsound
- jump MomSavingMoney
-
-MomSavingMoney:
- checkflag ENGINE_MOM_SAVING_MONEY
- iffalse .NotSaving
- checkmoney MOMS_MONEY, 0
- ifequal HAVE_MORE, .SavingHasMoney
- jump .SavingNoMoney
-
-.NotSaving:
- checkmoney MOMS_MONEY, 0
- ifequal HAVE_MORE, .HasMoney
- jump .NoMoney
-
-.SavingHasMoney:
- readmoney MOMS_MONEY, MEM_BUFFER_0
- farwritetext MomCheckBalanceText
- yesorno
- iftrue MomPhoneSaveMoneyScript
- jump MomPhoneWontSaveMoneyScript
-
-.SavingNoMoney:
- farwritetext MomImportantToSaveText
- yesorno
- iftrue MomPhoneSaveMoneyScript
- jump MomPhoneWontSaveMoneyScript
-
-.NoMoney:
- farwritetext MomYoureNotSavingText
- yesorno
- iftrue MomPhoneSaveMoneyScript
- jump MomPhoneWontSaveMoneyScript
-
-.HasMoney:
- readmoney MOMS_MONEY, MEM_BUFFER_0
- farwritetext MomYouveSavedText
- yesorno
- iftrue MomPhoneSaveMoneyScript
- jump MomPhoneWontSaveMoneyScript
-
-MomPhoneSaveMoneyScript:
- setflag ENGINE_MOM_SAVING_MONEY
- farwritetext MomOKIllSaveText
- buttonsound
- jump MomPhoneHangUpScript
-
-MomPhoneWontSaveMoneyScript:
- clearflag ENGINE_MOM_SAVING_MONEY
- farwritetext MomPhoneWontSaveMoneyText
- buttonsound
- jump MomPhoneHangUpScript
-
-MomPhoneHangUpScript:
- farwritetext MomPhoneHangUpText
- end
-
-MomPhoneNoPokemonScript:
- farwritetext MomPhoneNoPokemonText
- end
-
-MomPhoneNoPokedexScript:
- farwritetext MomPhoneNoPokedexText
- end
-
-MomPhoneNoGymQuestScript:
- farwritetext MomPhoneNoGymQuestText
- end
-
-MomPhoneLectureScript:
- setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
- setflag ENGINE_MOM_ACTIVE
- specialphonecall SPECIALCALL_NONE
- farwritetext MomPhoneLectureText
- yesorno
- iftrue MomPhoneSaveMoneyScript
- jump MomPhoneWontSaveMoneyScript
-
-; Bill
-
-BillPhoneScript1:
- checktime DAY
- iftrue .daygreet
- checktime NITE
- iftrue .nitegreet
- farwritetext BillPhoneMornGreetingText
- buttonsound
- jump .main
-
-.daygreet
- farwritetext BillPhoneDayGreetingText
- buttonsound
- jump .main
-
-.nitegreet
- farwritetext BillPhoneNiteGreetingText
- buttonsound
- jump .main
-
-.main
- farwritetext BillPhoneGenericText
- buttonsound
- checkcode VAR_BOXSPACE
- vartomem MEM_BUFFER_0
- ifequal 0, .full
- ifless PARTY_LENGTH, .nearlyfull
- farwritetext BillPhoneNotFullText
- end
-
-.nearlyfull
- farwritetext BillPhoneNearlyFullText
- end
-
-.full
- farwritetext BillPhoneFullText
- end
-
-BillPhoneScript2:
- farwritetext BillPhoneNewlyFullText
- waitbutton
- end
-
-; Elm
-
-ElmPhoneScript1:
- checkcode VAR_SPECIALPHONECALL
- ifequal SPECIALCALL_POKERUS, .pokerus
- checkevent EVENT_SHOWED_TOGEPI_TO_ELM
- iftrue .discovery
- checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
- iffalse .next
- checkevent EVENT_TOGEPI_HATCHED
- iftrue .egghatched
-.next
- checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
- iftrue .eggunhatched
- checkevent EVENT_ELMS_AIDE_IN_LAB
- iftrue .assistant
- checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
- iftrue .checkingegg
- checkevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
- iftrue .stolen
- checkevent EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
- iftrue .sawmrpokemon
- farwritetext ElmPhoneStartText
- end
-
-.sawmrpokemon
- farwritetext ElmPhoneSawMrPokemonText
- end
-
-.stolen
- farwritetext ElmPhonePokemonStolenText
- end
-
-.checkingegg
- farwritetext ElmPhoneCheckingEggText
- end
-
-.assistant
- farwritetext ElmPhoneAssistantText
- end
-
-.eggunhatched
- farwritetext ElmPhoneEggUnhatchedText
- end
-
-.egghatched
- farwritetext ElmPhoneEggHatchedText
- setevent EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE
- end
-
-.discovery
- random 2
- ifequal 0, .nextdiscovery
- farwritetext ElmPhoneDiscovery1Text
- end
-
-.nextdiscovery
- farwritetext ElmPhoneDiscovery2Text
- end
-
-.pokerus
- farwritetext ElmPhonePokerusText
- specialphonecall SPECIALCALL_NONE
- end
-
-ElmPhoneScript2:
- checkcode VAR_SPECIALPHONECALL
- ifequal SPECIALCALL_ROBBED, .disaster
- ifequal SPECIALCALL_ASSISTANT, .assistant
- ifequal SPECIALCALL_WEIRDBROADCAST, .rocket
- ifequal SPECIALCALL_SSTICKET, .gift
- ifequal SPECIALCALL_MASTERBALL, .gift
- farwritetext ElmPhonePokerusText
- specialphonecall SPECIALCALL_NONE
- end
-
-.disaster
- farwritetext ElmPhoneDisasterText
- specialphonecall SPECIALCALL_NONE
- setevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
- end
-
-.assistant
- farwritetext ElmPhoneEggAssistantText
- specialphonecall SPECIALCALL_NONE
- clearevent EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER
- setevent EVENT_ELMS_AIDE_IN_LAB
- end
-
-.rocket
- farwritetext ElmPhoneRocketText
- specialphonecall SPECIALCALL_NONE
- end
-
-.gift
- farwritetext ElmPhoneGiftText
- specialphonecall SPECIALCALL_NONE
- end
-
-.unused
- farwritetext ElmPhoneUnusedText
- specialphonecall SPECIALCALL_NONE
- end
-
-; Jack
-
-JackPhoneScript1:
- trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0
- checkflag ENGINE_JACK
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_JACK_MONDAY_MORNING
- iftrue .NotMonday
- checkcode VAR_WEEKDAY
- ifnotequal MONDAY, .NotMonday
- checktime MORN
- iftrue JackMondayMorning
-
-.NotMonday:
- farjump JackPhoneTips
-
-.WantsBattle:
- landmarktotext NATIONAL_PARK, MEM_BUFFER_2
- farjump JackWantsBattleScript
-
-JackPhoneScript2:
- trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- farscall PhoneScript_Random2
- ifequal 0, JackBattleTrivia
- checkflag ENGINE_JACK
- iftrue .WaitingForBattle
- checkflag ENGINE_JACK_MONDAY_MORNING
- iftrue .WaitingForBattle
- farscall PhoneScript_Random2
- ifequal 0, JackWantsToBattle
-
-.WaitingForBattle:
- farscall PhoneScript_Random3
- ifequal 0, JackFindsRare
- farjump Phone_GenericCall_Male
-
-JackMondayMorning:
- setflag ENGINE_JACK_MONDAY_MORNING
-
-JackWantsToBattle:
- landmarktotext NATIONAL_PARK, MEM_BUFFER_2
- setflag ENGINE_JACK
- farjump PhoneScript_WantsToBattle_Male
-
-JackFindsRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-JackBattleTrivia:
- farjump JackTriviaScript
-
-; Beverly
-
-BeverlyPhoneScript1:
- trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_BEVERLY_HAS_NUGGET
- iftrue .HasNugget
- farjump UnknownScript_0xa0900
-
-.HasNugget:
- landmarktotext NATIONAL_PARK, MEM_BUFFER_2
- farjump UnknownScript_0xa0aa5
-
-BeverlyPhoneScript2:
- trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_BEVERLY_HAS_NUGGET
- iftrue .HasNugget
- farscall PhoneScript_Random4
- ifequal 0, .FoundNugget
-
-.HasNugget:
- farjump Phone_GenericCall_Female
-
-.FoundNugget:
- setflag ENGINE_BEVERLY_HAS_NUGGET
- landmarktotext NATIONAL_PARK, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Female
-
-; Huey
-
-HueyPhoneScript1:
- trainertotext SAILOR, HUEY1, MEM_BUFFER_0
- checkflag ENGINE_HUEY
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_HUEY_WEDNESDAY_NIGHT
- iftrue .NotWednesday
- checkcode VAR_WEEKDAY
- ifnotequal WEDNESDAY, .NotWednesday
- checktime NITE
- iftrue HueyWednesdayNight
-
-.NotWednesday:
- special RandomPhoneMon
- farjump UnknownScript_0xa0908
-
-.WantsBattle:
- landmarktotext LIGHTHOUSE, MEM_BUFFER_2
- farjump HueyWantsBattleScript
-
-HueyPhoneScript2:
- trainertotext SAILOR, HUEY1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_HUEY
- iftrue .Flavor
- checkflag ENGINE_HUEY_WEDNESDAY_NIGHT
- iftrue .Flavor
- farscall PhoneScript_Random3
- ifequal 0, HueyWantsBattle
- ifequal 1, HueyWantsBattle
-
-.Flavor:
- farjump PhoneScript_MonFlavorText
-
-HueyWednesdayNight:
- setflag ENGINE_HUEY_WEDNESDAY_NIGHT
-
-HueyWantsBattle:
- landmarktotext LIGHTHOUSE, MEM_BUFFER_2
- setflag ENGINE_HUEY
- farjump PhoneScript_WantsToBattle_Male
-
-; Gaven
-
-GavenPhoneScript1:
- trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0
- checkflag ENGINE_GAVEN
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_GAVEN_THURSDAY_MORNING
- iftrue .NotThursday
- checkcode VAR_WEEKDAY
- ifnotequal THURSDAY, .NotThursday
- checktime MORN
- iftrue GavenThursdayMorning
-
-.NotThursday:
- farjump UnknownScript_0xa0910
-
-.WantsBattle:
- landmarktotext ROUTE_26, MEM_BUFFER_2
- farjump UnknownScript_0xa0a37
-
-GavenPhoneScript2:
- trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_GAVEN
- iftrue .WaitingForBattle
- checkflag ENGINE_GAVEN_THURSDAY_MORNING
- iftrue .WaitingForBattle
- farscall PhoneScript_Random2
- ifequal 0, GavenWantsRematch
-
-.WaitingForBattle:
- farscall PhoneScript_Random3
- ifequal 0, GavenFoundRare
- farjump Phone_GenericCall_Male
-
-GavenThursdayMorning:
- setflag ENGINE_GAVEN_THURSDAY_MORNING
-
-GavenWantsRematch:
- landmarktotext ROUTE_26, MEM_BUFFER_2
- setflag ENGINE_GAVEN
- farjump PhoneScript_WantsToBattle_Male
-
-GavenFoundRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-; Beth
-
-BethPhoneScript1:
- trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0
- checkflag ENGINE_BETH
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_BETH_FRIDAY_AFTERNOON
- iftrue .NotFriday
- checkcode VAR_WEEKDAY
- ifnotequal FRIDAY, .NotFriday
- checktime DAY
- iftrue BethFridayAfternoon
-
-.NotFriday:
- farjump UnknownScript_0xa0918
-
-.WantsBattle:
- landmarktotext ROUTE_26, MEM_BUFFER_2
- farjump BethBattleReminderScript
-
-BethPhoneScript2:
- trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_BETH
- iftrue .Generic
- checkflag ENGINE_BETH_FRIDAY_AFTERNOON
- iftrue .Generic
- farscall PhoneScript_Random2
- ifequal 0, BethWantsBattle
-
-.Generic:
- farjump Phone_GenericCall_Female
-
-BethFridayAfternoon:
- setflag ENGINE_BETH_FRIDAY_AFTERNOON
-
-BethWantsBattle:
- landmarktotext ROUTE_26, MEM_BUFFER_2
- setflag ENGINE_BETH
- farjump PhoneScript_WantsToBattle_Female
-
-; Jose
-
-JosePhoneScript1:
- trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0
- checkflag ENGINE_JOSE
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_JOSE_SATURDAY_NIGHT
- iftrue .NotSaturday
- checkflag ENGINE_JOSE_HAS_STAR_PIECE
- iftrue .HasItem
- checkcode VAR_WEEKDAY
- ifnotequal SATURDAY, .NotSaturday
- checktime NITE
- iftrue JoseSaturdayNight
-
-.NotSaturday:
- farjump UnknownScript_0xa0920
-
-.WantsBattle:
- landmarktotext ROUTE_27, MEM_BUFFER_2
- farjump UnknownScript_0xa0a41
-
-.HasItem:
- landmarktotext ROUTE_27, MEM_BUFFER_2
- farjump UnknownScript_0xa0a41
-
-JosePhoneScript2:
- trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_JOSE
- iftrue .Generic
- checkflag ENGINE_JOSE_SATURDAY_NIGHT
- iftrue .Generic
- checkflag ENGINE_JOSE_HAS_STAR_PIECE
- iftrue .Generic
- farscall PhoneScript_Random3
- ifequal 0, JoseWantsBattle
- farscall PhoneScript_Random3
- ifequal 0, JoseHasStarPiece
-
-.Generic:
- farscall PhoneScript_Random3
- ifequal 0, JoseFoundRare
- farjump Phone_GenericCall_Male
-
-JoseSaturdayNight:
- setflag ENGINE_JOSE_SATURDAY_NIGHT
-
-JoseWantsBattle:
- landmarktotext ROUTE_27, MEM_BUFFER_2
- setflag ENGINE_JOSE
- farjump PhoneScript_WantsToBattle_Male
-
-JoseFoundRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-JoseHasStarPiece:
- setflag ENGINE_JOSE_HAS_STAR_PIECE
- landmarktotext ROUTE_27, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Male
-
-; Reena
-
-ReenaPhoneScript1:
- trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0
- checkflag ENGINE_REENA
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_REENA_SUNDAY_MORNING
- iftrue .NotSunday
- checkcode VAR_WEEKDAY
- ifnotequal SUNDAY, .NotSunday
- checktime MORN
- iftrue ReenaSundayMorning
-
-.NotSunday:
- farjump UnknownScript_0xa0928
-
-.WantsBattle:
- landmarktotext ROUTE_27, MEM_BUFFER_2
- farjump UnknownScript_0xa0a46
-
-ReenaPhoneScript2:
- trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_REENA
- iftrue .Generic
- checkflag ENGINE_REENA_SUNDAY_MORNING
- iftrue .Generic
- farscall PhoneScript_Random2
- ifequal 0, ReenaWantsBattle
-
-.Generic:
- farjump Phone_GenericCall_Female
-
-ReenaSundayMorning:
- setflag ENGINE_REENA_SUNDAY_MORNING
-
-ReenaWantsBattle:
- landmarktotext ROUTE_27, MEM_BUFFER_2
- setflag ENGINE_REENA
- farjump PhoneScript_WantsToBattle_Female
-
-; Joey
-
-JoeyPhoneScript1:
- trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0
- checkflag ENGINE_JOEY
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_JOEY_MONDAY_AFTERNOON
- iftrue .NotMonday
- checkcode VAR_WEEKDAY
- ifnotequal MONDAY, .NotMonday
- checktime DAY
- iftrue JoeyMondayAfternoon
-
-.NotMonday:
- special RandomPhoneMon
- farjump UnknownScript_0xa0930
-
-.WantsBattle:
- landmarktotext ROUTE_30, MEM_BUFFER_2
- farjump UnknownScript_0xa0a4b
-
-JoeyPhoneScript2:
- trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_JOEY
- iftrue .Generic
- checkflag ENGINE_JOEY_MONDAY_AFTERNOON
- iftrue .Generic
- farscall PhoneScript_Random3
- ifequal 0, JoeyWantsBattle
- ifequal 1, JoeyWantsBattle
-
-.Generic:
- farjump Phone_GenericCall_Male
-
-JoeyMondayAfternoon:
- setflag ENGINE_JOEY_MONDAY_AFTERNOON
-
-JoeyWantsBattle:
- landmarktotext ROUTE_30, MEM_BUFFER_2
- setflag ENGINE_JOEY
- farjump PhoneScript_WantsToBattle_Male
-
-; Wade
-
-WadePhoneScript1:
- trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0
- checkflag ENGINE_WADE
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_WADE_TUESDAY_NIGHT
- iftrue .NotTuesday
- checkflag ENGINE_WADE_HAS_ITEM
- iftrue .HasItem
- checkcode VAR_WEEKDAY
- ifnotequal TUESDAY, .NotTuesday
- checktime NITE
- iftrue WadeTuesdayNight
-
-.NotTuesday:
- farscall PhoneScript_Random2
- ifequal 0, .NoContest
- checkflag ENGINE_DAILY_BUG_CONTEST
- iftrue .NoContest
- checkcode VAR_WEEKDAY
- ifequal TUESDAY, .ContestToday
- ifequal THURSDAY, .ContestToday
- ifequal SATURDAY, .ContestToday
-
-.NoContest:
- farjump UnknownScript_0xa0938
-
-.ContestToday:
- farjump PhoneScript_BugCatchingContest
-
-.WantsBattle:
- landmarktotext ROUTE_31, MEM_BUFFER_2
- farjump UnknownScript_0xa0a50
-
-.HasItem:
- landmarktotext ROUTE_31, MEM_BUFFER_2
- farjump UnknownScript_0xa0ab5
-
-WadePhoneScript2:
- trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- farscall PhoneScript_Random2
- ifequal 0, .NoContest
- checkflag ENGINE_DAILY_BUG_CONTEST
- iftrue .NoContest
- checkcode VAR_WEEKDAY
- ifequal TUESDAY, .ContestToday
- ifequal THURSDAY, .ContestToday
- ifequal SATURDAY, .ContestToday
-
-.NoContest:
- checkflag ENGINE_WADE
- iftrue .next
- checkflag ENGINE_WADE_TUESDAY_NIGHT
- iftrue .next
- checkflag ENGINE_WADE_HAS_ITEM
- iftrue .next
- farscall PhoneScript_Random2
- ifequal 0, WadeHasItem2
- checkflag ENGINE_FLYPOINT_GOLDENROD
- iffalse .next
- farscall PhoneScript_Random2
- ifequal 0, WadeWantsBattle2
-
-.next:
- farscall PhoneScript_Random3
- ifequal 0, WadeFoundRare
- farjump Phone_GenericCall_Male
-
-.ContestToday:
- farjump PhoneScript_BugCatchingContest
-
-WadeTuesdayNight:
- setflag ENGINE_WADE_TUESDAY_NIGHT
-
-WadeWantsBattle2:
- landmarktotext ROUTE_31, MEM_BUFFER_2
- setflag ENGINE_WADE
- farjump PhoneScript_WantsToBattle_Male
-
-WadeFoundRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-WadeHasItem2:
- setflag ENGINE_WADE_HAS_ITEM
- landmarktotext ROUTE_31, MEM_BUFFER_2
- clearevent EVENT_WADE_HAS_BERRY
- clearevent EVENT_WADE_HAS_PSNCUREBERRY
- clearevent EVENT_WADE_HAS_PRZCUREBERRY
- clearevent EVENT_WADE_HAS_BITTER_BERRY
- random 4
- ifequal 0, .Berry
- ifequal 1, .PsnCureBerry
- ifequal 2, .PrzCureBerry
- ifequal 3, .Bitterberry
-
-.Berry:
- setevent EVENT_WADE_HAS_BERRY
- jump .FoundBerry
-
-.PsnCureBerry:
- setevent EVENT_WADE_HAS_PSNCUREBERRY
- jump .FoundBerry
-
-.PrzCureBerry:
- setevent EVENT_WADE_HAS_PRZCUREBERRY
- jump .FoundBerry
-
-.Bitterberry:
- setevent EVENT_WADE_HAS_BITTER_BERRY
-
-.FoundBerry:
- farjump PhoneScript_FoundItem_Male
-
-; Ralph
-
-RalphPhoneScript1:
- trainertotext FISHER, RALPH1, MEM_BUFFER_0
- checkflag ENGINE_RALPH
- iftrue .Rematch
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_RALPH_WEDNESDAY_MORNING
- iftrue .CheckSwarm
- checkcode VAR_WEEKDAY
- ifnotequal WEDNESDAY, .CheckSwarm
- checktime MORN
- iftrue Ralph_WednesdayMorning
-.CheckSwarm:
- checkflag ENGINE_FISH_SWARM
- iftrue .ReportSwarm
- farjump UnknownScript_0xa0940
-
-.Rematch:
- landmarktotext ROUTE_32, MEM_BUFFER_2
- farjump UnknownScript_0xa0a55
-
-.ReportSwarm:
- landmarktotext ROUTE_32, MEM_BUFFER_2
- farjump UnknownScript_0xa0af5
-
-RalphPhoneScript2:
- trainertotext FISHER, RALPH1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_FLYPOINT_GOLDENROD
- iffalse .CheckSwarm
- checkflag ENGINE_RALPH
- iftrue .CheckSwarm
- checkflag ENGINE_RALPH_WEDNESDAY_MORNING
- iftrue .CheckSwarm
- farscall PhoneScript_Random2
- ifequal 0, Ralph_FightMe
-.CheckSwarm:
- farscall PhoneScript_Random5
- ifequal 0, Ralph_SetUpSwarm
- farjump Phone_GenericCall_Male
-
-Ralph_WednesdayMorning:
- setflag ENGINE_RALPH_WEDNESDAY_MORNING
-Ralph_FightMe:
- landmarktotext ROUTE_32, MEM_BUFFER_2
- setflag ENGINE_RALPH
- farjump PhoneScript_WantsToBattle_Male
-
-Ralph_SetUpSwarm:
- checkflag ENGINE_FISH_SWARM
- iftrue .Generic
- setflag ENGINE_FISH_SWARM
- pokenamemem QWILFISH, MEM_BUFFER_1
- landmarktotext ROUTE_32, MEM_BUFFER_2
- writebyte FISHSWARM_QWILFISH
- special ActivateFishingSwarm
- farjump UnknownScript_0xa05d6
-
-.Generic:
- farjump Phone_GenericCall_Male
-
-; Liz
-
-LizPhoneScript1:
- trainertotext PICNICKER, LIZ1, MEM_BUFFER_0
- checkflag ENGINE_LIZ
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_LIZ_THURSDAY_AFTERNOON
- iftrue .NotThursday
- checkcode VAR_WEEKDAY
- ifnotequal THURSDAY, .NotThursday
- checktime DAY
- iftrue LizThursdayAfternoon
-
-.NotThursday:
- special RandomPhoneMon
- farjump UnknownScript_0xa0948
-
-.WantsBattle:
- landmarktotext ROUTE_32, MEM_BUFFER_2
- farjump UnknownScript_0xa0a5a
-
-LizPhoneScript2:
- trainertotext PICNICKER, LIZ1, MEM_BUFFER_0
- farscall PhoneScript_Random4
- ifequal 0, LizWrongNumber
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_LIZ
- iftrue .next
- checkflag ENGINE_LIZ_THURSDAY_AFTERNOON
- iftrue .next
-
-.next:
- farscall PhoneScript_Random2
- ifequal 0, LizGossip
- checkflag ENGINE_FLYPOINT_GOLDENROD
- iffalse .Generic
- farscall PhoneScript_Random2
- ifequal 0, LizWantsBattle
-
-.Generic:
- farjump Phone_GenericCall_Female
-
-LizThursdayAfternoon:
- setflag ENGINE_LIZ_THURSDAY_AFTERNOON
-
-LizWantsBattle:
- landmarktotext ROUTE_32, MEM_BUFFER_2
- setflag ENGINE_LIZ
- farjump PhoneScript_WantsToBattle_Female
-
-LizWrongNumber:
- farjump LizWrongNumberScript
-
-LizGossip:
- random 9
- ifequal 0, .CoolTrainerM
- ifequal 1, .Beauty
- ifequal 2, .Grunt
- ifequal 3, .Teacher
- ifequal 4, .SwimmerF
- ifequal 5, .KimonoGirl
- ifequal 6, .Skier
- ifequal 7, .Medium
- ifequal 8, .PokefanM
-
-.CoolTrainerM:
- trainerclassname COOLTRAINERM, NICK
- jump LizGossipScript
-
-.Beauty:
- trainerclassname BEAUTY, VICTORIA
- jump LizGossipScript
-
-.Grunt:
- trainerclassname GRUNTM, GRUNTM_1
- jump LizGossipScript
-
-.Teacher:
- trainerclassname TEACHER, COLETTE
- jump LizGossipScript
-
-.SwimmerF:
- trainerclassname SWIMMERF, ELAINE
- jump LizGossipScript
-
-.KimonoGirl:
- trainerclassname KIMONO_GIRL, NAOKO1
- jump LizGossipScript
-
-.Skier:
- trainerclassname SKIER, ROXANNE
- jump LizGossipScript
-
-.Medium:
- trainerclassname MEDIUM, MARTHA
- jump LizGossipScript
-
-.PokefanM:
- trainerclassname POKEFANM, WILLIAM
- jump LizGossipScript
-
-LizGossipScript:
- farjump UnknownScript_0xa06da
-
-; Anthony
-
-AnthonyPhoneScript1:
- trainertotext HIKER, ANTHONY2, MEM_BUFFER_0
- checkflag ENGINE_ANTHONY
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_ANTHONY_FRIDAY_NIGHT
- iftrue .NotFriday
- checkcode VAR_WEEKDAY
- ifnotequal FRIDAY, .NotFriday
- checktime NITE
- iftrue AnthonyFridayNight
-
-.NotFriday:
- checkflag ENGINE_DUNSPARCE_SWARM
- iftrue .AlreadySwarming
- farjump UnknownScript_0xa0950
-
-.WantsBattle:
- landmarktotext ROUTE_33, MEM_BUFFER_2
- farjump UnknownScript_0xa0a5f
-
-.AlreadySwarming:
- landmarktotext ROUTE_33, MEM_BUFFER_2
- farjump UnknownScript_0xa0afa
-
-AnthonyPhoneScript2:
- trainertotext HIKER, ANTHONY2, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_FLYPOINT_GOLDENROD
- iffalse .TriesSwarm
- checkflag ENGINE_ANTHONY
- iftrue .TriesSwarm
- checkflag ENGINE_ANTHONY_FRIDAY_NIGHT
- iftrue .TriesSwarm
- farscall PhoneScript_Random2
- ifequal 0, AnthonyWantsBattle
-
-.TriesSwarm:
- farscall PhoneScript_Random5
- ifequal 0, AnthonyTriesDunsparceSwarm
- farjump Phone_GenericCall_Male
-
-AnthonyFridayNight:
- setflag ENGINE_ANTHONY_FRIDAY_NIGHT
-
-AnthonyWantsBattle:
- landmarktotext ROUTE_33, MEM_BUFFER_2
- setflag ENGINE_ANTHONY
- farjump PhoneScript_WantsToBattle_Male
-
-AnthonyTriesDunsparceSwarm:
- checkflag ENGINE_DUNSPARCE_SWARM
- iftrue .Generic
- setflag ENGINE_DUNSPARCE_SWARM
- pokenamemem DUNSPARCE, MEM_BUFFER_1
- swarm SWARM_DUNSPARCE, DARK_CAVE_VIOLET_ENTRANCE
- landmarktotext DARK_CAVE, MEM_BUFFER_2
- farjump UnknownScript_0xa05de
-
-.Generic:
- farjump Phone_GenericCall_Male
-
-; Todd
-
-ToddPhoneScript1:
- trainertotext CAMPER, TODD1, MEM_BUFFER_0
- checkflag ENGINE_TODD
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_TODD_SATURDAY_MORNING
- iftrue .NotSaturday
- checkcode VAR_WEEKDAY
- ifnotequal SATURDAY, .NotSaturday
- checktime MORN
- iftrue ToddSaturdayMorning
-
-.NotSaturday:
- checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
- iftrue .SaleOn
- farjump UnknownScript_0xa0958
-
-.WantsBattle:
- landmarktotext ROUTE_34, MEM_BUFFER_2
- farjump UnknownScript_0xa0a64
-
-.SaleOn:
- farjump UnknownScript_0xa0b04
-
-ToddPhoneScript2:
- trainertotext CAMPER, TODD1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_TODD
- iftrue .TryForSale
- checkflag ENGINE_TODD_SATURDAY_MORNING
- iftrue .TryForSale
- checkflag ENGINE_FLYPOINT_GOLDENROD
- iffalse .NoGoldenrod
- farscall PhoneScript_Random2
- ifequal 0, ToddWantsBattle
-
-.TryForSale:
- farscall PhoneScript_Random2
- ifequal 0, ToddDeptStoreSale
-
-.NoGoldenrod:
- farscall PhoneScript_Random3
- ifequal 0, ToddFoundRare
- farjump Phone_GenericCall_Male
-
-ToddSaturdayMorning:
- setflag ENGINE_TODD_SATURDAY_MORNING
-
-ToddWantsBattle:
- landmarktotext ROUTE_34, MEM_BUFFER_2
- setflag ENGINE_TODD
- farjump PhoneScript_WantsToBattle_Male
-
-ToddFoundRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-ToddDeptStoreSale:
- setflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
- farjump UnknownScript_0xa0644
-
-; Gina
-
-GinaPhoneScript1:
- trainertotext PICNICKER, GINA1, MEM_BUFFER_0
- checkflag ENGINE_GINA
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_GINA_SUNDAY_AFTERNOON
- iftrue .NotSunday
- checkflag ENGINE_GINA_HAS_LEAF_STONE
- iftrue .HasLeafStone
- checkcode VAR_WEEKDAY
- ifnotequal SUNDAY, .NotSunday
- checktime DAY
- iftrue GinaSundayDay
-
-.NotSunday:
- checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
- iftrue .Rockets
- farjump UnknownScript_0xa0960
-
-.Rockets:
- farjump UnknownScript_0xa05c6
-
-.WantsBattle:
- landmarktotext ROUTE_34, MEM_BUFFER_2
- farjump UnknownScript_0xa0a69
-
-.HasLeafStone:
- landmarktotext ROUTE_34, MEM_BUFFER_2
- farjump UnknownScript_0xa0abd
-
-GinaPhoneScript2:
- trainertotext PICNICKER, GINA1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
- iftrue GinaRockets
- checkflag ENGINE_GINA
- iftrue .Generic
- checkflag ENGINE_GINA_SUNDAY_AFTERNOON
- iftrue .Generic
- checkflag ENGINE_GINA_HAS_LEAF_STONE
- iftrue .Generic
- checkevent EVENT_GINA_GAVE_LEAF_STONE
- iftrue .GaveLeafStone
- farscall PhoneScript_Random2
- ifequal 0, GinaHasLeafStone
-
-.GaveLeafStone:
- farscall PhoneScript_Random11
- ifequal 0, GinaHasLeafStone
- checkflag ENGINE_FLYPOINT_GOLDENROD
- iffalse .Generic
- farscall PhoneScript_Random3
- ifequal 0, GinaWantsBattle
-
-.Generic:
- farjump Phone_GenericCall_Female
-
-GinaSundayDay:
- setflag ENGINE_GINA_SUNDAY_AFTERNOON
-
-GinaWantsBattle:
- landmarktotext ROUTE_34, MEM_BUFFER_2
- setflag ENGINE_GINA
- farjump PhoneScript_WantsToBattle_Female
-
-GinaRockets:
- farjump UnknownScript_0xa05c6
-
-GinaHasLeafStone:
- setflag ENGINE_GINA_HAS_LEAF_STONE
- landmarktotext ROUTE_34, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Female
-
-; Irwin
-
-IrwinPhoneScript1:
- trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
- iftrue .Rockets
- farjump UnknownScript_0xa09c8
-
-.Rockets:
- farjump IrwinRocketRumor
-
-IrwinPhoneScript2:
- trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
- iftrue .Rockets
- farjump IrwinRumorScript
-
-.Rockets:
- farjump IrwinRocketRumor
-
-; Arnie
-
-ArniePhoneScript1:
- trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0
- checkflag ENGINE_ARNIE
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_ARNIE_TUESDAY_MORNING
- iftrue .NotTuesday
- checkcode VAR_WEEKDAY
- ifnotequal TUESDAY, .NotTuesday
- checktime MORN
- iftrue ArnieTuesdayMorning
-
-.NotTuesday:
- checkflag ENGINE_YANMA_SWARM
- iftrue .AlreadySwarming
- farjump UnknownScript_0xa0968
-
-.WantsBattle:
- landmarktotext ROUTE_35, MEM_BUFFER_2
- farjump UnknownScript_0xa0a6e
-
-.AlreadySwarming:
- landmarktotext ROUTE_35, MEM_BUFFER_2
- farjump UnknownScript_0xa0aff
-
-ArniePhoneScript2:
- trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_ARNIE
- iftrue .Swarm
- checkflag ENGINE_ARNIE_TUESDAY_MORNING
- iftrue .Swarm
- farscall PhoneScript_Random2
- ifequal 0, ArnieWantsBattle
-
-.Swarm:
- farscall PhoneScript_Random5
- ifequal 0, ArnieYanmaSwarm
- farscall PhoneScript_Random3
- ifequal 0, ArnieFoundRare
- farjump Phone_GenericCall_Male
-
-ArnieTuesdayMorning:
- setflag ENGINE_ARNIE_TUESDAY_MORNING
-
-ArnieWantsBattle:
- landmarktotext ROUTE_35, MEM_BUFFER_2
- setflag ENGINE_ARNIE
- farjump PhoneScript_WantsToBattle_Male
-
-ArnieYanmaSwarm: ; start swarm
- checkflag ENGINE_YANMA_SWARM
- iftrue ArnieYanmaAlreadySwarming
- setflag ENGINE_YANMA_SWARM
- pokenamemem YANMA, MEM_BUFFER_1
- swarm SWARM_YANMA, ROUTE_35
- landmarktotext ROUTE_35, MEM_BUFFER_2
- farjump UnknownScript_0xa05ce
-
-ArnieFoundRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-ArnieYanmaAlreadySwarming:
- farjump Phone_GenericCall_Male
-
-; Alan
-
-AlanPhoneScript1:
- trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0
- checkflag ENGINE_ALAN
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_ALAN_WEDNESDAY_AFTERNOON
- iftrue .NotWednesday
- checkflag ENGINE_ALAN_HAS_FIRE_STONE
- iftrue .FireStone
- checkcode VAR_WEEKDAY
- ifnotequal WEDNESDAY, .NotWednesday
- checktime DAY
- iftrue AlanWednesdayDay
-
-.NotWednesday:
- farjump UnknownScript_0xa0970
-
-.WantsBattle:
- landmarktotext ROUTE_36, MEM_BUFFER_2
- farjump UnknownScript_0xa0a73
-
-.FireStone:
- landmarktotext ROUTE_36, MEM_BUFFER_2
- farjump UnknownScript_0xa0ac5
-
-AlanPhoneScript2:
- trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_ALAN
- iftrue .Generic
- checkflag ENGINE_ALAN_WEDNESDAY_AFTERNOON
- iftrue .Generic
- checkflag ENGINE_ALAN_HAS_FIRE_STONE
- iftrue .Generic
- farscall PhoneScript_Random3
- ifequal 0, AlanWantsBattle
- checkevent EVENT_ALAN_GAVE_FIRE_STONE
- iftrue .FireStone
- farscall PhoneScript_Random2
- ifequal 0, AlanHasFireStone
-
-.FireStone:
- farscall PhoneScript_Random11
- ifequal 0, AlanHasFireStone
-
-.Generic:
- farjump Phone_GenericCall_Male
-
-AlanWednesdayDay:
- setflag ENGINE_ALAN_WEDNESDAY_AFTERNOON
-
-AlanWantsBattle:
- landmarktotext ROUTE_36, MEM_BUFFER_2
- setflag ENGINE_ALAN
- farjump PhoneScript_WantsToBattle_Male
-
-AlanHasFireStone:
- setflag ENGINE_ALAN_HAS_FIRE_STONE
- landmarktotext ROUTE_36, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Male
-
-; Dana
-
-DanaPhoneScript1:
- trainertotext LASS, DANA1, MEM_BUFFER_0
- checkflag ENGINE_DANA
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_DANA_THURSDAY_NIGHT
- iftrue .NotThursday
- checkflag ENGINE_DANA_HAS_THUNDERSTONE
- iftrue .HasThunderstone
- checkcode VAR_WEEKDAY
- ifnotequal THURSDAY, .NotThursday
- checktime NITE
- iftrue DanaThursdayNight
-
-.NotThursday:
- farjump UnknownScript_0xa0978
-
-.WantsBattle:
- landmarktotext ROUTE_38, MEM_BUFFER_2
- farjump UnknownScript_0xa0a78
-
-.HasThunderstone:
- landmarktotext ROUTE_38, MEM_BUFFER_2
- farjump UnknownScript_0xa0acd
-
-DanaPhoneScript2:
- trainertotext LASS, DANA1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_DANA
- iftrue .Generic
- checkflag ENGINE_DANA_THURSDAY_NIGHT
- iftrue .Generic
- checkflag ENGINE_DANA_HAS_THUNDERSTONE
- iftrue .Generic
- farscall PhoneScript_Random3
- ifequal 0, DanaWantsBattle
- checkevent EVENT_DANA_GAVE_THUNDERSTONE
- iftrue .Thunderstone
- farscall PhoneScript_Random2
- ifequal 0, DanaHasThunderstone
-
-.Thunderstone:
- farscall PhoneScript_Random11
- ifequal 0, DanaHasThunderstone
-
-.Generic:
- farscall PhoneScript_Random3
- ifequal 0, DanaFoundRare
- farjump Phone_GenericCall_Female
-
-DanaThursdayNight:
- setflag ENGINE_DANA_THURSDAY_NIGHT
-
-DanaWantsBattle:
- landmarktotext ROUTE_38, MEM_BUFFER_2
- setflag ENGINE_DANA
- farjump PhoneScript_WantsToBattle_Female
-
-DanaFoundRare:
- farjump Phone_CheckIfUnseenRare_Female
-
-DanaHasThunderstone:
- setflag ENGINE_DANA_HAS_THUNDERSTONE
- landmarktotext ROUTE_38, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Female
-
-; Chad
-
-ChadPhoneScript1:
- trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0
- checkflag ENGINE_CHAD
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_CHAD_FRIDAY_MORNING
- iftrue .NotFriday
- checkcode VAR_WEEKDAY
- ifnotequal FRIDAY, .NotFriday
- checktime MORN
- iftrue ChadFridayMorning
-
-.NotFriday:
- farjump UnknownScript_0xa0980
-
-.WantsBattle:
- landmarktotext ROUTE_38, MEM_BUFFER_2
- farjump UnknownScript_0xa0a7d
-
-ChadPhoneScript2:
- trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- farscall PhoneScript_Random2
- ifequal 0, ChadOakGossip
- checkflag ENGINE_CHAD
- iftrue .Generic
- checkflag ENGINE_CHAD_FRIDAY_MORNING
- iftrue .Generic
- farscall PhoneScript_Random2
- ifequal 0, ChadWantsBattle
-
-.Generic:
- farscall PhoneScript_Random3
- ifequal 0, ChadFoundRare
- farjump Phone_GenericCall_Male
-
-ChadFridayMorning:
- setflag ENGINE_CHAD_FRIDAY_MORNING
-
-ChadWantsBattle:
- landmarktotext ROUTE_38, MEM_BUFFER_2
- setflag ENGINE_CHAD
- farjump PhoneScript_WantsToBattle_Male
-
-ChadFoundRare:
- farjump Phone_CheckIfUnseenRare_Male
-
-ChadOakGossip:
- farjump ChadOakGossipScript
-
-DerekPhoneScript1:
- trainertotext POKEFANM, DEREK1, MEM_BUFFER_0
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_DEREK_HAS_NUGGET
- iftrue .Nugget
- farscall PhoneScript_Random2
- ifequal 0, .NoContest
- checkflag ENGINE_DAILY_BUG_CONTEST
- iftrue .NoContest
- checkcode VAR_WEEKDAY
- ifequal TUESDAY, .ContestToday
- ifequal THURSDAY, .ContestToday
- ifequal SATURDAY, .ContestToday
-
-.NoContest:
- farjump UnknownScript_0xa0988
-
-.ContestToday:
- farjump PhoneScript_BugCatchingContest
-
-.Nugget:
- landmarktotext ROUTE_39, MEM_BUFFER_2
- farjump UnknownScript_0xa0ad5
-
-DerekPhoneScript2:
- trainertotext POKEFANM, DEREK1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- farscall PhoneScript_Random2
- ifequal 0, .NoContest
- checkflag ENGINE_DAILY_BUG_CONTEST
- iftrue .NoContest
- checkcode VAR_WEEKDAY
- ifequal TUESDAY, .ContestToday
- ifequal THURSDAY, .ContestToday
- ifequal SATURDAY, .ContestToday
-
-.NoContest:
- farscall PhoneScript_Random4
- ifequal 0, .Nugget
- farjump Phone_GenericCall_Male
-
-.ContestToday:
- farjump PhoneScript_BugCatchingContest
-
-.Nugget:
- setflag ENGINE_DEREK_HAS_NUGGET
- landmarktotext ROUTE_39, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Male
-
-TullyPhoneScript1:
- trainertotext FISHER, TULLY1, MEM_BUFFER_0
- checkflag ENGINE_TULLY
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_TULLY_SUNDAY_NIGHT
- iftrue .NotSunday
- checkflag ENGINE_TULLY_HAS_WATER_STONE
- iftrue .WaterStone
- checkcode VAR_WEEKDAY
- ifnotequal SUNDAY, .NotSunday
- checktime NITE
- iftrue TullySundayNight
-
-.NotSunday:
- farjump UnknownScript_0xa0990
-
-.WantsBattle:
- landmarktotext ROUTE_42, MEM_BUFFER_2
- farjump UnknownScript_0xa0a82
-
-.WaterStone:
- landmarktotext ROUTE_42, MEM_BUFFER_2
- farjump UnknownScript_0xa0add
-
-TullyPhoneScript2:
- trainertotext FISHER, TULLY1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_TULLY
- iftrue .Generic
- checkflag ENGINE_TULLY_SUNDAY_NIGHT
- iftrue .Generic
- checkflag ENGINE_TULLY_HAS_WATER_STONE
- iftrue .Generic
- farscall PhoneScript_Random3
- ifequal 0, TullyWantsBattle
- checkevent EVENT_TULLY_GAVE_WATER_STONE
- iftrue .WaterStone
- farscall PhoneScript_Random2
- ifequal 0, TullyFoundWaterStone
-
-.WaterStone:
- farscall PhoneScript_Random11
- ifequal 0, TullyFoundWaterStone
-
-.Generic:
- farjump Phone_GenericCall_Male
-
-TullySundayNight:
- setflag ENGINE_TULLY_SUNDAY_NIGHT
-
-TullyWantsBattle:
- landmarktotext ROUTE_42, MEM_BUFFER_2
- setflag ENGINE_TULLY
- farjump PhoneScript_WantsToBattle_Male
-
-TullyFoundWaterStone:
- setflag ENGINE_TULLY_HAS_WATER_STONE
- landmarktotext ROUTE_42, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Male
-
-BrentPhoneScript1:
- trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0
- checkflag ENGINE_BRENT
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_BRENT_MONDAY_MORNING
- iftrue .NotMonday
- checkcode VAR_WEEKDAY
- ifnotequal MONDAY, .NotMonday
- checktime MORN
- iftrue BrentMondayMorning
-
-.NotMonday:
- farjump UnknownScript_0xa0998
-
-.WantsBattle:
- landmarktotext ROUTE_43, MEM_BUFFER_2
- farjump UnknownScript_0xa0a87
-
-BrentPhoneScript2:
- trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- farscall PhoneScript_Random2
- ifequal 0, BrentBillTrivia
- checkflag ENGINE_BRENT
- iftrue .Generic
- checkflag ENGINE_BRENT_MONDAY_MORNING
- iftrue .Generic
- farscall PhoneScript_Random2
- ifequal 0, BrentWantsBattle
-
-.Generic:
- farjump Phone_GenericCall_Male
-
-BrentMondayMorning:
- setflag ENGINE_BRENT_MONDAY_MORNING
-
-BrentWantsBattle:
- landmarktotext ROUTE_43, MEM_BUFFER_2
- setflag ENGINE_BRENT
- farjump PhoneScript_WantsToBattle_Male
-
-BrentBillTrivia:
- farjump BrentBillTriviaScript
-
-TiffanyPhoneScript1:
- trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0
- checkflag ENGINE_TIFFANY
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_TIFFANY_TUESDAY_AFTERNOON
- iftrue .NotTuesday
- checkflag ENGINE_TIFFANY_HAS_PINK_BOW
- iftrue .HasItem
- checkcode VAR_WEEKDAY
- ifnotequal TUESDAY, .NotTuesday
- checktime DAY
- iftrue TiffanyTuesdayAfternoon
-
-.NotTuesday:
- farjump UnknownScript_0xa09a0
-
-.WantsBattle:
- landmarktotext ROUTE_43, MEM_BUFFER_2
- farjump UnknownScript_0xa0a8c
-
-.HasItem:
- landmarktotext ROUTE_43, MEM_BUFFER_2
- farjump UnknownScript_0xa0ae5
-
-TiffanyPhoneScript2:
- trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0
- farscall PhoneScript_Random4
- ifequal 0, TiffanysFamilyMembers
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_TIFFANY
- iftrue .Generic
- checkflag ENGINE_TIFFANY_TUESDAY_AFTERNOON
- iftrue .Generic
- checkflag ENGINE_TIFFANY_HAS_PINK_BOW
- iftrue .Generic
- farscall PhoneScript_Random3
- ifequal 0, TiffanyWantsBattle
- checkevent EVENT_TIFFANY_GAVE_PINK_BOW
- iftrue .PinkBow
- farscall PhoneScript_Random2
- ifequal 0, TiffanyHasPinkBow
-
-.PinkBow:
- farscall PhoneScript_Random11
- ifequal 0, TiffanyHasPinkBow
-
-.Generic:
- farjump Phone_GenericCall_Female
-
-TiffanyTuesdayAfternoon:
- setflag ENGINE_TIFFANY_TUESDAY_AFTERNOON
-
-TiffanyWantsBattle:
- landmarktotext ROUTE_43, MEM_BUFFER_2
- setflag ENGINE_TIFFANY
- farjump PhoneScript_WantsToBattle_Female
-
-TiffanysFamilyMembers:
- random 6
- ifequal 0, .Grandma
- ifequal 1, .Grandpa
- ifequal 2, .Mom
- ifequal 3, .Dad
- ifequal 4, .Sister
- ifequal 5, .Brother
-
-.Grandma:
- stringtotext GrandmaString, MEM_BUFFER_1
- jump .PoorClefairy
-
-.Grandpa:
- stringtotext GrandpaString, MEM_BUFFER_1
- jump .PoorClefairy
-
-.Mom:
- stringtotext MomString, MEM_BUFFER_1
- jump .PoorClefairy
-
-.Dad:
- stringtotext DadString, MEM_BUFFER_1
- jump .PoorClefairy
-
-.Sister:
- stringtotext SisterString, MEM_BUFFER_1
- jump .PoorClefairy
-
-.Brother:
- stringtotext BrotherString, MEM_BUFFER_1
- jump .PoorClefairy
-
-.PoorClefairy:
- farjump TiffanyItsAwful
-
-TiffanyHasPinkBow:
- setflag ENGINE_TIFFANY_HAS_PINK_BOW
- landmarktotext ROUTE_43, MEM_BUFFER_2
- farjump PhoneScript_FoundItem_Female
-
-; Vance
-
-VancePhoneScript1:
- trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0
- checkflag ENGINE_VANCE
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_VANCE_WEDNESDAY_NIGHT
- iftrue .NotWednesday
- checkcode VAR_WEEKDAY
- ifnotequal WEDNESDAY, .NotWednesday
- checktime NITE
- iftrue VanceWednesdayNight
-
-.NotWednesday:
- farjump VanceLookingForward
-
-.WantsBattle:
- landmarktotext ROUTE_44, MEM_BUFFER_2
- farjump VanceHurryHurry
-
-VancePhoneScript2:
- trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_VANCE
- iftrue .WantsBattle
- checkflag ENGINE_VANCE_WEDNESDAY_NIGHT
- iftrue .WantsBattle
- farscall PhoneScript_Random3
- ifequal 0, VanceWantsRematch
- ifequal 1, VanceWantsRematch
-
-.WantsBattle:
- farjump Phone_GenericCall_Male
-
-VanceWednesdayNight:
- setflag ENGINE_VANCE_WEDNESDAY_NIGHT
-
-VanceWantsRematch:
- landmarktotext ROUTE_44, MEM_BUFFER_2
- setflag ENGINE_VANCE
- farjump PhoneScript_WantsToBattle_Male
-
-WiltonPhoneScript1:
- trainertotext FISHER, WILTON1, MEM_BUFFER_0
- checkflag ENGINE_WILTON
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_WILTON_THURSDAY_MORNING
- iftrue .NotThursday
- checkflag ENGINE_WILTON_HAS_ITEM
- iftrue .HasItem
- checkcode VAR_WEEKDAY
- ifnotequal THURSDAY, .NotThursday
- checktime MORN
- iftrue WiltonThursdayMorning
-
-.NotThursday:
- farjump WiltonHaventFoundAnything
-
-.WantsBattle:
- landmarktotext ROUTE_44, MEM_BUFFER_2
- farjump WiltonNotBiting
-
-.HasItem:
- landmarktotext ROUTE_44, MEM_BUFFER_2
- farjump WiltonWantThis
-
-WiltonPhoneScript2:
- trainertotext FISHER, WILTON1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_WILTON
- iftrue .GenericCall
- checkflag ENGINE_WILTON_THURSDAY_MORNING
- iftrue .GenericCall
- checkflag ENGINE_WILTON_HAS_ITEM
- iftrue .GenericCall
- farscall PhoneScript_Random2
- ifequal 0, WiltonWantsBattle
- farscall PhoneScript_Random2
- ifequal 0, WiltonHasItem
-
-.GenericCall:
- farjump Phone_GenericCall_Male
-
-WiltonThursdayMorning:
- setflag ENGINE_WILTON_THURSDAY_MORNING
-
-WiltonWantsBattle:
- landmarktotext ROUTE_44, MEM_BUFFER_2
- setflag ENGINE_WILTON
- farjump PhoneScript_WantsToBattle_Male
-
-WiltonHasItem:
- setflag ENGINE_WILTON_HAS_ITEM
- landmarktotext ROUTE_44, MEM_BUFFER_2
- clearevent EVENT_WILTON_HAS_ULTRA_BALL
- clearevent EVENT_WILTON_HAS_GREAT_BALL
- clearevent EVENT_WILTON_HAS_POKE_BALL
- random 5
- ifequal 0, .UltraBall
- random 3
- ifequal 0, .GreatBall
- jump .PokeBall
-
-.UltraBall:
- setevent EVENT_WILTON_HAS_ULTRA_BALL
- jump .FoundItem
-
-.GreatBall:
- setevent EVENT_WILTON_HAS_GREAT_BALL
- jump .FoundItem
-
-.PokeBall:
- setevent EVENT_WILTON_HAS_POKE_BALL
-
-.FoundItem:
- farjump PhoneScript_FoundItem_Male
-
-; Kenji
-
-KenjiPhoneScript1:
- trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0
- farscall PhoneScript_AnswerPhone_Male
- farjump KenjiAnswerPhoneScript
-
-KenjiPhoneScript2:
- trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- farjump KenjiCallingPhoneScript
-
-; Parry
-
-ParryPhoneScript1:
- trainertotext HIKER, PARRY1, MEM_BUFFER_0
- checkflag ENGINE_PARRY
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Male
- checkflag ENGINE_PARRY_FRIDAY_AFTERNOON
- iftrue .WantsRematch
- checkcode VAR_WEEKDAY
- ifnotequal FRIDAY, .WantsRematch
- checktime DAY
- iftrue ParryFridayDay
-
-.WantsRematch:
- farjump ParryBattleWithMe
-
-.WantsBattle:
- landmarktotext ROUTE_45, MEM_BUFFER_2
- farjump ParryHaventYouGottenTo
-
-ParryPhoneScript2:
- trainertotext HIKER, PARRY1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Male
- checkflag ENGINE_PARRY
- iftrue .GenericCall
- checkflag ENGINE_PARRY_FRIDAY_AFTERNOON
- iftrue .GenericCall
- farscall PhoneScript_Random2
- ifequal 0, ParryWantsBattle
- ifequal 1, ParryWantsBattle
-
-.GenericCall:
- farjump Phone_GenericCall_Male
-
-ParryFridayDay:
- setflag ENGINE_PARRY_FRIDAY_AFTERNOON
-
-ParryWantsBattle:
- landmarktotext ROUTE_45, MEM_BUFFER_2
- setflag ENGINE_PARRY
- farjump PhoneScript_WantsToBattle_Male
-
-; Erin
-
-ErinPhoneScript1:
- trainertotext PICNICKER, ERIN1, MEM_BUFFER_0
- checkflag ENGINE_ERIN
- iftrue .WantsBattle
- farscall PhoneScript_AnswerPhone_Female
- checkflag ENGINE_ERIN_SATURDAY_NIGHT
- iftrue .NotSaturday
- checkcode VAR_WEEKDAY
- ifnotequal SATURDAY, .NotSaturday
- checktime NITE
- iftrue ErinSaturdayNight
-
-.NotSaturday:
- farjump ErinWorkingHardScript
-
-.WantsBattle:
- landmarktotext ROUTE_46, MEM_BUFFER_2
- farjump ErinComeBattleScript
-
-ErinPhoneScript2:
- trainertotext PICNICKER, ERIN1, MEM_BUFFER_0
- farscall PhoneScript_GreetPhone_Female
- checkflag ENGINE_ERIN
- iftrue .GenericCall
- checkflag ENGINE_ERIN_SATURDAY_NIGHT
- iftrue .GenericCall
- farscall PhoneScript_Random3
- ifequal 0, ErinWantsBattle
- ifequal 1, ErinWantsBattle
-
-.GenericCall:
- farjump Phone_GenericCall_Female
-
-ErinSaturdayNight:
- setflag ENGINE_ERIN_SATURDAY_NIGHT
-
-ErinWantsBattle:
- landmarktotext ROUTE_46, MEM_BUFFER_2
- setflag ENGINE_ERIN
- farjump PhoneScript_WantsToBattle_Female
diff --git a/engine/phone/scripts/alan.asm b/engine/phone/scripts/alan.asm
new file mode 100644
index 000000000..e5f7680f7
--- /dev/null
+++ b/engine/phone/scripts/alan.asm
@@ -0,0 +1,60 @@
+AlanPhoneCalleeScript:
+ trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0
+ checkflag ENGINE_ALAN
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_ALAN_WEDNESDAY_AFTERNOON
+ iftrue .NotWednesday
+ checkflag ENGINE_ALAN_HAS_FIRE_STONE
+ iftrue .FireStone
+ checkcode VAR_WEEKDAY
+ ifnotequal WEDNESDAY, .NotWednesday
+ checktime DAY
+ iftrue AlanWednesdayDay
+
+.NotWednesday:
+ farjump UnknownScript_0xa0970
+
+.WantsBattle:
+ landmarktotext ROUTE_36, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a73
+
+.FireStone:
+ landmarktotext ROUTE_36, MEM_BUFFER_2
+ farjump UnknownScript_0xa0ac5
+
+AlanPhoneCallerScript:
+ trainertotext SCHOOLBOY, ALAN1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_ALAN
+ iftrue .Generic
+ checkflag ENGINE_ALAN_WEDNESDAY_AFTERNOON
+ iftrue .Generic
+ checkflag ENGINE_ALAN_HAS_FIRE_STONE
+ iftrue .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, AlanWantsBattle
+ checkevent EVENT_ALAN_GAVE_FIRE_STONE
+ iftrue .FireStone
+ farscall PhoneScript_Random2
+ ifequal 0, AlanHasFireStone
+
+.FireStone:
+ farscall PhoneScript_Random11
+ ifequal 0, AlanHasFireStone
+
+.Generic:
+ farjump Phone_GenericCall_Male
+
+AlanWednesdayDay:
+ setflag ENGINE_ALAN_WEDNESDAY_AFTERNOON
+
+AlanWantsBattle:
+ landmarktotext ROUTE_36, MEM_BUFFER_2
+ setflag ENGINE_ALAN
+ farjump PhoneScript_WantsToBattle_Male
+
+AlanHasFireStone:
+ setflag ENGINE_ALAN_HAS_FIRE_STONE
+ landmarktotext ROUTE_36, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Male
diff --git a/engine/phone/scripts/anthony.asm b/engine/phone/scripts/anthony.asm
new file mode 100644
index 000000000..3dc298f8f
--- /dev/null
+++ b/engine/phone/scripts/anthony.asm
@@ -0,0 +1,61 @@
+AnthonyPhoneCalleeScript:
+ trainertotext HIKER, ANTHONY2, MEM_BUFFER_0
+ checkflag ENGINE_ANTHONY
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_ANTHONY_FRIDAY_NIGHT
+ iftrue .NotFriday
+ checkcode VAR_WEEKDAY
+ ifnotequal FRIDAY, .NotFriday
+ checktime NITE
+ iftrue AnthonyFridayNight
+
+.NotFriday:
+ checkflag ENGINE_DUNSPARCE_SWARM
+ iftrue .AlreadySwarming
+ farjump UnknownScript_0xa0950
+
+.WantsBattle:
+ landmarktotext ROUTE_33, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a5f
+
+.AlreadySwarming:
+ landmarktotext ROUTE_33, MEM_BUFFER_2
+ farjump UnknownScript_0xa0afa
+
+AnthonyPhoneCallerScript:
+ trainertotext HIKER, ANTHONY2, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_FLYPOINT_GOLDENROD
+ iffalse .TriesSwarm
+ checkflag ENGINE_ANTHONY
+ iftrue .TriesSwarm
+ checkflag ENGINE_ANTHONY_FRIDAY_NIGHT
+ iftrue .TriesSwarm
+ farscall PhoneScript_Random2
+ ifequal 0, AnthonyWantsBattle
+
+.TriesSwarm:
+ farscall PhoneScript_Random5
+ ifequal 0, AnthonyTriesDunsparceSwarm
+ farjump Phone_GenericCall_Male
+
+AnthonyFridayNight:
+ setflag ENGINE_ANTHONY_FRIDAY_NIGHT
+
+AnthonyWantsBattle:
+ landmarktotext ROUTE_33, MEM_BUFFER_2
+ setflag ENGINE_ANTHONY
+ farjump PhoneScript_WantsToBattle_Male
+
+AnthonyTriesDunsparceSwarm:
+ checkflag ENGINE_DUNSPARCE_SWARM
+ iftrue .Generic
+ setflag ENGINE_DUNSPARCE_SWARM
+ pokenamemem DUNSPARCE, MEM_BUFFER_1
+ swarm SWARM_DUNSPARCE, DARK_CAVE_VIOLET_ENTRANCE
+ landmarktotext DARK_CAVE, MEM_BUFFER_2
+ farjump UnknownScript_0xa05de
+
+.Generic:
+ farjump Phone_GenericCall_Male
diff --git a/engine/phone/scripts/arnie.asm b/engine/phone/scripts/arnie.asm
new file mode 100644
index 000000000..908e7ff6d
--- /dev/null
+++ b/engine/phone/scripts/arnie.asm
@@ -0,0 +1,64 @@
+ArniePhoneCalleeScript:
+ trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0
+ checkflag ENGINE_ARNIE
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_ARNIE_TUESDAY_MORNING
+ iftrue .NotTuesday
+ checkcode VAR_WEEKDAY
+ ifnotequal TUESDAY, .NotTuesday
+ checktime MORN
+ iftrue ArnieTuesdayMorning
+
+.NotTuesday:
+ checkflag ENGINE_YANMA_SWARM
+ iftrue .AlreadySwarming
+ farjump UnknownScript_0xa0968
+
+.WantsBattle:
+ landmarktotext ROUTE_35, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a6e
+
+.AlreadySwarming:
+ landmarktotext ROUTE_35, MEM_BUFFER_2
+ farjump UnknownScript_0xa0aff
+
+ArniePhoneCallerScript:
+ trainertotext BUG_CATCHER, ARNIE1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_ARNIE
+ iftrue .Swarm
+ checkflag ENGINE_ARNIE_TUESDAY_MORNING
+ iftrue .Swarm
+ farscall PhoneScript_Random2
+ ifequal 0, ArnieWantsBattle
+
+.Swarm:
+ farscall PhoneScript_Random5
+ ifequal 0, ArnieYanmaSwarm
+ farscall PhoneScript_Random3
+ ifequal 0, ArnieFoundRare
+ farjump Phone_GenericCall_Male
+
+ArnieTuesdayMorning:
+ setflag ENGINE_ARNIE_TUESDAY_MORNING
+
+ArnieWantsBattle:
+ landmarktotext ROUTE_35, MEM_BUFFER_2
+ setflag ENGINE_ARNIE
+ farjump PhoneScript_WantsToBattle_Male
+
+ArnieYanmaSwarm: ; start swarm
+ checkflag ENGINE_YANMA_SWARM
+ iftrue ArnieYanmaAlreadySwarming
+ setflag ENGINE_YANMA_SWARM
+ pokenamemem YANMA, MEM_BUFFER_1
+ swarm SWARM_YANMA, ROUTE_35
+ landmarktotext ROUTE_35, MEM_BUFFER_2
+ farjump UnknownScript_0xa05ce
+
+ArnieFoundRare:
+ farjump Phone_CheckIfUnseenRare_Male
+
+ArnieYanmaAlreadySwarming:
+ farjump Phone_GenericCall_Male
diff --git a/engine/phone/scripts/beth.asm b/engine/phone/scripts/beth.asm
new file mode 100644
index 000000000..4aae343a7
--- /dev/null
+++ b/engine/phone/scripts/beth.asm
@@ -0,0 +1,39 @@
+BethPhoneCalleeScript:
+ trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0
+ checkflag ENGINE_BETH
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_BETH_FRIDAY_AFTERNOON
+ iftrue .NotFriday
+ checkcode VAR_WEEKDAY
+ ifnotequal FRIDAY, .NotFriday
+ checktime DAY
+ iftrue BethFridayAfternoon
+
+.NotFriday:
+ farjump UnknownScript_0xa0918
+
+.WantsBattle:
+ landmarktotext ROUTE_26, MEM_BUFFER_2
+ farjump BethBattleReminderScript
+
+BethPhoneCallerScript:
+ trainertotext COOLTRAINERF, BETH1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_BETH
+ iftrue .Generic
+ checkflag ENGINE_BETH_FRIDAY_AFTERNOON
+ iftrue .Generic
+ farscall PhoneScript_Random2
+ ifequal 0, BethWantsBattle
+
+.Generic:
+ farjump Phone_GenericCall_Female
+
+BethFridayAfternoon:
+ setflag ENGINE_BETH_FRIDAY_AFTERNOON
+
+BethWantsBattle:
+ landmarktotext ROUTE_26, MEM_BUFFER_2
+ setflag ENGINE_BETH
+ farjump PhoneScript_WantsToBattle_Female
diff --git a/engine/phone/scripts/beverly.asm b/engine/phone/scripts/beverly.asm
new file mode 100644
index 000000000..abc86cb9d
--- /dev/null
+++ b/engine/phone/scripts/beverly.asm
@@ -0,0 +1,26 @@
+BeverlyPhoneCalleeScript:
+ trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_BEVERLY_HAS_NUGGET
+ iftrue .HasNugget
+ farjump UnknownScript_0xa0900
+
+.HasNugget:
+ landmarktotext NATIONAL_PARK, MEM_BUFFER_2
+ farjump UnknownScript_0xa0aa5
+
+BeverlyPhoneCallerScript:
+ trainertotext POKEFANF, BEVERLY1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_BEVERLY_HAS_NUGGET
+ iftrue .HasNugget
+ farscall PhoneScript_Random4
+ ifequal 0, .FoundNugget
+
+.HasNugget:
+ farjump Phone_GenericCall_Female
+
+.FoundNugget:
+ setflag ENGINE_BEVERLY_HAS_NUGGET
+ landmarktotext NATIONAL_PARK, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Female
diff --git a/engine/phone/scripts/bike_shop.asm b/engine/phone/scripts/bike_shop.asm
new file mode 100644
index 000000000..8b32be888
--- /dev/null
+++ b/engine/phone/scripts/bike_shop.asm
@@ -0,0 +1,5 @@
+BikeShopPhoneCallerScript:
+ farwritetext UnknownText_0x174000
+ clearflag ENGINE_BIKE_SHOP_CALL_ENABLED
+ specialphonecall SPECIALCALL_NONE
+ end
diff --git a/engine/phone/scripts/bill.asm b/engine/phone/scripts/bill.asm
new file mode 100644
index 000000000..733224f22
--- /dev/null
+++ b/engine/phone/scripts/bill.asm
@@ -0,0 +1,41 @@
+BillPhoneCalleeScript:
+ checktime DAY
+ iftrue .daygreet
+ checktime NITE
+ iftrue .nitegreet
+ farwritetext BillPhoneMornGreetingText
+ buttonsound
+ jump .main
+
+.daygreet
+ farwritetext BillPhoneDayGreetingText
+ buttonsound
+ jump .main
+
+.nitegreet
+ farwritetext BillPhoneNiteGreetingText
+ buttonsound
+ jump .main
+
+.main
+ farwritetext BillPhoneGenericText
+ buttonsound
+ checkcode VAR_BOXSPACE
+ vartomem MEM_BUFFER_0
+ ifequal 0, .full
+ ifless PARTY_LENGTH, .nearlyfull
+ farwritetext BillPhoneNotFullText
+ end
+
+.nearlyfull
+ farwritetext BillPhoneNearlyFullText
+ end
+
+.full
+ farwritetext BillPhoneFullText
+ end
+
+BillPhoneCallerScript:
+ farwritetext BillPhoneNewlyFullText
+ waitbutton
+ end
diff --git a/engine/phone/scripts/brent.asm b/engine/phone/scripts/brent.asm
new file mode 100644
index 000000000..ef18f06b9
--- /dev/null
+++ b/engine/phone/scripts/brent.asm
@@ -0,0 +1,44 @@
+BrentPhoneCalleeScript:
+ trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0
+ checkflag ENGINE_BRENT
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_BRENT_MONDAY_MORNING
+ iftrue .NotMonday
+ checkcode VAR_WEEKDAY
+ ifnotequal MONDAY, .NotMonday
+ checktime MORN
+ iftrue BrentMondayMorning
+
+.NotMonday:
+ farjump UnknownScript_0xa0998
+
+.WantsBattle:
+ landmarktotext ROUTE_43, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a87
+
+BrentPhoneCallerScript:
+ trainertotext POKEMANIAC, BRENT1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ farscall PhoneScript_Random2
+ ifequal 0, BrentBillTrivia
+ checkflag ENGINE_BRENT
+ iftrue .Generic
+ checkflag ENGINE_BRENT_MONDAY_MORNING
+ iftrue .Generic
+ farscall PhoneScript_Random2
+ ifequal 0, BrentWantsBattle
+
+.Generic:
+ farjump Phone_GenericCall_Male
+
+BrentMondayMorning:
+ setflag ENGINE_BRENT_MONDAY_MORNING
+
+BrentWantsBattle:
+ landmarktotext ROUTE_43, MEM_BUFFER_2
+ setflag ENGINE_BRENT
+ farjump PhoneScript_WantsToBattle_Male
+
+BrentBillTrivia:
+ farjump BrentBillTriviaScript
diff --git a/engine/phone/scripts/brent_gossip.asm b/engine/phone/scripts/brent_gossip.asm
new file mode 100644
index 000000000..11a91fe8c
--- /dev/null
+++ b/engine/phone/scripts/brent_gossip.asm
@@ -0,0 +1,62 @@
+BrentBillTriviaScript:
+ random 10
+ ifequal 0, .Father
+ ifequal 1, .Grandpa
+ ifequal 2, .Goldenrod
+ ifequal 3, .Route25
+ ifequal 4, .Abra
+ ifequal 5, .Sister
+ ifequal 6, .Milk
+ ifequal 7, .Battling
+ ifequal 8, .FlowerShop
+ ifequal 9, .KimonoGirl
+
+.Father:
+ farwritetext UnknownText_0x662bc
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Grandpa:
+ farwritetext UnknownText_0x662fc
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Goldenrod:
+ farwritetext UnknownText_0x66335
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Route25:
+ farwritetext UnknownText_0x66366
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Abra:
+ farwritetext UnknownText_0x663a1
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Sister:
+ farwritetext UnknownText_0x663e6
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Milk:
+ farwritetext UnknownText_0x66421
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Battling:
+ farwritetext UnknownText_0x6645f
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.FlowerShop:
+ farwritetext UnknownText_0x6649b
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.KimonoGirl:
+ farwritetext UnknownText_0x664dd
+ buttonsound
+ jump PhoneScript_HangupText_Male
diff --git a/engine/phone/buenas_password.asm b/engine/phone/scripts/buena.asm
index 68c5c01b9..3e08fcd40 100644
--- a/engine/phone/buenas_password.asm
+++ b/engine/phone/scripts/buena.asm
@@ -1,4 +1,4 @@
-BuenaPhoneScript1:
+BuenaPhoneCalleeScript:
checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
iftrue BuenaPhoneScript_Rocket
checkcode VAR_HOUR
@@ -6,7 +6,7 @@ BuenaPhoneScript1:
scall BuenaPhoneScript_CheckTimeOfDay1
jump BuenaPhoneScript_Random1
-BuenaPhoneScript2:
+BuenaPhoneCallerScript:
checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
iftrue BuenaPhoneScript_Rocket
scall BuenaPhoneScript_CheckTimeOfDay2
diff --git a/engine/phone/scripts/chad.asm b/engine/phone/scripts/chad.asm
new file mode 100644
index 000000000..e89563a09
--- /dev/null
+++ b/engine/phone/scripts/chad.asm
@@ -0,0 +1,49 @@
+ChadPhoneCalleeScript:
+ trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0
+ checkflag ENGINE_CHAD
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_CHAD_FRIDAY_MORNING
+ iftrue .NotFriday
+ checkcode VAR_WEEKDAY
+ ifnotequal FRIDAY, .NotFriday
+ checktime MORN
+ iftrue ChadFridayMorning
+
+.NotFriday:
+ farjump UnknownScript_0xa0980
+
+.WantsBattle:
+ landmarktotext ROUTE_38, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a7d
+
+ChadPhoneCallerScript:
+ trainertotext SCHOOLBOY, CHAD1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ farscall PhoneScript_Random2
+ ifequal 0, ChadOakGossip
+ checkflag ENGINE_CHAD
+ iftrue .Generic
+ checkflag ENGINE_CHAD_FRIDAY_MORNING
+ iftrue .Generic
+ farscall PhoneScript_Random2
+ ifequal 0, ChadWantsBattle
+
+.Generic:
+ farscall PhoneScript_Random3
+ ifequal 0, ChadFoundRare
+ farjump Phone_GenericCall_Male
+
+ChadFridayMorning:
+ setflag ENGINE_CHAD_FRIDAY_MORNING
+
+ChadWantsBattle:
+ landmarktotext ROUTE_38, MEM_BUFFER_2
+ setflag ENGINE_CHAD
+ farjump PhoneScript_WantsToBattle_Male
+
+ChadFoundRare:
+ farjump Phone_CheckIfUnseenRare_Male
+
+ChadOakGossip:
+ farjump ChadOakGossipScript
diff --git a/engine/phone/scripts/chad_gossip.asm b/engine/phone/scripts/chad_gossip.asm
new file mode 100644
index 000000000..e273e656d
--- /dev/null
+++ b/engine/phone/scripts/chad_gossip.asm
@@ -0,0 +1,62 @@
+ChadOakGossipScript:
+ random 10
+ ifequal 0, .Blue
+ ifequal 1, .Daisy
+ ifequal 2, .ProfElm
+ ifequal 3, .Dream
+ ifequal 4, .Kurt
+ ifequal 5, .League
+ ifequal 6, .RadioShow
+ ifequal 7, .Battling
+ ifequal 8, .DaisyTea
+ ifequal 9, .Traveled
+
+.Blue:
+ farwritetext ChadBlueGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Daisy:
+ farwritetext ChadDaisyGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.ProfElm:
+ farwritetext ChadProfElmGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Dream:
+ farwritetext ChadDreamGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Kurt:
+ farwritetext ChadKurtGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.League:
+ farwritetext ChadLeagueGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.RadioShow:
+ farwritetext ChadRadioShowGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Battling:
+ farwritetext ChadBattlingGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.DaisyTea:
+ farwritetext ChadDaisyTeaGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Traveled:
+ farwritetext ChadTravelGossipText
+ buttonsound
+ jump PhoneScript_HangupText_Male
diff --git a/engine/phone/scripts/dana.asm b/engine/phone/scripts/dana.asm
new file mode 100644
index 000000000..b072820a6
--- /dev/null
+++ b/engine/phone/scripts/dana.asm
@@ -0,0 +1,65 @@
+DanaPhoneCalleeScript:
+ trainertotext LASS, DANA1, MEM_BUFFER_0
+ checkflag ENGINE_DANA
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_DANA_THURSDAY_NIGHT
+ iftrue .NotThursday
+ checkflag ENGINE_DANA_HAS_THUNDERSTONE
+ iftrue .HasThunderstone
+ checkcode VAR_WEEKDAY
+ ifnotequal THURSDAY, .NotThursday
+ checktime NITE
+ iftrue DanaThursdayNight
+
+.NotThursday:
+ farjump UnknownScript_0xa0978
+
+.WantsBattle:
+ landmarktotext ROUTE_38, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a78
+
+.HasThunderstone:
+ landmarktotext ROUTE_38, MEM_BUFFER_2
+ farjump UnknownScript_0xa0acd
+
+DanaPhoneCallerScript:
+ trainertotext LASS, DANA1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_DANA
+ iftrue .Generic
+ checkflag ENGINE_DANA_THURSDAY_NIGHT
+ iftrue .Generic
+ checkflag ENGINE_DANA_HAS_THUNDERSTONE
+ iftrue .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, DanaWantsBattle
+ checkevent EVENT_DANA_GAVE_THUNDERSTONE
+ iftrue .Thunderstone
+ farscall PhoneScript_Random2
+ ifequal 0, DanaHasThunderstone
+
+.Thunderstone:
+ farscall PhoneScript_Random11
+ ifequal 0, DanaHasThunderstone
+
+.Generic:
+ farscall PhoneScript_Random3
+ ifequal 0, DanaFoundRare
+ farjump Phone_GenericCall_Female
+
+DanaThursdayNight:
+ setflag ENGINE_DANA_THURSDAY_NIGHT
+
+DanaWantsBattle:
+ landmarktotext ROUTE_38, MEM_BUFFER_2
+ setflag ENGINE_DANA
+ farjump PhoneScript_WantsToBattle_Female
+
+DanaFoundRare:
+ farjump Phone_CheckIfUnseenRare_Female
+
+DanaHasThunderstone:
+ setflag ENGINE_DANA_HAS_THUNDERSTONE
+ landmarktotext ROUTE_38, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Female
diff --git a/engine/phone/scripts/derek.asm b/engine/phone/scripts/derek.asm
new file mode 100644
index 000000000..95ff8bb76
--- /dev/null
+++ b/engine/phone/scripts/derek.asm
@@ -0,0 +1,48 @@
+DerekPhoneCalleeScript:
+ trainertotext POKEFANM, DEREK1, MEM_BUFFER_0
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_DEREK_HAS_NUGGET
+ iftrue .Nugget
+ farscall PhoneScript_Random2
+ ifequal 0, .NoContest
+ checkflag ENGINE_DAILY_BUG_CONTEST
+ iftrue .NoContest
+ checkcode VAR_WEEKDAY
+ ifequal TUESDAY, .ContestToday
+ ifequal THURSDAY, .ContestToday
+ ifequal SATURDAY, .ContestToday
+
+.NoContest:
+ farjump UnknownScript_0xa0988
+
+.ContestToday:
+ farjump PhoneScript_BugCatchingContest
+
+.Nugget:
+ landmarktotext ROUTE_39, MEM_BUFFER_2
+ farjump UnknownScript_0xa0ad5
+
+DerekPhoneCallerScript:
+ trainertotext POKEFANM, DEREK1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ farscall PhoneScript_Random2
+ ifequal 0, .NoContest
+ checkflag ENGINE_DAILY_BUG_CONTEST
+ iftrue .NoContest
+ checkcode VAR_WEEKDAY
+ ifequal TUESDAY, .ContestToday
+ ifequal THURSDAY, .ContestToday
+ ifequal SATURDAY, .ContestToday
+
+.NoContest:
+ farscall PhoneScript_Random4
+ ifequal 0, .Nugget
+ farjump Phone_GenericCall_Male
+
+.ContestToday:
+ farjump PhoneScript_BugCatchingContest
+
+.Nugget:
+ setflag ENGINE_DEREK_HAS_NUGGET
+ landmarktotext ROUTE_39, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Male
diff --git a/engine/phone/scripts/elm.asm b/engine/phone/scripts/elm.asm
new file mode 100644
index 000000000..2890a14b9
--- /dev/null
+++ b/engine/phone/scripts/elm.asm
@@ -0,0 +1,101 @@
+ElmPhoneCalleeScript:
+ checkcode VAR_SPECIALPHONECALL
+ ifequal SPECIALCALL_POKERUS, .pokerus
+ checkevent EVENT_SHOWED_TOGEPI_TO_ELM
+ iftrue .discovery
+ checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
+ iffalse .next
+ checkevent EVENT_TOGEPI_HATCHED
+ iftrue .egghatched
+.next
+ checkevent EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
+ iftrue .eggunhatched
+ checkevent EVENT_ELMS_AIDE_IN_LAB
+ iftrue .assistant
+ checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
+ iftrue .checkingegg
+ checkevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
+ iftrue .stolen
+ checkevent EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
+ iftrue .sawmrpokemon
+ farwritetext ElmPhoneStartText
+ end
+
+.sawmrpokemon
+ farwritetext ElmPhoneSawMrPokemonText
+ end
+
+.stolen
+ farwritetext ElmPhonePokemonStolenText
+ end
+
+.checkingegg
+ farwritetext ElmPhoneCheckingEggText
+ end
+
+.assistant
+ farwritetext ElmPhoneAssistantText
+ end
+
+.eggunhatched
+ farwritetext ElmPhoneEggUnhatchedText
+ end
+
+.egghatched
+ farwritetext ElmPhoneEggHatchedText
+ setevent EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE
+ end
+
+.discovery
+ random 2
+ ifequal 0, .nextdiscovery
+ farwritetext ElmPhoneDiscovery1Text
+ end
+
+.nextdiscovery
+ farwritetext ElmPhoneDiscovery2Text
+ end
+
+.pokerus
+ farwritetext ElmPhonePokerusText
+ specialphonecall SPECIALCALL_NONE
+ end
+
+ElmPhoneCallerScript:
+ checkcode VAR_SPECIALPHONECALL
+ ifequal SPECIALCALL_ROBBED, .disaster
+ ifequal SPECIALCALL_ASSISTANT, .assistant
+ ifequal SPECIALCALL_WEIRDBROADCAST, .rocket
+ ifequal SPECIALCALL_SSTICKET, .gift
+ ifequal SPECIALCALL_MASTERBALL, .gift
+ farwritetext ElmPhonePokerusText
+ specialphonecall SPECIALCALL_NONE
+ end
+
+.disaster
+ farwritetext ElmPhoneDisasterText
+ specialphonecall SPECIALCALL_NONE
+ setevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
+ end
+
+.assistant
+ farwritetext ElmPhoneEggAssistantText
+ specialphonecall SPECIALCALL_NONE
+ clearevent EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER
+ setevent EVENT_ELMS_AIDE_IN_LAB
+ end
+
+.rocket
+ farwritetext ElmPhoneRocketText
+ specialphonecall SPECIALCALL_NONE
+ end
+
+.gift
+ farwritetext ElmPhoneGiftText
+ specialphonecall SPECIALCALL_NONE
+ end
+
+.unused
+ farwritetext ElmPhoneUnusedText
+ specialphonecall SPECIALCALL_NONE
+ end
diff --git a/engine/phone/scripts/erin.asm b/engine/phone/scripts/erin.asm
new file mode 100644
index 000000000..1bf6f2154
--- /dev/null
+++ b/engine/phone/scripts/erin.asm
@@ -0,0 +1,40 @@
+ErinPhoneCalleeScript:
+ trainertotext PICNICKER, ERIN1, MEM_BUFFER_0
+ checkflag ENGINE_ERIN
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_ERIN_SATURDAY_NIGHT
+ iftrue .NotSaturday
+ checkcode VAR_WEEKDAY
+ ifnotequal SATURDAY, .NotSaturday
+ checktime NITE
+ iftrue ErinSaturdayNight
+
+.NotSaturday:
+ farjump ErinWorkingHardScript
+
+.WantsBattle:
+ landmarktotext ROUTE_46, MEM_BUFFER_2
+ farjump ErinComeBattleScript
+
+ErinPhoneCallerScript:
+ trainertotext PICNICKER, ERIN1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_ERIN
+ iftrue .GenericCall
+ checkflag ENGINE_ERIN_SATURDAY_NIGHT
+ iftrue .GenericCall
+ farscall PhoneScript_Random3
+ ifequal 0, ErinWantsBattle
+ ifequal 1, ErinWantsBattle
+
+.GenericCall:
+ farjump Phone_GenericCall_Female
+
+ErinSaturdayNight:
+ setflag ENGINE_ERIN_SATURDAY_NIGHT
+
+ErinWantsBattle:
+ landmarktotext ROUTE_46, MEM_BUFFER_2
+ setflag ENGINE_ERIN
+ farjump PhoneScript_WantsToBattle_Female
diff --git a/engine/phone/scripts/gaven.asm b/engine/phone/scripts/gaven.asm
new file mode 100644
index 000000000..bf4804e4e
--- /dev/null
+++ b/engine/phone/scripts/gaven.asm
@@ -0,0 +1,44 @@
+GavenPhoneCalleeScript:
+ trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0
+ checkflag ENGINE_GAVEN
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_GAVEN_THURSDAY_MORNING
+ iftrue .NotThursday
+ checkcode VAR_WEEKDAY
+ ifnotequal THURSDAY, .NotThursday
+ checktime MORN
+ iftrue GavenThursdayMorning
+
+.NotThursday:
+ farjump UnknownScript_0xa0910
+
+.WantsBattle:
+ landmarktotext ROUTE_26, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a37
+
+GavenPhoneCallerScript:
+ trainertotext COOLTRAINERM, GAVEN3, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_GAVEN
+ iftrue .WaitingForBattle
+ checkflag ENGINE_GAVEN_THURSDAY_MORNING
+ iftrue .WaitingForBattle
+ farscall PhoneScript_Random2
+ ifequal 0, GavenWantsRematch
+
+.WaitingForBattle:
+ farscall PhoneScript_Random3
+ ifequal 0, GavenFoundRare
+ farjump Phone_GenericCall_Male
+
+GavenThursdayMorning:
+ setflag ENGINE_GAVEN_THURSDAY_MORNING
+
+GavenWantsRematch:
+ landmarktotext ROUTE_26, MEM_BUFFER_2
+ setflag ENGINE_GAVEN
+ farjump PhoneScript_WantsToBattle_Male
+
+GavenFoundRare:
+ farjump Phone_CheckIfUnseenRare_Male
diff --git a/engine/phone/generic_calls.asm b/engine/phone/scripts/generic_callee.asm
index 407480d36..407480d36 100644
--- a/engine/phone/generic_calls.asm
+++ b/engine/phone/scripts/generic_callee.asm
diff --git a/engine/phone/phone_callers.asm b/engine/phone/scripts/generic_caller.asm
index a929ba1d8..a929ba1d8 100644
--- a/engine/phone/phone_callers.asm
+++ b/engine/phone/scripts/generic_caller.asm
diff --git a/engine/phone/scripts/gina.asm b/engine/phone/scripts/gina.asm
new file mode 100644
index 000000000..79514a46e
--- /dev/null
+++ b/engine/phone/scripts/gina.asm
@@ -0,0 +1,72 @@
+GinaPhoneCalleeScript:
+ trainertotext PICNICKER, GINA1, MEM_BUFFER_0
+ checkflag ENGINE_GINA
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_GINA_SUNDAY_AFTERNOON
+ iftrue .NotSunday
+ checkflag ENGINE_GINA_HAS_LEAF_STONE
+ iftrue .HasLeafStone
+ checkcode VAR_WEEKDAY
+ ifnotequal SUNDAY, .NotSunday
+ checktime DAY
+ iftrue GinaSundayDay
+
+.NotSunday:
+ checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
+ iftrue .Rockets
+ farjump UnknownScript_0xa0960
+
+.Rockets:
+ farjump UnknownScript_0xa05c6
+
+.WantsBattle:
+ landmarktotext ROUTE_34, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a69
+
+.HasLeafStone:
+ landmarktotext ROUTE_34, MEM_BUFFER_2
+ farjump UnknownScript_0xa0abd
+
+GinaPhoneCallerScript:
+ trainertotext PICNICKER, GINA1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
+ iftrue GinaRockets
+ checkflag ENGINE_GINA
+ iftrue .Generic
+ checkflag ENGINE_GINA_SUNDAY_AFTERNOON
+ iftrue .Generic
+ checkflag ENGINE_GINA_HAS_LEAF_STONE
+ iftrue .Generic
+ checkevent EVENT_GINA_GAVE_LEAF_STONE
+ iftrue .GaveLeafStone
+ farscall PhoneScript_Random2
+ ifequal 0, GinaHasLeafStone
+
+.GaveLeafStone:
+ farscall PhoneScript_Random11
+ ifequal 0, GinaHasLeafStone
+ checkflag ENGINE_FLYPOINT_GOLDENROD
+ iffalse .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, GinaWantsBattle
+
+.Generic:
+ farjump Phone_GenericCall_Female
+
+GinaSundayDay:
+ setflag ENGINE_GINA_SUNDAY_AFTERNOON
+
+GinaWantsBattle:
+ landmarktotext ROUTE_34, MEM_BUFFER_2
+ setflag ENGINE_GINA
+ farjump PhoneScript_WantsToBattle_Female
+
+GinaRockets:
+ farjump UnknownScript_0xa05c6
+
+GinaHasLeafStone:
+ setflag ENGINE_GINA_HAS_LEAF_STONE
+ landmarktotext ROUTE_34, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Female
diff --git a/engine/phone/scripts/hangups.asm b/engine/phone/scripts/hangups.asm
new file mode 100644
index 000000000..3dca4a0bb
--- /dev/null
+++ b/engine/phone/scripts/hangups.asm
@@ -0,0 +1,183 @@
+JackPhoneTips:
+ farwritetext UnknownText_0x1745c2
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0900:
+ farwritetext UnknownText_0x17485b
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0908:
+ farwritetext UnknownText_0x17496b
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0910:
+ farwritetext UnknownText_0x174c29
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0918:
+ farwritetext UnknownText_0x174ec5
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0920:
+ farwritetext UnknownText_0x17519b
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0928:
+ farwritetext UnknownText_0x17549b
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0930:
+ farwritetext UnknownText_0x17571d
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0938:
+ farwritetext UnknownText_0x175abe
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0940:
+ farwritetext UnknownText_0x175eaf
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0948:
+ farwritetext UnknownText_0x1768b0
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0950:
+ farwritetext UnknownText_0x176d32
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0958:
+ farwritetext UnknownText_0x1770fb
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0960:
+ farwritetext UnknownText_0x177465
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0968:
+ farwritetext UnknownText_0x64bc6
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0970:
+ farwritetext UnknownText_0x64e90
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0978:
+ farwritetext UnknownText_0x65161
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0980:
+ farwritetext UnknownText_0x65a23
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0988:
+ farwritetext UnknownText_0x65d5c
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0990:
+ farwritetext UnknownText_0x65ff2
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0998:
+ farwritetext UnknownText_0x6651e
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa09a0:
+ farwritetext UnknownText_0x66882
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+VanceLookingForward:
+ farwritetext VanceLookingForwardText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+WiltonHaventFoundAnything:
+ farwritetext WiltonHaventFoundAnythingText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+ParryBattleWithMe:
+ farwritetext ParryBattleWithMeText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+ErinWorkingHardScript:
+ farwritetext ErinWorkingHardText
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa09c8:
+ random 3
+ ifequal 0, UnknownScript_0xa09d6
+ ifequal 1, UnknownScript_0xa09de
+ ifequal 2, UnknownScript_0xa09e6
+
+UnknownScript_0xa09d6:
+ farwritetext UnknownText_0x64846
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa09de:
+ farwritetext UnknownText_0x64881
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa09e6:
+ farwritetext UnknownText_0x648dc
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+KenjiAnswerPhoneScript:
+ checkcode VAR_KENJI_BREAK
+ ifequal 2, .Training
+ ifequal 1, .OnBreak
+ farwritetext UnknownText_0x66e17
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Training:
+ farwritetext UnknownText_0x66e67
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.OnBreak:
+ checktime MORN
+ iftrue .Morning
+ checktime NITE
+ iftrue .Night
+ setevent EVENT_KENJI_ON_BREAK
+ farwritetext KenjiBreakText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Morning:
+ farwritetext UnknownText_0x66ed3
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Night:
+ farwritetext UnknownText_0x66f52
+ buttonsound
+ jump PhoneScript_HangupText_Male
diff --git a/engine/phone/scripts/hangups_2.asm b/engine/phone/scripts/hangups_2.asm
new file mode 100644
index 000000000..9aff4267c
--- /dev/null
+++ b/engine/phone/scripts/hangups_2.asm
@@ -0,0 +1,49 @@
+UnknownScript_0xa0aa5:
+ farwritetext UnknownText_0x174895
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0aad:
+ farwritetext UnknownText_0x17529c
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0ab5:
+ farwritetext UnknownText_0x175b6d
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0abd:
+ farwritetext UnknownText_0x17750e
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0ac5:
+ farwritetext UnknownText_0x64f1a
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0acd:
+ farwritetext UnknownText_0x6520f
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+UnknownScript_0xa0ad5:
+ farwritetext UnknownText_0x65da6
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0add:
+ farwritetext UnknownText_0x66087
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+UnknownScript_0xa0ae5:
+ farwritetext UnknownText_0x6691d
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+WiltonWantThis:
+ farwritetext WiltonWantThisText
+ buttonsound
+ jump PhoneScript_HangupText_Male
diff --git a/engine/phone/scripts/huey.asm b/engine/phone/scripts/huey.asm
new file mode 100644
index 000000000..e0398a62a
--- /dev/null
+++ b/engine/phone/scripts/huey.asm
@@ -0,0 +1,41 @@
+HueyPhoneCalleeScript:
+ trainertotext SAILOR, HUEY1, MEM_BUFFER_0
+ checkflag ENGINE_HUEY
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_HUEY_WEDNESDAY_NIGHT
+ iftrue .NotWednesday
+ checkcode VAR_WEEKDAY
+ ifnotequal WEDNESDAY, .NotWednesday
+ checktime NITE
+ iftrue HueyWednesdayNight
+
+.NotWednesday:
+ special RandomPhoneMon
+ farjump UnknownScript_0xa0908
+
+.WantsBattle:
+ landmarktotext LIGHTHOUSE, MEM_BUFFER_2
+ farjump HueyWantsBattleScript
+
+HueyPhoneCallerScript:
+ trainertotext SAILOR, HUEY1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_HUEY
+ iftrue .Flavor
+ checkflag ENGINE_HUEY_WEDNESDAY_NIGHT
+ iftrue .Flavor
+ farscall PhoneScript_Random3
+ ifequal 0, HueyWantsBattle
+ ifequal 1, HueyWantsBattle
+
+.Flavor:
+ farjump PhoneScript_MonFlavorText
+
+HueyWednesdayNight:
+ setflag ENGINE_HUEY_WEDNESDAY_NIGHT
+
+HueyWantsBattle:
+ landmarktotext LIGHTHOUSE, MEM_BUFFER_2
+ setflag ENGINE_HUEY
+ farjump PhoneScript_WantsToBattle_Male
diff --git a/engine/phone/scripts/irwin.asm b/engine/phone/scripts/irwin.asm
new file mode 100644
index 000000000..11e7198f0
--- /dev/null
+++ b/engine/phone/scripts/irwin.asm
@@ -0,0 +1,19 @@
+IrwinPhoneCalleeScript:
+ trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
+ iftrue .Rockets
+ farjump UnknownScript_0xa09c8
+
+.Rockets:
+ farjump IrwinRocketRumor
+
+IrwinPhoneCallerScript:
+ trainertotext JUGGLER, IRWIN1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
+ iftrue .Rockets
+ farjump IrwinRumorScript
+
+.Rockets:
+ farjump IrwinRocketRumor
diff --git a/engine/phone/scripts/irwin_gossip.asm b/engine/phone/scripts/irwin_gossip.asm
new file mode 100644
index 000000000..b7de916cd
--- /dev/null
+++ b/engine/phone/scripts/irwin_gossip.asm
@@ -0,0 +1,88 @@
+IrwinRumorScript:
+ checkevent EVENT_OPENED_MT_SILVER
+ iftrue .MtSilver
+ checkevent EVENT_FOUGHT_SNORLAX
+ iftrue .Snorlax
+ checkevent EVENT_GOT_PASS_FROM_COPYCAT
+ iftrue .TrainPass
+ checkflag ENGINE_MARSHBADGE
+ iftrue .MarshBadge
+ checkflag ENGINE_FLYPOINT_VERMILION
+ iftrue .VermilionCity
+ checkevent EVENT_BEAT_ELITE_FOUR
+ iftrue .EliteFour
+ checkflag ENGINE_RISINGBADGE
+ iftrue .RisingBadge
+ checkevent EVENT_CLEARED_RADIO_TOWER
+ iftrue .RadioTower
+ checkevent EVENT_CLEARED_ROCKET_HIDEOUT
+ iftrue .RocketHideout
+ checkevent EVENT_JASMINE_RETURNED_TO_GYM
+ iftrue .JasmineReturned
+ checkflag ENGINE_FOGBADGE
+ iftrue .FogBadge
+ checkflag ENGINE_PLAINBADGE
+ iftrue .PlainBadge
+ farwritetext IrwinCalledRightAwayText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.PlainBadge:
+ farwritetext UnknownText_0x64099
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.JasmineReturned:
+ farwritetext UnknownText_0x640e6
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.RocketHideout:
+ farwritetext UnknownText_0x6416d
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.RadioTower:
+ farwritetext UnknownText_0x641e8
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.RisingBadge:
+ farwritetext UnknownText_0x64247
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.EliteFour:
+ farwritetext UnknownText_0x642bb
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.VermilionCity:
+ farwritetext UnknownText_0x643d4
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.TrainPass:
+ farwritetext UnknownText_0x64448
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Snorlax:
+ farwritetext UnknownText_0x6455b
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.MtSilver:
+ farwritetext UnknownText_0x645ff
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.FogBadge:
+ farwritetext UnknownText_0x646df
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.MarshBadge:
+ farwritetext UnknownText_0x647d8
+ buttonsound
+ jump PhoneScript_HangupText_Male
diff --git a/engine/phone/scripts/jack.asm b/engine/phone/scripts/jack.asm
new file mode 100644
index 000000000..a02c3c36a
--- /dev/null
+++ b/engine/phone/scripts/jack.asm
@@ -0,0 +1,49 @@
+JackPhoneCalleeScript:
+ trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0
+ checkflag ENGINE_JACK
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_JACK_MONDAY_MORNING
+ iftrue .NotMonday
+ checkcode VAR_WEEKDAY
+ ifnotequal MONDAY, .NotMonday
+ checktime MORN
+ iftrue JackMondayMorning
+
+.NotMonday:
+ farjump JackPhoneTips
+
+.WantsBattle:
+ landmarktotext NATIONAL_PARK, MEM_BUFFER_2
+ farjump JackWantsBattleScript
+
+JackPhoneCallerScript:
+ trainertotext SCHOOLBOY, JACK1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ farscall PhoneScript_Random2
+ ifequal 0, JackBattleTrivia
+ checkflag ENGINE_JACK
+ iftrue .WaitingForBattle
+ checkflag ENGINE_JACK_MONDAY_MORNING
+ iftrue .WaitingForBattle
+ farscall PhoneScript_Random2
+ ifequal 0, JackWantsToBattle
+
+.WaitingForBattle:
+ farscall PhoneScript_Random3
+ ifequal 0, JackFindsRare
+ farjump Phone_GenericCall_Male
+
+JackMondayMorning:
+ setflag ENGINE_JACK_MONDAY_MORNING
+
+JackWantsToBattle:
+ landmarktotext NATIONAL_PARK, MEM_BUFFER_2
+ setflag ENGINE_JACK
+ farjump PhoneScript_WantsToBattle_Male
+
+JackFindsRare:
+ farjump Phone_CheckIfUnseenRare_Male
+
+JackBattleTrivia:
+ farjump JackTriviaScript
diff --git a/engine/phone/scripts/jack_gossip.asm b/engine/phone/scripts/jack_gossip.asm
new file mode 100644
index 000000000..41a0ba4c2
--- /dev/null
+++ b/engine/phone/scripts/jack_gossip.asm
@@ -0,0 +1,68 @@
+JackTriviaScript:
+ random 11
+ ifequal 0, .Thunder
+ ifequal 1, .Rollout
+ ifequal 2, .Solarbeam
+ ifequal 3, .Stomp
+ ifequal 4, .Gust
+ ifequal 5, .Twister
+ ifequal 6, .Earthquake
+ ifequal 7, .Magnitude
+ ifequal 8, .Sandstorm
+ ifequal 9, .SunnyDay
+ ifequal 10, .RainDance
+
+.Thunder:
+ farwritetext JackThunderTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Rollout:
+ farwritetext JackRolloutTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Solarbeam:
+ farwritetext JackSolarbeamTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Stomp:
+ farwritetext JackStompTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Gust:
+ farwritetext JackGustTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Twister:
+ farwritetext JackTwisterTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Earthquake:
+ farwritetext JackEarthquakeTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Magnitude:
+ farwritetext JackMagnitudeTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.Sandstorm:
+ farwritetext JackSandstormTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.SunnyDay:
+ farwritetext JackSunnyDayTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
+
+.RainDance:
+ farwritetext JackRainDanceTriviaText
+ buttonsound
+ jump PhoneScript_HangupText_Male
diff --git a/engine/phone/scripts/joey.asm b/engine/phone/scripts/joey.asm
new file mode 100644
index 000000000..0d2c6267a
--- /dev/null
+++ b/engine/phone/scripts/joey.asm
@@ -0,0 +1,41 @@
+JoeyPhoneCalleeScript:
+ trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0
+ checkflag ENGINE_JOEY
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_JOEY_MONDAY_AFTERNOON
+ iftrue .NotMonday
+ checkcode VAR_WEEKDAY
+ ifnotequal MONDAY, .NotMonday
+ checktime DAY
+ iftrue JoeyMondayAfternoon
+
+.NotMonday:
+ special RandomPhoneMon
+ farjump UnknownScript_0xa0930
+
+.WantsBattle:
+ landmarktotext ROUTE_30, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a4b
+
+JoeyPhoneCallerScript:
+ trainertotext YOUNGSTER, JOEY1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_JOEY
+ iftrue .Generic
+ checkflag ENGINE_JOEY_MONDAY_AFTERNOON
+ iftrue .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, JoeyWantsBattle
+ ifequal 1, JoeyWantsBattle
+
+.Generic:
+ farjump Phone_GenericCall_Male
+
+JoeyMondayAfternoon:
+ setflag ENGINE_JOEY_MONDAY_AFTERNOON
+
+JoeyWantsBattle:
+ landmarktotext ROUTE_30, MEM_BUFFER_2
+ setflag ENGINE_JOEY
+ farjump PhoneScript_WantsToBattle_Male
diff --git a/engine/phone/scripts/jose.asm b/engine/phone/scripts/jose.asm
new file mode 100644
index 000000000..38bd0a99f
--- /dev/null
+++ b/engine/phone/scripts/jose.asm
@@ -0,0 +1,59 @@
+JosePhoneCalleeScript:
+ trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0
+ checkflag ENGINE_JOSE
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_JOSE_SATURDAY_NIGHT
+ iftrue .NotSaturday
+ checkflag ENGINE_JOSE_HAS_STAR_PIECE
+ iftrue .HasItem
+ checkcode VAR_WEEKDAY
+ ifnotequal SATURDAY, .NotSaturday
+ checktime NITE
+ iftrue JoseSaturdayNight
+
+.NotSaturday:
+ farjump UnknownScript_0xa0920
+
+.WantsBattle:
+ landmarktotext ROUTE_27, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a41
+
+.HasItem:
+ landmarktotext ROUTE_27, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a41
+
+JosePhoneCallerScript:
+ trainertotext BIRD_KEEPER, JOSE2, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_JOSE
+ iftrue .Generic
+ checkflag ENGINE_JOSE_SATURDAY_NIGHT
+ iftrue .Generic
+ checkflag ENGINE_JOSE_HAS_STAR_PIECE
+ iftrue .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, JoseWantsBattle
+ farscall PhoneScript_Random3
+ ifequal 0, JoseHasStarPiece
+
+.Generic:
+ farscall PhoneScript_Random3
+ ifequal 0, JoseFoundRare
+ farjump Phone_GenericCall_Male
+
+JoseSaturdayNight:
+ setflag ENGINE_JOSE_SATURDAY_NIGHT
+
+JoseWantsBattle:
+ landmarktotext ROUTE_27, MEM_BUFFER_2
+ setflag ENGINE_JOSE
+ farjump PhoneScript_WantsToBattle_Male
+
+JoseFoundRare:
+ farjump Phone_CheckIfUnseenRare_Male
+
+JoseHasStarPiece:
+ setflag ENGINE_JOSE_HAS_STAR_PIECE
+ landmarktotext ROUTE_27, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Male
diff --git a/engine/phone/scripts/kenji.asm b/engine/phone/scripts/kenji.asm
new file mode 100644
index 000000000..3888afbfd
--- /dev/null
+++ b/engine/phone/scripts/kenji.asm
@@ -0,0 +1,9 @@
+KenjiPhoneCalleeScript:
+ trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0
+ farscall PhoneScript_AnswerPhone_Male
+ farjump KenjiAnswerPhoneScript
+
+KenjiPhoneCallerScript:
+ trainertotext BLACKBELT_T, KENJI3, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ farjump KenjiCallingPhoneScript
diff --git a/engine/phone/scripts/liz.asm b/engine/phone/scripts/liz.asm
new file mode 100644
index 000000000..31df3d4e9
--- /dev/null
+++ b/engine/phone/scripts/liz.asm
@@ -0,0 +1,102 @@
+LizPhoneCalleeScript:
+ trainertotext PICNICKER, LIZ1, MEM_BUFFER_0
+ checkflag ENGINE_LIZ
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_LIZ_THURSDAY_AFTERNOON
+ iftrue .NotThursday
+ checkcode VAR_WEEKDAY
+ ifnotequal THURSDAY, .NotThursday
+ checktime DAY
+ iftrue LizThursdayAfternoon
+
+.NotThursday:
+ special RandomPhoneMon
+ farjump UnknownScript_0xa0948
+
+.WantsBattle:
+ landmarktotext ROUTE_32, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a5a
+
+LizPhoneCallerScript:
+ trainertotext PICNICKER, LIZ1, MEM_BUFFER_0
+ farscall PhoneScript_Random4
+ ifequal 0, LizWrongNumber
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_LIZ
+ iftrue .next
+ checkflag ENGINE_LIZ_THURSDAY_AFTERNOON
+ iftrue .next
+
+.next:
+ farscall PhoneScript_Random2
+ ifequal 0, LizGossip
+ checkflag ENGINE_FLYPOINT_GOLDENROD
+ iffalse .Generic
+ farscall PhoneScript_Random2
+ ifequal 0, LizWantsBattle
+
+.Generic:
+ farjump Phone_GenericCall_Female
+
+LizThursdayAfternoon:
+ setflag ENGINE_LIZ_THURSDAY_AFTERNOON
+
+LizWantsBattle:
+ landmarktotext ROUTE_32, MEM_BUFFER_2
+ setflag ENGINE_LIZ
+ farjump PhoneScript_WantsToBattle_Female
+
+LizWrongNumber:
+ farjump LizWrongNumberScript
+
+LizGossip:
+ random 9
+ ifequal 0, .CoolTrainerM
+ ifequal 1, .Beauty
+ ifequal 2, .Grunt
+ ifequal 3, .Teacher
+ ifequal 4, .SwimmerF
+ ifequal 5, .KimonoGirl
+ ifequal 6, .Skier
+ ifequal 7, .Medium
+ ifequal 8, .PokefanM
+
+.CoolTrainerM:
+ trainerclassname COOLTRAINERM, NICK
+ jump LizGossipScript
+
+.Beauty:
+ trainerclassname BEAUTY, VICTORIA
+ jump LizGossipScript
+
+.Grunt:
+ trainerclassname GRUNTM, GRUNTM_1
+ jump LizGossipScript
+
+.Teacher:
+ trainerclassname TEACHER, COLETTE
+ jump LizGossipScript
+
+.SwimmerF:
+ trainerclassname SWIMMERF, ELAINE
+ jump LizGossipScript
+
+.KimonoGirl:
+ trainerclassname KIMONO_GIRL, NAOKO1
+ jump LizGossipScript
+
+.Skier:
+ trainerclassname SKIER, ROXANNE
+ jump LizGossipScript
+
+.Medium:
+ trainerclassname MEDIUM, MARTHA
+ jump LizGossipScript
+
+.PokefanM:
+ trainerclassname POKEFANM, WILLIAM
+ jump LizGossipScript
+
+LizGossipScript:
+ farjump UnknownScript_0xa06da
diff --git a/engine/phone/scripts/liz_gossip.asm b/engine/phone/scripts/liz_gossip.asm
new file mode 100644
index 000000000..bb76813c1
--- /dev/null
+++ b/engine/phone/scripts/liz_gossip.asm
@@ -0,0 +1,62 @@
+UnknownScript_0xa06da:
+ random 10
+ ifequal 0, .RuinsOfAlph
+ ifequal 1, .Falkner
+ ifequal 2, .Earl
+ ifequal 3, .SurfPikachu
+ ifequal 4, .MooMooMilk
+ ifequal 5, .Salon
+ ifequal 6, .Whitney
+ ifequal 7, .BugCatchingContest
+ ifequal 8, .BeautifulMon
+ ifequal 9, .Forgot
+
+.RuinsOfAlph:
+ farwritetext UnknownText_0x176223
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.Falkner:
+ farwritetext UnknownText_0x1762c3
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.Earl:
+ farwritetext UnknownText_0x17638a
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.SurfPikachu:
+ farwritetext UnknownText_0x176424
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.MooMooMilk:
+ farwritetext UnknownText_0x1764eb
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.Salon:
+ farwritetext UnknownText_0x176599
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.Whitney:
+ farwritetext UnknownText_0x1766ac
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.BugCatchingContest:
+ farwritetext UnknownText_0x17674f
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.BeautifulMon:
+ farwritetext UnknownText_0x176816
+ buttonsound
+ jump PhoneScript_HangupText_Female
+
+.Forgot:
+ farwritetext UnknownText_0x17686d
+ buttonsound
+ jump PhoneScript_HangupText_Female
diff --git a/engine/phone/scripts/mom.asm b/engine/phone/scripts/mom.asm
new file mode 100644
index 000000000..9b8e1fcf3
--- /dev/null
+++ b/engine/phone/scripts/mom.asm
@@ -0,0 +1,142 @@
+MomPhoneCalleeScript:
+ checkevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
+ iftrue .bcec5
+ checkevent EVENT_DUDE_TALKED_TO_YOU
+ iftrue MomPhoneLectureScript
+ checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
+ iftrue MomPhoneNoGymQuestScript
+ checkevent EVENT_GOT_A_POKEMON_FROM_ELM
+ iftrue MomPhoneNoPokedexScript
+ jump MomPhoneNoPokemonScript
+
+.bcec5
+ checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_8
+ iftrue MomPhoneHangUpScript
+ farwritetext MomPhoneGreetingText
+ buttonsound
+ mapnametotext MEM_BUFFER_0
+ checkcode VAR_ROOFPALETTE
+ ifequal 1, MomPhonePalette1
+ ifequal 2, MomPhonePalette2
+ jump MomPhoneOther
+
+MomPhoneLandmark:
+ farwritetext MomPhoneLandmarkText
+ buttonsound
+ jump MomSavingMoney
+
+MomPhonePalette1:
+ checkcode VAR_MAPGROUP
+ ifequal GROUP_NEW_BARK_TOWN, .newbark
+ ifequal GROUP_CHERRYGROVE_CITY, .cherrygrove
+ ifequal GROUP_VIOLET_CITY, .violet
+ ifequal GROUP_AZALEA_TOWN, .azalea
+ ifequal GROUP_GOLDENROD_CITY, .goldenrod
+ farwritetext MomPhoneGenericAreaText
+ buttonsound
+ jump MomSavingMoney
+
+.newbark
+ farwritetext MomPhoneNewBarkText
+ buttonsound
+ jump MomSavingMoney
+
+.cherrygrove
+ farwritetext MomPhoneCherrygroveText
+ buttonsound
+ jump MomSavingMoney
+
+.violet
+ landmarktotext SPROUT_TOWER, MEM_BUFFER_1
+ jump MomPhoneLandmark
+.azalea
+ landmarktotext SLOWPOKE_WELL, MEM_BUFFER_1
+ jump MomPhoneLandmark
+.goldenrod
+ landmarktotext RADIO_TOWER, MEM_BUFFER_1
+ jump MomPhoneLandmark
+
+MomPhonePalette2:
+ farwritetext MomOtherAreaText
+ buttonsound
+ jump MomSavingMoney
+
+MomPhoneOther:
+ farwritetext MomDeterminedText
+ buttonsound
+ jump MomSavingMoney
+
+MomSavingMoney:
+ checkflag ENGINE_MOM_SAVING_MONEY
+ iffalse .NotSaving
+ checkmoney MOMS_MONEY, 0
+ ifequal HAVE_MORE, .SavingHasMoney
+ jump .SavingNoMoney
+
+.NotSaving:
+ checkmoney MOMS_MONEY, 0
+ ifequal HAVE_MORE, .HasMoney
+ jump .NoMoney
+
+.SavingHasMoney:
+ readmoney MOMS_MONEY, MEM_BUFFER_0
+ farwritetext MomCheckBalanceText
+ yesorno
+ iftrue MomPhoneSaveMoneyScript
+ jump MomPhoneWontSaveMoneyScript
+
+.SavingNoMoney:
+ farwritetext MomImportantToSaveText
+ yesorno
+ iftrue MomPhoneSaveMoneyScript
+ jump MomPhoneWontSaveMoneyScript
+
+.NoMoney:
+ farwritetext MomYoureNotSavingText
+ yesorno
+ iftrue MomPhoneSaveMoneyScript
+ jump MomPhoneWontSaveMoneyScript
+
+.HasMoney:
+ readmoney MOMS_MONEY, MEM_BUFFER_0
+ farwritetext MomYouveSavedText
+ yesorno
+ iftrue MomPhoneSaveMoneyScript
+ jump MomPhoneWontSaveMoneyScript
+
+MomPhoneSaveMoneyScript:
+ setflag ENGINE_MOM_SAVING_MONEY
+ farwritetext MomOKIllSaveText
+ buttonsound
+ jump MomPhoneHangUpScript
+
+MomPhoneWontSaveMoneyScript:
+ clearflag ENGINE_MOM_SAVING_MONEY
+ farwritetext MomPhoneWontSaveMoneyText
+ buttonsound
+ jump MomPhoneHangUpScript
+
+MomPhoneHangUpScript:
+ farwritetext MomPhoneHangUpText
+ end
+
+MomPhoneNoPokemonScript:
+ farwritetext MomPhoneNoPokemonText
+ end
+
+MomPhoneNoPokedexScript:
+ farwritetext MomPhoneNoPokedexText
+ end
+
+MomPhoneNoGymQuestScript:
+ farwritetext MomPhoneNoGymQuestText
+ end
+
+MomPhoneLectureScript:
+ setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
+ setflag ENGINE_MOM_ACTIVE
+ specialphonecall SPECIALCALL_NONE
+ farwritetext MomPhoneLectureText
+ yesorno
+ iftrue MomPhoneSaveMoneyScript
+ jump MomPhoneWontSaveMoneyScript
diff --git a/engine/phone/scripts/parry.asm b/engine/phone/scripts/parry.asm
new file mode 100644
index 000000000..0ab95ad9f
--- /dev/null
+++ b/engine/phone/scripts/parry.asm
@@ -0,0 +1,40 @@
+ParryPhoneCalleeScript:
+ trainertotext HIKER, PARRY1, MEM_BUFFER_0
+ checkflag ENGINE_PARRY
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_PARRY_FRIDAY_AFTERNOON
+ iftrue .WantsRematch
+ checkcode VAR_WEEKDAY
+ ifnotequal FRIDAY, .WantsRematch
+ checktime DAY
+ iftrue ParryFridayDay
+
+.WantsRematch:
+ farjump ParryBattleWithMe
+
+.WantsBattle:
+ landmarktotext ROUTE_45, MEM_BUFFER_2
+ farjump ParryHaventYouGottenTo
+
+ParryPhoneCallerScript:
+ trainertotext HIKER, PARRY1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_PARRY
+ iftrue .GenericCall
+ checkflag ENGINE_PARRY_FRIDAY_AFTERNOON
+ iftrue .GenericCall
+ farscall PhoneScript_Random2
+ ifequal 0, ParryWantsBattle
+ ifequal 1, ParryWantsBattle
+
+.GenericCall:
+ farjump Phone_GenericCall_Male
+
+ParryFridayDay:
+ setflag ENGINE_PARRY_FRIDAY_AFTERNOON
+
+ParryWantsBattle:
+ landmarktotext ROUTE_45, MEM_BUFFER_2
+ setflag ENGINE_PARRY
+ farjump PhoneScript_WantsToBattle_Male
diff --git a/engine/phone/scripts/ralph.asm b/engine/phone/scripts/ralph.asm
new file mode 100644
index 000000000..0baf77b33
--- /dev/null
+++ b/engine/phone/scripts/ralph.asm
@@ -0,0 +1,59 @@
+RalphPhoneCalleeScript:
+ trainertotext FISHER, RALPH1, MEM_BUFFER_0
+ checkflag ENGINE_RALPH
+ iftrue .Rematch
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_RALPH_WEDNESDAY_MORNING
+ iftrue .CheckSwarm
+ checkcode VAR_WEEKDAY
+ ifnotequal WEDNESDAY, .CheckSwarm
+ checktime MORN
+ iftrue Ralph_WednesdayMorning
+.CheckSwarm:
+ checkflag ENGINE_FISH_SWARM
+ iftrue .ReportSwarm
+ farjump UnknownScript_0xa0940
+
+.Rematch:
+ landmarktotext ROUTE_32, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a55
+
+.ReportSwarm:
+ landmarktotext ROUTE_32, MEM_BUFFER_2
+ farjump UnknownScript_0xa0af5
+
+RalphPhoneCallerScript:
+ trainertotext FISHER, RALPH1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_FLYPOINT_GOLDENROD
+ iffalse .CheckSwarm
+ checkflag ENGINE_RALPH
+ iftrue .CheckSwarm
+ checkflag ENGINE_RALPH_WEDNESDAY_MORNING
+ iftrue .CheckSwarm
+ farscall PhoneScript_Random2
+ ifequal 0, Ralph_FightMe
+.CheckSwarm:
+ farscall PhoneScript_Random5
+ ifequal 0, Ralph_SetUpSwarm
+ farjump Phone_GenericCall_Male
+
+Ralph_WednesdayMorning:
+ setflag ENGINE_RALPH_WEDNESDAY_MORNING
+Ralph_FightMe:
+ landmarktotext ROUTE_32, MEM_BUFFER_2
+ setflag ENGINE_RALPH
+ farjump PhoneScript_WantsToBattle_Male
+
+Ralph_SetUpSwarm:
+ checkflag ENGINE_FISH_SWARM
+ iftrue .Generic
+ setflag ENGINE_FISH_SWARM
+ pokenamemem QWILFISH, MEM_BUFFER_1
+ landmarktotext ROUTE_32, MEM_BUFFER_2
+ writebyte FISHSWARM_QWILFISH
+ special ActivateFishingSwarm
+ farjump UnknownScript_0xa05d6
+
+.Generic:
+ farjump Phone_GenericCall_Male
diff --git a/engine/phone/scripts/reena.asm b/engine/phone/scripts/reena.asm
new file mode 100644
index 000000000..a90f8e669
--- /dev/null
+++ b/engine/phone/scripts/reena.asm
@@ -0,0 +1,39 @@
+ReenaPhoneCalleeScript:
+ trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0
+ checkflag ENGINE_REENA
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_REENA_SUNDAY_MORNING
+ iftrue .NotSunday
+ checkcode VAR_WEEKDAY
+ ifnotequal SUNDAY, .NotSunday
+ checktime MORN
+ iftrue ReenaSundayMorning
+
+.NotSunday:
+ farjump UnknownScript_0xa0928
+
+.WantsBattle:
+ landmarktotext ROUTE_27, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a46
+
+ReenaPhoneCallerScript:
+ trainertotext COOLTRAINERF, REENA1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_REENA
+ iftrue .Generic
+ checkflag ENGINE_REENA_SUNDAY_MORNING
+ iftrue .Generic
+ farscall PhoneScript_Random2
+ ifequal 0, ReenaWantsBattle
+
+.Generic:
+ farjump Phone_GenericCall_Female
+
+ReenaSundayMorning:
+ setflag ENGINE_REENA_SUNDAY_MORNING
+
+ReenaWantsBattle:
+ landmarktotext ROUTE_27, MEM_BUFFER_2
+ setflag ENGINE_REENA
+ farjump PhoneScript_WantsToBattle_Female
diff --git a/engine/phone/scripts/reminders.asm b/engine/phone/scripts/reminders.asm
new file mode 100644
index 000000000..d93418d36
--- /dev/null
+++ b/engine/phone/scripts/reminders.asm
@@ -0,0 +1,95 @@
+JackWantsBattleScript:
+ farwritetext UnknownText_0x174638
+ end
+
+HueyWantsBattleScript:
+ farwritetext UnknownText_0x1749c7
+ end
+
+UnknownScript_0xa0a37:
+ farwritetext UnknownText_0x174c49
+ end
+
+BethBattleReminderScript:
+ farwritetext BethForgetDealText
+ end
+
+UnknownScript_0xa0a41:
+ farwritetext UnknownText_0x17520a
+ end
+
+UnknownScript_0xa0a46:
+ farwritetext UnknownText_0x1754e5
+ end
+
+UnknownScript_0xa0a4b:
+ farwritetext UnknownText_0x175786
+ end
+
+UnknownScript_0xa0a50:
+ farwritetext UnknownText_0x175b1e
+ end
+
+UnknownScript_0xa0a55:
+ farwritetext UnknownText_0x175f11
+ end
+
+UnknownScript_0xa0a5a:
+ farwritetext UnknownText_0x1769da
+ end
+
+UnknownScript_0xa0a5f:
+ farwritetext UnknownText_0x176d85
+ end
+
+UnknownScript_0xa0a64:
+ farwritetext UnknownText_0x177138
+ end
+
+UnknownScript_0xa0a69:
+ farwritetext UnknownText_0x1774c1
+ end
+
+UnknownScript_0xa0a6e:
+ farwritetext UnknownText_0x64c13
+ end
+
+UnknownScript_0xa0a73:
+ farwritetext UnknownText_0x64ed4
+ end
+
+UnknownScript_0xa0a78:
+ farwritetext UnknownText_0x651bf
+ end
+
+UnknownScript_0xa0a7d:
+ farwritetext UnknownText_0x65a63
+ end
+
+UnknownScript_0xa0a82:
+ farwritetext UnknownText_0x66043
+ end
+
+UnknownScript_0xa0a87:
+ farwritetext UnknownText_0x66579
+ end
+
+UnknownScript_0xa0a8c:
+ farwritetext UnknownText_0x668a3
+ end
+
+VanceHurryHurry:
+ farwritetext VanceHurryHurryText
+ end
+
+WiltonNotBiting:
+ farwritetext WiltonNotBitingText
+ end
+
+ParryHaventYouGottenTo:
+ farwritetext ParryHaventYouGottenToText
+ end
+
+ErinComeBattleScript:
+ farwritetext ErinComeBattleText
+ end
diff --git a/engine/phone/scripts/reminders_2.asm b/engine/phone/scripts/reminders_2.asm
new file mode 100644
index 000000000..9cbc5cfd7
--- /dev/null
+++ b/engine/phone/scripts/reminders_2.asm
@@ -0,0 +1,15 @@
+UnknownScript_0xa0af5:
+ farwritetext UnknownText_0x175f70
+ end
+
+UnknownScript_0xa0afa:
+ farwritetext UnknownText_0x176dd1
+ end
+
+UnknownScript_0xa0aff:
+ farwritetext UnknownText_0x64c5a
+ end
+
+UnknownScript_0xa0b04:
+ farwritetext UnknownText_0x17717c
+ end
diff --git a/engine/phone/scripts/tiffany.asm b/engine/phone/scripts/tiffany.asm
new file mode 100644
index 000000000..967f97135
--- /dev/null
+++ b/engine/phone/scripts/tiffany.asm
@@ -0,0 +1,98 @@
+TiffanyPhoneCalleeScript:
+ trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0
+ checkflag ENGINE_TIFFANY
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Female
+ checkflag ENGINE_TIFFANY_TUESDAY_AFTERNOON
+ iftrue .NotTuesday
+ checkflag ENGINE_TIFFANY_HAS_PINK_BOW
+ iftrue .HasItem
+ checkcode VAR_WEEKDAY
+ ifnotequal TUESDAY, .NotTuesday
+ checktime DAY
+ iftrue TiffanyTuesdayAfternoon
+
+.NotTuesday:
+ farjump UnknownScript_0xa09a0
+
+.WantsBattle:
+ landmarktotext ROUTE_43, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a8c
+
+.HasItem:
+ landmarktotext ROUTE_43, MEM_BUFFER_2
+ farjump UnknownScript_0xa0ae5
+
+TiffanyPhoneCallerScript:
+ trainertotext PICNICKER, TIFFANY3, MEM_BUFFER_0
+ farscall PhoneScript_Random4
+ ifequal 0, TiffanysFamilyMembers
+ farscall PhoneScript_GreetPhone_Female
+ checkflag ENGINE_TIFFANY
+ iftrue .Generic
+ checkflag ENGINE_TIFFANY_TUESDAY_AFTERNOON
+ iftrue .Generic
+ checkflag ENGINE_TIFFANY_HAS_PINK_BOW
+ iftrue .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, TiffanyWantsBattle
+ checkevent EVENT_TIFFANY_GAVE_PINK_BOW
+ iftrue .PinkBow
+ farscall PhoneScript_Random2
+ ifequal 0, TiffanyHasPinkBow
+
+.PinkBow:
+ farscall PhoneScript_Random11
+ ifequal 0, TiffanyHasPinkBow
+
+.Generic:
+ farjump Phone_GenericCall_Female
+
+TiffanyTuesdayAfternoon:
+ setflag ENGINE_TIFFANY_TUESDAY_AFTERNOON
+
+TiffanyWantsBattle:
+ landmarktotext ROUTE_43, MEM_BUFFER_2
+ setflag ENGINE_TIFFANY
+ farjump PhoneScript_WantsToBattle_Female
+
+TiffanysFamilyMembers:
+ random 6
+ ifequal 0, .Grandma
+ ifequal 1, .Grandpa
+ ifequal 2, .Mom
+ ifequal 3, .Dad
+ ifequal 4, .Sister
+ ifequal 5, .Brother
+
+.Grandma:
+ stringtotext GrandmaString, MEM_BUFFER_1
+ jump .PoorClefairy
+
+.Grandpa:
+ stringtotext GrandpaString, MEM_BUFFER_1
+ jump .PoorClefairy
+
+.Mom:
+ stringtotext MomString, MEM_BUFFER_1
+ jump .PoorClefairy
+
+.Dad:
+ stringtotext DadString, MEM_BUFFER_1
+ jump .PoorClefairy
+
+.Sister:
+ stringtotext SisterString, MEM_BUFFER_1
+ jump .PoorClefairy
+
+.Brother:
+ stringtotext BrotherString, MEM_BUFFER_1
+ jump .PoorClefairy
+
+.PoorClefairy:
+ farjump TiffanyItsAwful
+
+TiffanyHasPinkBow:
+ setflag ENGINE_TIFFANY_HAS_PINK_BOW
+ landmarktotext ROUTE_43, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Female
diff --git a/engine/phone/scripts/todd.asm b/engine/phone/scripts/todd.asm
new file mode 100644
index 000000000..3aafb740a
--- /dev/null
+++ b/engine/phone/scripts/todd.asm
@@ -0,0 +1,59 @@
+ToddPhoneCalleeScript:
+ trainertotext CAMPER, TODD1, MEM_BUFFER_0
+ checkflag ENGINE_TODD
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_TODD_SATURDAY_MORNING
+ iftrue .NotSaturday
+ checkcode VAR_WEEKDAY
+ ifnotequal SATURDAY, .NotSaturday
+ checktime MORN
+ iftrue ToddSaturdayMorning
+
+.NotSaturday:
+ checkflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
+ iftrue .SaleOn
+ farjump UnknownScript_0xa0958
+
+.WantsBattle:
+ landmarktotext ROUTE_34, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a64
+
+.SaleOn:
+ farjump UnknownScript_0xa0b04
+
+ToddPhoneCallerScript:
+ trainertotext CAMPER, TODD1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_TODD
+ iftrue .TryForSale
+ checkflag ENGINE_TODD_SATURDAY_MORNING
+ iftrue .TryForSale
+ checkflag ENGINE_FLYPOINT_GOLDENROD
+ iffalse .NoGoldenrod
+ farscall PhoneScript_Random2
+ ifequal 0, ToddWantsBattle
+
+.TryForSale:
+ farscall PhoneScript_Random2
+ ifequal 0, ToddDeptStoreSale
+
+.NoGoldenrod:
+ farscall PhoneScript_Random3
+ ifequal 0, ToddFoundRare
+ farjump Phone_GenericCall_Male
+
+ToddSaturdayMorning:
+ setflag ENGINE_TODD_SATURDAY_MORNING
+
+ToddWantsBattle:
+ landmarktotext ROUTE_34, MEM_BUFFER_2
+ setflag ENGINE_TODD
+ farjump PhoneScript_WantsToBattle_Male
+
+ToddFoundRare:
+ farjump Phone_CheckIfUnseenRare_Male
+
+ToddDeptStoreSale:
+ setflag ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
+ farjump UnknownScript_0xa0644
diff --git a/engine/phone/scripts/tully.asm b/engine/phone/scripts/tully.asm
new file mode 100644
index 000000000..b6bf84ba7
--- /dev/null
+++ b/engine/phone/scripts/tully.asm
@@ -0,0 +1,60 @@
+TullyPhoneCalleeScript:
+ trainertotext FISHER, TULLY1, MEM_BUFFER_0
+ checkflag ENGINE_TULLY
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_TULLY_SUNDAY_NIGHT
+ iftrue .NotSunday
+ checkflag ENGINE_TULLY_HAS_WATER_STONE
+ iftrue .WaterStone
+ checkcode VAR_WEEKDAY
+ ifnotequal SUNDAY, .NotSunday
+ checktime NITE
+ iftrue TullySundayNight
+
+.NotSunday:
+ farjump UnknownScript_0xa0990
+
+.WantsBattle:
+ landmarktotext ROUTE_42, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a82
+
+.WaterStone:
+ landmarktotext ROUTE_42, MEM_BUFFER_2
+ farjump UnknownScript_0xa0add
+
+TullyPhoneCallerScript:
+ trainertotext FISHER, TULLY1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_TULLY
+ iftrue .Generic
+ checkflag ENGINE_TULLY_SUNDAY_NIGHT
+ iftrue .Generic
+ checkflag ENGINE_TULLY_HAS_WATER_STONE
+ iftrue .Generic
+ farscall PhoneScript_Random3
+ ifequal 0, TullyWantsBattle
+ checkevent EVENT_TULLY_GAVE_WATER_STONE
+ iftrue .WaterStone
+ farscall PhoneScript_Random2
+ ifequal 0, TullyFoundWaterStone
+
+.WaterStone:
+ farscall PhoneScript_Random11
+ ifequal 0, TullyFoundWaterStone
+
+.Generic:
+ farjump Phone_GenericCall_Male
+
+TullySundayNight:
+ setflag ENGINE_TULLY_SUNDAY_NIGHT
+
+TullyWantsBattle:
+ landmarktotext ROUTE_42, MEM_BUFFER_2
+ setflag ENGINE_TULLY
+ farjump PhoneScript_WantsToBattle_Male
+
+TullyFoundWaterStone:
+ setflag ENGINE_TULLY_HAS_WATER_STONE
+ landmarktotext ROUTE_42, MEM_BUFFER_2
+ farjump PhoneScript_FoundItem_Male
diff --git a/engine/phone/scripts/unused.asm b/engine/phone/scripts/unused.asm
new file mode 100644
index 000000000..b6b2531b1
--- /dev/null
+++ b/engine/phone/scripts/unused.asm
@@ -0,0 +1,3 @@
+UnusedPhoneScript:
+ farwritetext UnusedPhoneText
+ end
diff --git a/engine/phone/scripts/vance.asm b/engine/phone/scripts/vance.asm
new file mode 100644
index 000000000..8410289cb
--- /dev/null
+++ b/engine/phone/scripts/vance.asm
@@ -0,0 +1,40 @@
+VancePhoneCalleeScript:
+ trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0
+ checkflag ENGINE_VANCE
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_VANCE_WEDNESDAY_NIGHT
+ iftrue .NotWednesday
+ checkcode VAR_WEEKDAY
+ ifnotequal WEDNESDAY, .NotWednesday
+ checktime NITE
+ iftrue VanceWednesdayNight
+
+.NotWednesday:
+ farjump VanceLookingForward
+
+.WantsBattle:
+ landmarktotext ROUTE_44, MEM_BUFFER_2
+ farjump VanceHurryHurry
+
+VancePhoneCallerScript:
+ trainertotext BIRD_KEEPER, VANCE1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_VANCE
+ iftrue .WantsBattle
+ checkflag ENGINE_VANCE_WEDNESDAY_NIGHT
+ iftrue .WantsBattle
+ farscall PhoneScript_Random3
+ ifequal 0, VanceWantsRematch
+ ifequal 1, VanceWantsRematch
+
+.WantsBattle:
+ farjump Phone_GenericCall_Male
+
+VanceWednesdayNight:
+ setflag ENGINE_VANCE_WEDNESDAY_NIGHT
+
+VanceWantsRematch:
+ landmarktotext ROUTE_44, MEM_BUFFER_2
+ setflag ENGINE_VANCE
+ farjump PhoneScript_WantsToBattle_Male
diff --git a/engine/phone/scripts/wade.asm b/engine/phone/scripts/wade.asm
new file mode 100644
index 000000000..31931f06a
--- /dev/null
+++ b/engine/phone/scripts/wade.asm
@@ -0,0 +1,113 @@
+WadePhoneCalleeScript:
+ trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0
+ checkflag ENGINE_WADE
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_WADE_TUESDAY_NIGHT
+ iftrue .NotTuesday
+ checkflag ENGINE_WADE_HAS_ITEM
+ iftrue .HasItem
+ checkcode VAR_WEEKDAY
+ ifnotequal TUESDAY, .NotTuesday
+ checktime NITE
+ iftrue WadeTuesdayNight
+
+.NotTuesday:
+ farscall PhoneScript_Random2
+ ifequal 0, .NoContest
+ checkflag ENGINE_DAILY_BUG_CONTEST
+ iftrue .NoContest
+ checkcode VAR_WEEKDAY
+ ifequal TUESDAY, .ContestToday
+ ifequal THURSDAY, .ContestToday
+ ifequal SATURDAY, .ContestToday
+
+.NoContest:
+ farjump UnknownScript_0xa0938
+
+.ContestToday:
+ farjump PhoneScript_BugCatchingContest
+
+.WantsBattle:
+ landmarktotext ROUTE_31, MEM_BUFFER_2
+ farjump UnknownScript_0xa0a50
+
+.HasItem:
+ landmarktotext ROUTE_31, MEM_BUFFER_2
+ farjump UnknownScript_0xa0ab5
+
+WadePhoneCallerScript:
+ trainertotext BUG_CATCHER, WADE1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ farscall PhoneScript_Random2
+ ifequal 0, .NoContest
+ checkflag ENGINE_DAILY_BUG_CONTEST
+ iftrue .NoContest
+ checkcode VAR_WEEKDAY
+ ifequal TUESDAY, .ContestToday
+ ifequal THURSDAY, .ContestToday
+ ifequal SATURDAY, .ContestToday
+
+.NoContest:
+ checkflag ENGINE_WADE
+ iftrue .next
+ checkflag ENGINE_WADE_TUESDAY_NIGHT
+ iftrue .next
+ checkflag ENGINE_WADE_HAS_ITEM
+ iftrue .next
+ farscall PhoneScript_Random2
+ ifequal 0, WadeHasItem2
+ checkflag ENGINE_FLYPOINT_GOLDENROD
+ iffalse .next
+ farscall PhoneScript_Random2
+ ifequal 0, WadeWantsBattle2
+
+.next:
+ farscall PhoneScript_Random3
+ ifequal 0, WadeFoundRare
+ farjump Phone_GenericCall_Male
+
+.ContestToday:
+ farjump PhoneScript_BugCatchingContest
+
+WadeTuesdayNight:
+ setflag ENGINE_WADE_TUESDAY_NIGHT
+
+WadeWantsBattle2:
+ landmarktotext ROUTE_31, MEM_BUFFER_2
+ setflag ENGINE_WADE
+ farjump PhoneScript_WantsToBattle_Male
+
+WadeFoundRare:
+ farjump Phone_CheckIfUnseenRare_Male
+
+WadeHasItem2:
+ setflag ENGINE_WADE_HAS_ITEM
+ landmarktotext ROUTE_31, MEM_BUFFER_2
+ clearevent EVENT_WADE_HAS_BERRY
+ clearevent EVENT_WADE_HAS_PSNCUREBERRY
+ clearevent EVENT_WADE_HAS_PRZCUREBERRY
+ clearevent EVENT_WADE_HAS_BITTER_BERRY
+ random 4
+ ifequal 0, .Berry
+ ifequal 1, .PsnCureBerry
+ ifequal 2, .PrzCureBerry
+ ifequal 3, .Bitterberry
+
+.Berry:
+ setevent EVENT_WADE_HAS_BERRY
+ jump .FoundBerry
+
+.PsnCureBerry:
+ setevent EVENT_WADE_HAS_PSNCUREBERRY
+ jump .FoundBerry
+
+.PrzCureBerry:
+ setevent EVENT_WADE_HAS_PRZCUREBERRY
+ jump .FoundBerry
+
+.Bitterberry:
+ setevent EVENT_WADE_HAS_BITTER_BERRY
+
+.FoundBerry:
+ farjump PhoneScript_FoundItem_Male
diff --git a/engine/phone/scripts/wilton.asm b/engine/phone/scripts/wilton.asm
new file mode 100644
index 000000000..9d2f0e906
--- /dev/null
+++ b/engine/phone/scripts/wilton.asm
@@ -0,0 +1,75 @@
+WiltonPhoneCalleeScript:
+ trainertotext FISHER, WILTON1, MEM_BUFFER_0
+ checkflag ENGINE_WILTON
+ iftrue .WantsBattle
+ farscall PhoneScript_AnswerPhone_Male
+ checkflag ENGINE_WILTON_THURSDAY_MORNING
+ iftrue .NotThursday
+ checkflag ENGINE_WILTON_HAS_ITEM
+ iftrue .HasItem
+ checkcode VAR_WEEKDAY
+ ifnotequal THURSDAY, .NotThursday
+ checktime MORN
+ iftrue WiltonThursdayMorning
+
+.NotThursday:
+ farjump WiltonHaventFoundAnything
+
+.WantsBattle:
+ landmarktotext ROUTE_44, MEM_BUFFER_2
+ farjump WiltonNotBiting
+
+.HasItem:
+ landmarktotext ROUTE_44, MEM_BUFFER_2
+ farjump WiltonWantThis
+
+WiltonPhoneCallerScript:
+ trainertotext FISHER, WILTON1, MEM_BUFFER_0
+ farscall PhoneScript_GreetPhone_Male
+ checkflag ENGINE_WILTON
+ iftrue .GenericCall
+ checkflag ENGINE_WILTON_THURSDAY_MORNING
+ iftrue .GenericCall
+ checkflag ENGINE_WILTON_HAS_ITEM
+ iftrue .GenericCall
+ farscall PhoneScript_Random2
+ ifequal 0, WiltonWantsBattle
+ farscall PhoneScript_Random2
+ ifequal 0, WiltonHasItem
+
+.GenericCall:
+ farjump Phone_GenericCall_Male
+
+WiltonThursdayMorning:
+ setflag ENGINE_WILTON_THURSDAY_MORNING
+
+WiltonWantsBattle:
+ landmarktotext ROUTE_44, MEM_BUFFER_2
+ setflag ENGINE_WILTON
+ farjump PhoneScript_WantsToBattle_Male
+
+WiltonHasItem:
+ setflag ENGINE_WILTON_HAS_ITEM
+ landmarktotext ROUTE_44, MEM_BUFFER_2
+ clearevent EVENT_WILTON_HAS_ULTRA_BALL
+ clearevent EVENT_WILTON_HAS_GREAT_BALL
+ clearevent EVENT_WILTON_HAS_POKE_BALL
+ random 5
+ ifequal 0, .UltraBall
+ random 3
+ ifequal 0, .GreatBall
+ jump .PokeBall
+
+.UltraBall:
+ setevent EVENT_WILTON_HAS_ULTRA_BALL
+ jump .FoundItem
+
+.GreatBall:
+ setevent EVENT_WILTON_HAS_GREAT_BALL
+ jump .FoundItem
+
+.PokeBall:
+ setevent EVENT_WILTON_HAS_POKE_BALL
+
+.FoundItem:
+ farjump PhoneScript_FoundItem_Male
diff --git a/engine/rtc/timeset.asm b/engine/rtc/timeset.asm
index 366dd2460..3275d313a 100644
--- a/engine/rtc/timeset.asm
+++ b/engine/rtc/timeset.asm
@@ -44,7 +44,7 @@ InitClock:
ld hl, Text_WokeUpOak
call PrintText
ld hl, wTimeSetBuffer
- ld bc, 50
+ ld bc, wTimeSetBufferEnd - wTimeSetBuffer
xor a
call ByteFill
ld a, 10 ; default hour = 10 AM
diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm
index 5553eec10..d596849d2 100644
--- a/engine/tilesets/tileset_anims.asm
+++ b/engine/tilesets/tileset_anims.asm
@@ -633,13 +633,13 @@ AnimateFlowerTile:
; Alternate tile graphic every other frame
ld a, [wTileAnimationTimer]
and %10
- ld e, a
; CGB has different color mappings for flowers.
+ ld e, a
ldh a, [hCGB]
and 1
-
add e
+
swap a
ld e, a
ld d, 0
diff --git a/extras b/extras
deleted file mode 160000
-Subproject 2ae1ae2f19c842da965cd3db1b0da8bf108ac23
diff --git a/gfx/pokemon/anims.asm b/gfx/pokemon/anims.asm
index 761e7125c..e8f490cb2 100644
--- a/gfx/pokemon/anims.asm
+++ b/gfx/pokemon/anims.asm
@@ -1,5 +1,3 @@
-PicAnimations: ; used only for BANK(PicAnimations)
-
BulbasaurAnimation: INCLUDE "gfx/pokemon/bulbasaur/anim.asm"
IvysaurAnimation: INCLUDE "gfx/pokemon/ivysaur/anim.asm"
VenusaurAnimation: INCLUDE "gfx/pokemon/venusaur/anim.asm"
diff --git a/gfx/pokemon/unown_anims.asm b/gfx/pokemon/unown_anims.asm
index 6e8d251d5..6aa239e8e 100644
--- a/gfx/pokemon/unown_anims.asm
+++ b/gfx/pokemon/unown_anims.asm
@@ -1,5 +1,3 @@
-UnownAnimations: ; used only for BANK(UnownAnimations)
-
UnownAAnimation: INCLUDE "gfx/pokemon/unown_a/anim.asm"
UnownBAnimation: INCLUDE "gfx/pokemon/unown_b/anim.asm"
UnownCAnimation: INCLUDE "gfx/pokemon/unown_c/anim.asm"
diff --git a/home/audio.asm b/home/audio.asm
index 917d52953..803c6e07d 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -71,7 +71,7 @@ PlayMusic::
ldh a, [hROMBank]
push af
- ld a, BANK(_PlayMusic) ; and BANK(_MapSetup_Sound_Off)
+ ld a, BANK(_PlayMusic) ; aka BANK(_MapSetup_Sound_Off)
ldh [hROMBank], a
ld [MBC3RomBank], a
diff --git a/home/init.asm b/home/init.asm
index 5ee86bd1a..676b5460a 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -97,7 +97,7 @@ Init::
call ClearSprites
call ClearsScratch
- ld a, BANK(GameInit) ; and BANK(WriteOAMDMACodeToHRAM)
+ ld a, BANK(GameInit) ; aka BANK(WriteOAMDMACodeToHRAM)
rst Bankswitch
call WriteOAMDMACodeToHRAM
diff --git a/home/map.asm b/home/map.asm
index bb88bebe6..9af673f3d 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -1,8 +1,8 @@
; Functions dealing with rendering and interacting with maps.
-Clearwc7e8::
- ld hl, wc7e8
- ld bc, wc7e8_End - wc7e8
+ClearUnusedC7E8::
+ ld hl, wUnusedC7E8
+ ld bc, wUnusedC7E8End - wUnusedC7E8
ld a, 0
call ByteFill
ret
@@ -102,8 +102,8 @@ LoadMapPart::
ld a, [wTilesetBlocksBank]
rst Bankswitch
-
call LoadMetatiles
+
ld a, "■"
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
diff --git a/home/scrolling_menu.asm b/home/scrolling_menu.asm
index 74015c704..076b43156 100644
--- a/home/scrolling_menu.asm
+++ b/home/scrolling_menu.asm
@@ -3,7 +3,7 @@ ScrollingMenu::
ldh a, [hROMBank]
push af
- ld a, BANK(_ScrollingMenu) ; and BANK(_InitScrollingMenu)
+ ld a, BANK(_ScrollingMenu) ; aka BANK(_InitScrollingMenu)
rst Bankswitch
call _InitScrollingMenu
diff --git a/home/window.asm b/home/window.asm
index ff0576e63..16564af47 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -2,7 +2,7 @@ RefreshScreen::
call ClearWindowData
ldh a, [hROMBank]
push af
- ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; and BANK(LoadFonts_NoOAMUpdate)
+ ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFonts_NoOAMUpdate)
rst Bankswitch
call ReanchorBGMap_NoOAMUpdate
@@ -47,7 +47,7 @@ OpenText::
call ClearWindowData
ldh a, [hROMBank]
push af
- ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; and BANK(LoadFonts_NoOAMUpdate)
+ ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFonts_NoOAMUpdate)
rst Bankswitch
call ReanchorBGMap_NoOAMUpdate ; clear bgmap
diff --git a/main.asm b/main.asm
index 4376f0e18..bf23cf9f7 100644
--- a/main.asm
+++ b/main.asm
@@ -269,7 +269,20 @@ INCBIN "gfx/unknown/unknown_egg.2bpp.lz"
SECTION "Crystal Phone Text", ROMX
-INCLUDE "data/phone/text/extra.asm"
+INCLUDE "data/phone/text/irwin_caller.asm"
+INCLUDE "data/phone/text/arnie_caller.asm"
+INCLUDE "data/phone/text/alan_caller.asm"
+INCLUDE "data/phone/text/dana_caller.asm"
+INCLUDE "data/phone/text/chad_caller.asm"
+INCLUDE "data/phone/text/derek_caller.asm"
+INCLUDE "data/phone/text/tully_caller.asm"
+INCLUDE "data/phone/text/brent_caller.asm"
+INCLUDE "data/phone/text/tiffany_caller.asm"
+INCLUDE "data/phone/text/vance_caller.asm"
+INCLUDE "data/phone/text/wilton_caller.asm"
+INCLUDE "data/phone/text/kenji_caller.asm"
+INCLUDE "data/phone/text/parry_caller.asm"
+INCLUDE "data/phone/text/erin_caller.asm"
SECTION "bank20", ROMX
@@ -321,11 +334,20 @@ INCLUDE "engine/events/fish.asm"
INCLUDE "engine/games/slot_machine.asm"
-SECTION "Phone Engine", ROMX
+SECTION "Phone Scripts 1", ROMX
-INCLUDE "engine/phone/phone_callers.asm"
-INCLUDE "engine/phone/phone_gossip.asm"
-INCLUDE "engine/phone/buenas_password.asm"
+INCLUDE "engine/phone/scripts/generic_caller.asm"
+INCLUDE "engine/phone/scripts/jack_gossip.asm"
+INCLUDE "engine/phone/scripts/liz_gossip.asm"
+INCLUDE "engine/phone/scripts/chad_gossip.asm"
+INCLUDE "engine/phone/scripts/brent_gossip.asm"
+INCLUDE "engine/phone/scripts/irwin_gossip.asm"
+INCLUDE "engine/phone/scripts/hangups.asm"
+INCLUDE "engine/phone/scripts/reminders.asm"
+INCLUDE "engine/phone/scripts/hangups_2.asm"
+INCLUDE "engine/phone/scripts/reminders_2.asm"
+INCLUDE "engine/phone/scripts/bike_shop.asm"
+INCLUDE "engine/phone/scripts/buena.asm"
SECTION "Phone Text", ROMX
@@ -359,11 +381,42 @@ INCLUDE "engine/pokegear/radio.asm"
INCLUDE "engine/pokemon/mail_2.asm"
-SECTION "bank2F", ROMX
+SECTION "Phone Scripts 2", ROMX
INCLUDE "engine/events/std_scripts.asm"
-INCLUDE "engine/phone/phone_scripts.asm"
-INCLUDE "engine/phone/generic_calls.asm"
+INCLUDE "engine/phone/scripts/unused.asm"
+INCLUDE "engine/phone/scripts/mom.asm"
+INCLUDE "engine/phone/scripts/bill.asm"
+INCLUDE "engine/phone/scripts/elm.asm"
+INCLUDE "engine/phone/scripts/jack.asm"
+INCLUDE "engine/phone/scripts/beverly.asm"
+INCLUDE "engine/phone/scripts/huey.asm"
+INCLUDE "engine/phone/scripts/gaven.asm"
+INCLUDE "engine/phone/scripts/beth.asm"
+INCLUDE "engine/phone/scripts/jose.asm"
+INCLUDE "engine/phone/scripts/reena.asm"
+INCLUDE "engine/phone/scripts/joey.asm"
+INCLUDE "engine/phone/scripts/wade.asm"
+INCLUDE "engine/phone/scripts/ralph.asm"
+INCLUDE "engine/phone/scripts/liz.asm"
+INCLUDE "engine/phone/scripts/anthony.asm"
+INCLUDE "engine/phone/scripts/todd.asm"
+INCLUDE "engine/phone/scripts/gina.asm"
+INCLUDE "engine/phone/scripts/irwin.asm"
+INCLUDE "engine/phone/scripts/arnie.asm"
+INCLUDE "engine/phone/scripts/alan.asm"
+INCLUDE "engine/phone/scripts/dana.asm"
+INCLUDE "engine/phone/scripts/chad.asm"
+INCLUDE "engine/phone/scripts/derek.asm"
+INCLUDE "engine/phone/scripts/tully.asm"
+INCLUDE "engine/phone/scripts/brent.asm"
+INCLUDE "engine/phone/scripts/tiffany.asm"
+INCLUDE "engine/phone/scripts/vance.asm"
+INCLUDE "engine/phone/scripts/wilton.asm"
+INCLUDE "engine/phone/scripts/kenji.asm"
+INCLUDE "engine/phone/scripts/parry.asm"
+INCLUDE "engine/phone/scripts/erin.asm"
+INCLUDE "engine/phone/scripts/generic_callee.asm"
INCLUDE "engine/events/trainer_scripts.asm"
@@ -520,7 +573,21 @@ INCLUDE "mobile/mobile_5c.asm"
SECTION "Crystal Phone Text 2", ROMX
-INCLUDE "data/phone/text/extra2.asm"
+INCLUDE "data/phone/text/bike_shop.asm"
+INCLUDE "data/phone/text/jack_caller.asm"
+INCLUDE "data/phone/text/beverly_caller.asm"
+INCLUDE "data/phone/text/huey_caller.asm"
+INCLUDE "data/phone/text/gaven_caller.asm"
+INCLUDE "data/phone/text/beth_caller.asm"
+INCLUDE "data/phone/text/jose_caller.asm"
+INCLUDE "data/phone/text/reena_caller.asm"
+INCLUDE "data/phone/text/joey_caller.asm"
+INCLUDE "data/phone/text/wade_caller.asm"
+INCLUDE "data/phone/text/ralph_caller.asm"
+INCLUDE "data/phone/text/liz_caller.asm"
+INCLUDE "data/phone/text/anthony_caller.asm"
+INCLUDE "data/phone/text/todd_caller.asm"
+INCLUDE "data/phone/text/gina_caller.asm"
SECTION "UpdateBattleHUDs", ROMX
@@ -559,7 +626,36 @@ SECTION "Special Phone Text", ROMX
INCLUDE "data/phone/text/mom.asm"
INCLUDE "data/phone/text/bill.asm"
INCLUDE "data/phone/text/elm.asm"
-INCLUDE "data/phone/text/trainers.asm"
+INCLUDE "data/phone/text/jack_callee.asm"
+INCLUDE "data/phone/text/beverly_callee.asm"
+INCLUDE "data/phone/text/huey_callee.asm"
+INCLUDE "data/phone/text/unknown_callee.asm"
+INCLUDE "data/phone/text/gaven_callee.asm"
+INCLUDE "data/phone/text/beth_callee.asm"
+INCLUDE "data/phone/text/jose_callee.asm"
+INCLUDE "data/phone/text/reena_callee.asm"
+INCLUDE "data/phone/text/joey_callee.asm"
+INCLUDE "data/phone/text/wade_callee.asm"
+INCLUDE "data/phone/text/ralph_callee.asm"
+INCLUDE "data/phone/text/liz_callee.asm"
+INCLUDE "data/phone/text/anthony_callee.asm"
+INCLUDE "data/phone/text/todd_callee.asm"
+INCLUDE "data/phone/text/gina_callee.asm"
+INCLUDE "data/phone/text/irwin_callee.asm"
+INCLUDE "data/phone/text/arnie_callee.asm"
+INCLUDE "data/phone/text/alan_callee.asm"
+INCLUDE "data/phone/text/dana_callee.asm"
+INCLUDE "data/phone/text/chad_callee.asm"
+INCLUDE "data/phone/text/derek_callee.asm"
+INCLUDE "data/phone/text/tully_callee.asm"
+INCLUDE "data/phone/text/brent_callee.asm"
+INCLUDE "data/phone/text/tiffany_callee.asm"
+INCLUDE "data/phone/text/vance_callee.asm"
+INCLUDE "data/phone/text/wilton_callee.asm"
+INCLUDE "data/phone/text/kenji_callee.asm"
+INCLUDE "data/phone/text/parry_callee.asm"
+INCLUDE "data/phone/text/erin_callee.asm"
+INCLUDE "data/phone/text/unused.asm"
SECTION "Miscellaneous Text", ROMX
diff --git a/maps/LakeOfRage.asm b/maps/LakeOfRage.asm
index a63fb147e..fbfaa93bb 100644
--- a/maps/LakeOfRage.asm
+++ b/maps/LakeOfRage.asm
@@ -87,7 +87,7 @@ RedGyarados:
loadwildmon GYARADOS, 30
writecode VAR_BATTLETYPE, BATTLETYPE_SHINY
startbattle
- ifequal $1, .NotBeaten
+ ifequal LOSE, .NotBeaten
disappear LAKEOFRAGE_GYARADOS
.NotBeaten:
reloadmapafterbattle
diff --git a/maps/Route36.asm b/maps/Route36.asm
index 67458e6f5..d9845bc30 100644
--- a/maps/Route36.asm
+++ b/maps/Route36.asm
@@ -77,7 +77,7 @@ WateredWeirdTreeScript:: ; export (for when you use Squirtbottle from pack)
loadwildmon SUDOWOODO, 20
startbattle
setevent EVENT_FOUGHT_SUDOWOODO
- ifequal $2, DidntCatchSudowoodo
+ ifequal DRAW, DidntCatchSudowoodo
disappear ROUTE36_WEIRD_TREE
variablesprite SPRITE_WEIRD_TREE, SPRITE_TWIN
reloadmapafterbattle
diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm
index 5a73ea8a6..7ba1e737f 100644
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -242,7 +242,7 @@ CheckBTMonMovesForErrors:
.done
pop hl
- ld de, PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
+ ld de, NICKNAMED_MON_STRUCT_LENGTH
add hl, de
dec c
jr nz, .loop
diff --git a/pokecrystal.link b/pokecrystal.link
index 4b0e7c46f..ccef50b37 100644
--- a/pokecrystal.link
+++ b/pokecrystal.link
@@ -113,7 +113,7 @@ ROMX $26
ROMX $27
"Map Scripts 12"
ROMX $28
- "Phone Engine"
+ "Phone Scripts 1"
ROMX $29
"Phone Text"
ROMX $2a
@@ -127,7 +127,7 @@ ROMX $2d
ROMX $2e
"bank2E"
ROMX $2f
- "bank2F"
+ "Phone Scripts 2"
ROMX $30
"Sprites 1"
ROMX $31
@@ -319,7 +319,7 @@ WRAM0
align 8
"Sprites"
"Tilemap"
- "Battle"
+ "Miscellaneous"
"Overworld Map"
"Video"
WRAMX 1
diff --git a/gfx.py b/tools/gfx.py
index 8afa30a7a..a3d955627 100644
--- a/gfx.py
+++ b/tools/gfx.py
@@ -1,9 +1,12 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
"""Supplementary scripts for graphics conversion."""
import os
import argparse
-from extras.pokemontools import gfx, lz
+from pokemontools import gfx, lz
# Graphics with inverted tilemaps that aren't covered by filepath_rules.
@@ -146,7 +149,7 @@ def filepath_rules(filepath):
pokemon_name = ''
- if 'gfx/pics/' in filedir:
+ if 'gfx/pokemon/' in filedir:
pokemon_name = filedir.split('/')[-1]
if pokemon_name.startswith('unown_'):
index = filedir.find(pokemon_name)
diff --git a/tools/pokemontools/__init__.py b/tools/pokemontools/__init__.py
new file mode 100644
index 000000000..a3e759000
--- /dev/null
+++ b/tools/pokemontools/__init__.py
@@ -0,0 +1 @@
+# A subset of https://github.com/pret/pokemon-reverse-engineering-tools
diff --git a/tools/pokemontools/gfx.py b/tools/pokemontools/gfx.py
new file mode 100644
index 000000000..2979b5a79
--- /dev/null
+++ b/tools/pokemontools/gfx.py
@@ -0,0 +1,938 @@
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+import png
+from math import sqrt, floor, ceil
+import argparse
+import operator
+
+from lz import Compressed, Decompressed
+
+
+def split(list_, interval):
+ """
+ Split a list by length.
+ """
+ for i in xrange(0, len(list_), interval):
+ j = min(i + interval, len(list_))
+ yield list_[i:j]
+
+
+def hex_dump(data, length=0x10):
+ """
+ just use hexdump -C
+ """
+ margin = len('%x' % len(data))
+ output = []
+ address = 0
+ for line in split(data, length):
+ output += [
+ hex(address)[2:].zfill(margin) +
+ ' | ' +
+ ' '.join('%.2x' % byte for byte in line)
+ ]
+ address += length
+ return '\n'.join(output)
+
+
+def get_tiles(image):
+ """
+ Split a 2bpp image into 8x8 tiles.
+ """
+ return list(split(image, 0x10))
+
+def connect(tiles):
+ """
+ Combine 8x8 tiles into a 2bpp image.
+ """
+ return [byte for tile in tiles for byte in tile]
+
+def transpose(tiles, width=None):
+ """
+ Transpose a tile arrangement along line y=-x.
+
+ 00 01 02 03 04 05 00 06 0c 12 18 1e
+ 06 07 08 09 0a 0b 01 07 0d 13 19 1f
+ 0c 0d 0e 0f 10 11 <-> 02 08 0e 14 1a 20
+ 12 13 14 15 16 17 03 09 0f 15 1b 21
+ 18 19 1a 1b 1c 1d 04 0a 10 16 1c 22
+ 1e 1f 20 21 22 23 05 0b 11 17 1d 23
+
+ 00 01 02 03 00 04 08
+ 04 05 06 07 <-> 01 05 09
+ 08 09 0a 0b 02 06 0a
+ 03 07 0b
+ """
+ if width == None:
+ width = int(sqrt(len(tiles))) # assume square image
+ tiles = sorted(enumerate(tiles), key= lambda (i, tile): i % width)
+ return [tile for i, tile in tiles]
+
+def transpose_tiles(image, width=None):
+ return connect(transpose(get_tiles(image), width))
+
+def interleave(tiles, width):
+ """
+ 00 01 02 03 04 05 00 02 04 06 08 0a
+ 06 07 08 09 0a 0b 01 03 05 07 09 0b
+ 0c 0d 0e 0f 10 11 --> 0c 0e 10 12 14 16
+ 12 13 14 15 16 17 0d 0f 11 13 15 17
+ 18 19 1a 1b 1c 1d 18 1a 1c 1e 20 22
+ 1e 1f 20 21 22 23 19 1b 1d 1f 21 23
+ """
+ interleaved = []
+ left, right = split(tiles[::2], width), split(tiles[1::2], width)
+ for l, r in zip(left, right):
+ interleaved += l + r
+ return interleaved
+
+def deinterleave(tiles, width):
+ """
+ 00 02 04 06 08 0a 00 01 02 03 04 05
+ 01 03 05 07 09 0b 06 07 08 09 0a 0b
+ 0c 0e 10 12 14 16 --> 0c 0d 0e 0f 10 11
+ 0d 0f 11 13 15 17 12 13 14 15 16 17
+ 18 1a 1c 1e 20 22 18 19 1a 1b 1c 1d
+ 19 1b 1d 1f 21 23 1e 1f 20 21 22 23
+ """
+ deinterleaved = []
+ rows = list(split(tiles, width))
+ for left, right in zip(rows[::2], rows[1::2]):
+ for l, r in zip(left, right):
+ deinterleaved += [l, r]
+ return deinterleaved
+
+def interleave_tiles(image, width):
+ return connect(interleave(get_tiles(image), width))
+
+def deinterleave_tiles(image, width):
+ return connect(deinterleave(get_tiles(image), width))
+
+
+def condense_image_to_map(image, pic=0):
+ """
+ Reduce an image of adjacent frames to an image containing a base frame and any unrepeated tiles.
+ Returns the new image and the corresponding tilemap used to reconstruct the input image.
+
+ If <pic> is 0, ignore the concept of frames. This behavior might be better off as another function.
+ """
+ tiles = get_tiles(image)
+ new_tiles, tilemap = condense_tiles_to_map(tiles, pic)
+ new_image = connect(new_tiles)
+ return new_image, tilemap
+
+def condense_tiles_to_map(tiles, pic=0):
+ """
+ Reduce a sequence of tiles representing adjacent frames to a base frame and any unrepeated tiles.
+ Returns the new tiles and the corresponding tilemap used to reconstruct the input tile sequence.
+
+ If <pic> is 0, ignore the concept of frames. This behavior might be better off as another function.
+ """
+
+ # Leave the first frame intact for pics.
+ new_tiles = tiles[:pic]
+ tilemap = range(pic)
+
+ for i, tile in enumerate(tiles[pic:]):
+ if tile not in new_tiles:
+ new_tiles.append(tile)
+
+ if pic:
+ # Match the first frame exactly where possible.
+ # This reduces the space needed to replace tiles in pic animations.
+ # For example, if a tile is repeated twice in the first frame,
+ # but at the same relative index as the second tile, use the second index.
+ # When creating a bitmask later, the second index would not require a replacement, but the first index would have.
+ pic_i = i % pic
+ if tile == new_tiles[pic_i]:
+ tilemap.append(pic_i)
+ else:
+ tilemap.append(new_tiles.index(tile))
+ else:
+ tilemap.append(new_tiles.index(tile))
+ return new_tiles, tilemap
+
+def test_condense_tiles_to_map():
+ test = condense_tiles_to_map(list('abcadbae'))
+ if test != (list('abcde'), [0, 1, 2, 0, 3, 1, 0, 4]):
+ raise Exception(test)
+ test = condense_tiles_to_map(list('abcadbae'), 2)
+ if test != (list('abcde'), [0, 1, 2, 0, 3, 1, 0, 4]):
+ raise Exception(test)
+ test = condense_tiles_to_map(list('abcadbae'), 4)
+ if test != (list('abcade'), [0, 1, 2, 3, 4, 1, 0, 5]):
+ raise Exception(test)
+ test = condense_tiles_to_map(list('abcadbea'), 4)
+ if test != (list('abcade'), [0, 1, 2, 3, 4, 1, 5, 3]):
+ raise Exception(test)
+
+
+def to_file(filename, data):
+ """
+ Apparently open(filename, 'wb').write(bytearray(data)) won't work.
+ """
+ file = open(filename, 'wb')
+ for byte in data:
+ file.write('%c' % byte)
+ file.close()
+
+
+def decompress_file(filein, fileout=None):
+ image = bytearray(open(filein).read())
+ de = Decompressed(image)
+
+ if fileout == None:
+ fileout = os.path.splitext(filein)[0]
+ to_file(fileout, de.output)
+
+
+def compress_file(filein, fileout=None):
+ image = bytearray(open(filein).read())
+ lz = Compressed(image)
+
+ if fileout == None:
+ fileout = filein + '.lz'
+ to_file(fileout, lz.output)
+
+
+def bin_to_rgb(word):
+ red = word & 0b11111
+ word >>= 5
+ green = word & 0b11111
+ word >>= 5
+ blue = word & 0b11111
+ return (red, green, blue)
+
+def convert_binary_pal_to_text_by_filename(filename):
+ pal = bytearray(open(filename).read())
+ return convert_binary_pal_to_text(pal)
+
+def convert_binary_pal_to_text(pal):
+ output = ''
+ words = [hi * 0x100 + lo for lo, hi in zip(pal[::2], pal[1::2])]
+ for word in words:
+ red, green, blue = ['%.2d' % c for c in bin_to_rgb(word)]
+ output += '\tRGB ' + ', '.join((red, green, blue))
+ output += '\n'
+ return output
+
+def read_rgb_macros(lines):
+ colors = []
+ for line in lines:
+ macro = line.split(" ")[0].strip()
+ if macro == 'RGB':
+ params = ' '.join(line.split(" ")[1:]).split(',')
+ red, green, blue = [int(v) for v in params]
+ colors += [[red, green, blue]]
+ return colors
+
+
+def rewrite_binary_pals_to_text(filenames):
+ for filename in filenames:
+ pal_text = convert_binary_pal_to_text_by_filename(filename)
+ with open(filename, 'w') as out:
+ out.write(pal_text)
+
+
+def flatten(planar):
+ """
+ Flatten planar 2bpp image data into a quaternary pixel map.
+ """
+ strips = []
+ for bottom, top in split(planar, 2):
+ bottom = bottom
+ top = top
+ strip = []
+ for i in xrange(7,-1,-1):
+ color = (
+ (bottom >> i & 1) +
+ (top *2 >> i & 2)
+ )
+ strip += [color]
+ strips += strip
+ return strips
+
+def to_lines(image, width):
+ """
+ Convert a tiled quaternary pixel map to lines of quaternary pixels.
+ """
+ tile_width = 8
+ tile_height = 8
+ num_columns = width / tile_width
+ height = len(image) / width
+
+ lines = []
+ for cur_line in xrange(height):
+ tile_row = cur_line / tile_height
+ line = []
+ for column in xrange(num_columns):
+ anchor = (
+ num_columns * tile_row * tile_width * tile_height +
+ column * tile_width * tile_height +
+ cur_line % tile_height * tile_width
+ )
+ line += image[anchor : anchor + tile_width]
+ lines += [line]
+ return lines
+
+
+def dmg2rgb(word):
+ """
+ For PNGs.
+ """
+ def shift(value):
+ while True:
+ yield value & (2**5 - 1)
+ value >>= 5
+ word = shift(word)
+ # distribution is less even w/ << 3
+ red, green, blue = [int(color * 8.25) for color in [word.next() for _ in xrange(3)]]
+ alpha = 255
+ return (red, green, blue, alpha)
+
+
+def rgb_to_dmg(color):
+ """
+ For PNGs.
+ """
+ word = (color['r'] / 8)
+ word += (color['g'] / 8) << 5
+ word += (color['b'] / 8) << 10
+ return word
+
+
+def pal_to_png(filename):
+ """
+ Interpret a .pal file as a png palette.
+ """
+ with open(filename) as rgbs:
+ colors = read_rgb_macros(rgbs.readlines())
+ a = 255
+ palette = []
+ for color in colors:
+ # even distribution over 000-255
+ r, g, b = [int(hue * 8.25) for hue in color]
+ palette += [(r, g, b, a)]
+ white = (255,255,255,255)
+ black = (000,000,000,255)
+ if white not in palette and len(palette) < 4:
+ palette = [white] + palette
+ if black not in palette and len(palette) < 4:
+ palette = palette + [black]
+ return palette
+
+
+def png_to_rgb(palette):
+ """
+ Convert a png palette to rgb macros.
+ """
+ output = ''
+ for color in palette:
+ r, g, b = [color[c] / 8 for c in 'rgb']
+ output += '\tRGB ' + ', '.join(['%.2d' % hue for hue in (r, g, b)])
+ output += '\n'
+ return output
+
+
+def read_filename_arguments(filename):
+ """
+ Infer graphics conversion arguments given a filename.
+
+ Arguments are separated with '.'.
+ """
+ parsed_arguments = {}
+
+ int_arguments = {
+ 'w': 'width',
+ 'h': 'height',
+ 't': 'tile_padding',
+ }
+ arguments = os.path.splitext(filename)[0].lstrip('.').split('.')[1:]
+ for argument in arguments:
+
+ # Check for integer arguments first (i.e. "w128").
+ arg = argument[0]
+ param = argument[1:]
+ if param.isdigit():
+ arg = int_arguments.get(arg, False)
+ if arg:
+ parsed_arguments[arg] = int(param)
+
+ elif argument == 'arrange':
+ parsed_arguments['norepeat'] = True
+ parsed_arguments['tilemap'] = True
+
+ # Pic dimensions (i.e. "6x6").
+ elif 'x' in argument and any(map(str.isdigit, argument)):
+ w, h = argument.split('x')
+ if w.isdigit() and h.isdigit():
+ parsed_arguments['pic_dimensions'] = (int(w), int(h))
+
+ else:
+ parsed_arguments[argument] = True
+
+ return parsed_arguments
+
+
+def export_2bpp_to_png(filein, fileout=None, pal_file=None, height=0, width=0, tile_padding=0, pic_dimensions=None, **kwargs):
+
+ if fileout == None:
+ fileout = os.path.splitext(filein)[0] + '.png'
+
+ image = open(filein, 'rb').read()
+
+ arguments = {
+ 'width': width,
+ 'height': height,
+ 'pal_file': pal_file,
+ 'tile_padding': tile_padding,
+ 'pic_dimensions': pic_dimensions,
+ }
+ arguments.update(read_filename_arguments(filein))
+
+ if pal_file == None:
+ if os.path.exists(os.path.splitext(fileout)[0]+'.pal'):
+ arguments['pal_file'] = os.path.splitext(fileout)[0]+'.pal'
+
+ result = convert_2bpp_to_png(image, **arguments)
+ width, height, palette, greyscale, bitdepth, px_map = result
+
+ w = png.Writer(
+ width,
+ height,
+ palette=palette,
+ compression=9,
+ greyscale=greyscale,
+ bitdepth=bitdepth
+ )
+ with open(fileout, 'wb') as f:
+ w.write(f, px_map)
+
+
+def convert_2bpp_to_png(image, **kwargs):
+ """
+ Convert a planar 2bpp graphic to png.
+ """
+
+ image = bytearray(image)
+
+ pad_color = bytearray([0])
+
+ width = kwargs.get('width', 0)
+ height = kwargs.get('height', 0)
+ tile_padding = kwargs.get('tile_padding', 0)
+ pic_dimensions = kwargs.get('pic_dimensions', None)
+ pal_file = kwargs.get('pal_file', None)
+ interleave = kwargs.get('interleave', False)
+
+ # Width must be specified to interleave.
+ if interleave and width:
+ image = interleave_tiles(image, width / 8)
+
+ # Pad the image by a given number of tiles if asked.
+ image += pad_color * 0x10 * tile_padding
+
+ # Some images are transposed in blocks.
+ if pic_dimensions:
+ w, h = pic_dimensions
+ if not width: width = w * 8
+
+ pic_length = w * h * 0x10
+
+ trailing = len(image) % pic_length
+
+ pic = []
+ for i in xrange(0, len(image) - trailing, pic_length):
+ pic += transpose_tiles(image[i:i+pic_length], h)
+ image = bytearray(pic) + image[len(image) - trailing:]
+
+ # Pad out trailing lines.
+ image += pad_color * 0x10 * ((w - (len(image) / 0x10) % h) % w)
+
+ def px_length(img):
+ return len(img) * 4
+ def tile_length(img):
+ return len(img) * 4 / (8*8)
+
+ if width and height:
+ tile_width = width / 8
+ more_tile_padding = (tile_width - (tile_length(image) % tile_width or tile_width))
+ image += pad_color * 0x10 * more_tile_padding
+
+ elif width and not height:
+ tile_width = width / 8
+ more_tile_padding = (tile_width - (tile_length(image) % tile_width or tile_width))
+ image += pad_color * 0x10 * more_tile_padding
+ height = px_length(image) / width
+
+ elif height and not width:
+ tile_height = height / 8
+ more_tile_padding = (tile_height - (tile_length(image) % tile_height or tile_height))
+ image += pad_color * 0x10 * more_tile_padding
+ width = px_length(image) / height
+
+ # at least one dimension should be given
+ if width * height != px_length(image):
+ # look for possible combos of width/height that would form a rectangle
+ matches = []
+ # Height need not be divisible by 8, but width must.
+ # See pokered gfx/minimize_pic.1bpp.
+ for w in range(8, px_length(image) / 2 + 1, 8):
+ h = px_length(image) / w
+ if w * h == px_length(image):
+ matches += [(w, h)]
+ # go for the most square image
+ if len(matches):
+ width, height = sorted(matches, key= lambda (w, h): (h % 8 != 0, w + h))[0] # favor height
+ else:
+ raise Exception, 'Image can\'t be divided into tiles (%d px)!' % (px_length(image))
+
+ # convert tiles to lines
+ lines = to_lines(flatten(image), width)
+
+ if pal_file == None:
+ palette = None
+ greyscale = True
+ bitdepth = 2
+ px_map = [[3 - pixel for pixel in line] for line in lines]
+
+ else: # gbc color
+ palette = pal_to_png(pal_file)
+ greyscale = False
+ bitdepth = 8
+ px_map = [[pixel for pixel in line] for line in lines]
+
+ return width, height, palette, greyscale, bitdepth, px_map
+
+
+def get_pic_animation(tmap, w, h):
+ """
+ Generate pic animation data from a combined tilemap of each frame.
+ """
+ frame_text = ''
+ bitmask_text = ''
+
+ frames = list(split(tmap, w * h))
+ base = frames.pop(0)
+ bitmasks = []
+
+ for i in xrange(len(frames)):
+ frame_text += '\tdw .frame{}\n'.format(i + 1)
+
+ for i, frame in enumerate(frames):
+ bitmask = map(operator.ne, frame, base)
+ if bitmask not in bitmasks:
+ bitmasks.append(bitmask)
+ which_bitmask = bitmasks.index(bitmask)
+
+ mask = iter(bitmask)
+ masked_frame = filter(lambda _: mask.next(), frame)
+
+ frame_text += '.frame{}\n'.format(i + 1)
+ frame_text += '\tdb ${:02x} ; bitmask\n'.format(which_bitmask)
+ if masked_frame:
+ frame_text += '\tdb {}\n'.format(', '.join(
+ map('${:02x}'.format, masked_frame)
+ ))
+
+ for i, bitmask in enumerate(bitmasks):
+ bitmask_text += '; {}\n'.format(i)
+ for byte in split(bitmask, 8):
+ byte = int(''.join(map(int.__repr__, reversed(byte))), 2)
+ bitmask_text += '\tdb %{:08b}\n'.format(byte)
+
+ return frame_text, bitmask_text
+
+
+def export_png_to_2bpp(filein, fileout=None, palout=None, **kwargs):
+
+ arguments = {
+ 'tile_padding': 0,
+ 'pic_dimensions': None,
+ 'animate': False,
+ 'stupid_bitmask_hack': [],
+ }
+ arguments.update(kwargs)
+ arguments.update(read_filename_arguments(filein))
+
+ image, arguments = png_to_2bpp(filein, **arguments)
+
+ if fileout == None:
+ fileout = os.path.splitext(filein)[0] + '.2bpp'
+ to_file(fileout, image)
+
+ tmap = arguments.get('tmap')
+
+ if tmap != None and arguments['animate'] and arguments['pic_dimensions']:
+ # Generate pic animation data.
+ frame_text, bitmask_text = get_pic_animation(tmap, *arguments['pic_dimensions'])
+
+ frames_path = os.path.join(os.path.split(fileout)[0], 'frames.asm')
+ with open(frames_path, 'w') as out:
+ out.write(frame_text)
+
+ bitmask_path = os.path.join(os.path.split(fileout)[0], 'bitmask.asm')
+
+ # The following Pokemon have a bitmask dummied out.
+ for exception in arguments['stupid_bitmask_hack']:
+ if exception in bitmask_path:
+ bitmasks = bitmask_text.split(';')
+ bitmasks[-1] = bitmasks[-1].replace('1', '0')
+ bitmask_text = ';'.join(bitmasks)
+
+ with open(bitmask_path, 'w') as out:
+ out.write(bitmask_text)
+
+ elif tmap != None and arguments.get('tilemap', False):
+ tilemap_path = os.path.splitext(fileout)[0] + '.tilemap'
+ to_file(tilemap_path, tmap)
+
+ palette = arguments.get('palette')
+ if palout == None:
+ palout = os.path.splitext(fileout)[0] + '.pal'
+ export_palette(palette, palout)
+
+
+def get_image_padding(width, height, wstep=8, hstep=8):
+
+ padding = {
+ 'left': 0,
+ 'right': 0,
+ 'top': 0,
+ 'bottom': 0,
+ }
+
+ if width % wstep and width >= wstep:
+ pad = float(width % wstep) / 2
+ padding['left'] = int(ceil(pad))
+ padding['right'] = int(floor(pad))
+
+ if height % hstep and height >= hstep:
+ pad = float(height % hstep) / 2
+ padding['top'] = int(ceil(pad))
+ padding['bottom'] = int(floor(pad))
+
+ return padding
+
+
+def png_to_2bpp(filein, **kwargs):
+ """
+ Convert a png image to planar 2bpp.
+ """
+
+ arguments = {
+ 'tile_padding': 0,
+ 'pic_dimensions': False,
+ 'interleave': False,
+ 'norepeat': False,
+ 'tilemap': False,
+ }
+ arguments.update(kwargs)
+
+ if type(filein) is str:
+ filein = open(filein)
+
+ assert type(filein) is file
+
+ width, height, rgba, info = png.Reader(filein).asRGBA8()
+
+ # png.Reader returns flat pixel data. Nested is easier to work with
+ len_px = len('rgba')
+ image = []
+ palette = []
+ for line in rgba:
+ newline = []
+ for px in xrange(0, len(line), len_px):
+ color = dict(zip('rgba', line[px:px+len_px]))
+ if color not in palette:
+ if len(palette) < 4:
+ palette += [color]
+ else:
+ # TODO Find the nearest match
+ print 'WARNING: %s: Color %s truncated to' % (filein, color),
+ color = sorted(palette, key=lambda x: sum(x.values()))[0]
+ print color
+ newline += [color]
+ image += [newline]
+
+ assert len(palette) <= 4, '%s: palette should be 4 colors, is really %d (%s)' % (filein, len(palette), palette)
+
+ # Pad out smaller palettes with greyscale colors
+ greyscale = {
+ 'black': { 'r': 0x00, 'g': 0x00, 'b': 0x00, 'a': 0xff },
+ 'grey': { 'r': 0x55, 'g': 0x55, 'b': 0x55, 'a': 0xff },
+ 'gray': { 'r': 0xaa, 'g': 0xaa, 'b': 0xaa, 'a': 0xff },
+ 'white': { 'r': 0xff, 'g': 0xff, 'b': 0xff, 'a': 0xff },
+ }
+ preference = 'white', 'black', 'grey', 'gray'
+ for hue in map(greyscale.get, preference):
+ if len(palette) >= 4:
+ break
+ if hue not in palette:
+ palette += [hue]
+
+ palette.sort(key=lambda x: sum(x.values()))
+
+ # Game Boy palette order
+ palette.reverse()
+
+ # Map pixels to quaternary color ids
+ padding = get_image_padding(width, height)
+ width += padding['left'] + padding['right']
+ height += padding['top'] + padding['bottom']
+ pad = bytearray([0])
+
+ qmap = []
+ qmap += pad * width * padding['top']
+ for line in image:
+ qmap += pad * padding['left']
+ for color in line:
+ qmap += [palette.index(color)]
+ qmap += pad * padding['right']
+ qmap += pad * width * padding['bottom']
+
+ # Graphics are stored in tiles instead of lines
+ tile_width = 8
+ tile_height = 8
+ num_columns = max(width, tile_width) / tile_width
+ num_rows = max(height, tile_height) / tile_height
+ image = []
+
+ for row in xrange(num_rows):
+ for column in xrange(num_columns):
+
+ # Split it up into strips to convert to planar data
+ for strip in xrange(min(tile_height, height)):
+ anchor = (
+ row * num_columns * tile_width * tile_height +
+ column * tile_width +
+ strip * width
+ )
+ line = qmap[anchor : anchor + tile_width]
+ bottom, top = 0, 0
+ for bit, quad in enumerate(line):
+ bottom += (quad & 1) << (7 - bit)
+ top += (quad /2 & 1) << (7 - bit)
+ image += [bottom, top]
+
+ dim = arguments['pic_dimensions']
+ if dim:
+ if type(dim) in (tuple, list):
+ w, h = dim
+ else:
+ # infer dimensions based on width.
+ w = width / tile_width
+ h = height / tile_height
+ if h % w == 0:
+ h = w
+
+ tiles = get_tiles(image)
+ pic_length = w * h
+ tile_width = width / 8
+ trailing = len(tiles) % pic_length
+ new_image = []
+ for block in xrange(len(tiles) / pic_length):
+ offset = (h * tile_width) * ((block * w) / tile_width) + ((block * w) % tile_width)
+ pic = []
+ for row in xrange(h):
+ index = offset + (row * tile_width)
+ pic += tiles[index:index + w]
+ new_image += transpose(pic, w)
+ new_image += tiles[len(tiles) - trailing:]
+ image = connect(new_image)
+
+ # Remove any tile padding used to make the png rectangular.
+ image = image[:len(image) - arguments['tile_padding'] * 0x10]
+
+ tmap = None
+
+ if arguments['interleave']:
+ image = deinterleave_tiles(image, num_columns)
+
+ if arguments['pic_dimensions']:
+ image, tmap = condense_image_to_map(image, w * h)
+ elif arguments['norepeat']:
+ image, tmap = condense_image_to_map(image)
+ if not arguments['tilemap']:
+ tmap = None
+
+ arguments.update({ 'palette': palette, 'tmap': tmap, })
+
+ return image, arguments
+
+
+def export_palette(palette, filename):
+ """
+ Export a palette from png to rgb macros in a .pal file.
+ """
+
+ if os.path.exists(filename):
+
+ # Pic palettes are 2 colors (black/white are added later).
+ with open(filename) as rgbs:
+ colors = read_rgb_macros(rgbs.readlines())
+
+ if len(colors) == 2:
+ palette = palette[1:3]
+
+ text = png_to_rgb(palette)
+ with open(filename, 'w') as out:
+ out.write(text)
+
+
+def png_to_lz(filein):
+
+ name = os.path.splitext(filein)[0]
+
+ export_png_to_2bpp(filein)
+ image = open(name+'.2bpp', 'rb').read()
+ to_file(name+'.2bpp'+'.lz', Compressed(image).output)
+
+
+def convert_2bpp_to_1bpp(data):
+ """
+ Convert planar 2bpp image data to 1bpp. Assume images are two colors.
+ """
+ return data[::2]
+
+def convert_1bpp_to_2bpp(data):
+ """
+ Convert 1bpp image data to planar 2bpp (black/white).
+ """
+ output = []
+ for i in data:
+ output += [i, i]
+ return output
+
+
+def export_2bpp_to_1bpp(filename):
+ name, extension = os.path.splitext(filename)
+ image = open(filename, 'rb').read()
+ image = convert_2bpp_to_1bpp(image)
+ to_file(name + '.1bpp', image)
+
+def export_1bpp_to_2bpp(filename):
+ name, extension = os.path.splitext(filename)
+ image = open(filename, 'rb').read()
+ image = convert_1bpp_to_2bpp(image)
+ to_file(name + '.2bpp', image)
+
+
+def export_1bpp_to_png(filename, fileout=None):
+
+ if fileout == None:
+ fileout = os.path.splitext(filename)[0] + '.png'
+
+ arguments = read_filename_arguments(filename)
+
+ image = open(filename, 'rb').read()
+ image = convert_1bpp_to_2bpp(image)
+
+ result = convert_2bpp_to_png(image, **arguments)
+ width, height, palette, greyscale, bitdepth, px_map = result
+
+ w = png.Writer(width, height, palette=palette, compression=9, greyscale=greyscale, bitdepth=bitdepth)
+ with open(fileout, 'wb') as f:
+ w.write(f, px_map)
+
+
+def export_png_to_1bpp(filename, fileout=None):
+
+ if fileout == None:
+ fileout = os.path.splitext(filename)[0] + '.1bpp'
+
+ arguments = read_filename_arguments(filename)
+ image = png_to_1bpp(filename, **arguments)
+
+ to_file(fileout, image)
+
+def png_to_1bpp(filename, **kwargs):
+ image, kwargs = png_to_2bpp(filename, **kwargs)
+ return convert_2bpp_to_1bpp(image)
+
+
+def convert_to_2bpp(filenames=[]):
+ for filename in filenames:
+ filename, name, extension = try_decompress(filename)
+ if extension == '.1bpp':
+ export_1bpp_to_2bpp(filename)
+ elif extension == '.2bpp':
+ pass
+ elif extension == '.png':
+ export_png_to_2bpp(filename)
+ else:
+ raise Exception, "Don't know how to convert {} to 2bpp!".format(filename)
+
+def convert_to_1bpp(filenames=[]):
+ for filename in filenames:
+ filename, name, extension = try_decompress(filename)
+ if extension == '.1bpp':
+ pass
+ elif extension == '.2bpp':
+ export_2bpp_to_1bpp(filename)
+ elif extension == '.png':
+ export_png_to_1bpp(filename)
+ else:
+ raise Exception, "Don't know how to convert {} to 1bpp!".format(filename)
+
+def convert_to_png(filenames=[]):
+ for filename in filenames:
+ filename, name, extension = try_decompress(filename)
+ if extension == '.1bpp':
+ export_1bpp_to_png(filename)
+ elif extension == '.2bpp':
+ export_2bpp_to_png(filename)
+ elif extension == '.png':
+ pass
+ else:
+ raise Exception, "Don't know how to convert {} to png!".format(filename)
+
+def compress(filenames=[]):
+ for filename in filenames:
+ data = open(filename, 'rb').read()
+ lz_data = Compressed(data).output
+ to_file(filename + '.lz', lz_data)
+
+def decompress(filenames=[]):
+ for filename in filenames:
+ name, extension = os.path.splitext(filename)
+ lz_data = open(filename, 'rb').read()
+ data = Decompressed(lz_data).output
+ to_file(name, data)
+
+def try_decompress(filename):
+ """
+ Try to decompress a graphic when determining the filetype.
+ This skips the manual unlz step when attempting
+ to convert lz-compressed graphics to png.
+ """
+ name, extension = os.path.splitext(filename)
+ if extension == '.lz':
+ decompress([filename])
+ filename = name
+ name, extension = os.path.splitext(filename)
+ return filename, name, extension
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument('mode')
+ ap.add_argument('filenames', nargs='*')
+ args = ap.parse_args()
+
+ method = {
+ '2bpp': convert_to_2bpp,
+ '1bpp': convert_to_1bpp,
+ 'png': convert_to_png,
+ 'lz': compress,
+ 'unlz': decompress,
+ }.get(args.mode, None)
+
+ if method == None:
+ raise Exception, "Unknown conversion method!"
+
+ method(args.filenames)
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/pokemontools/lz.py b/tools/pokemontools/lz.py
new file mode 100644
index 000000000..aef5c641a
--- /dev/null
+++ b/tools/pokemontools/lz.py
@@ -0,0 +1,580 @@
+# -*- coding: utf-8 -*-
+"""
+Pokemon Crystal data de/compression.
+"""
+
+"""
+A rundown of Pokemon Crystal's compression scheme:
+
+Control commands occupy bits 5-7.
+Bits 0-4 serve as the first parameter <n> for each command.
+"""
+lz_commands = {
+ 'literal': 0, # n values for n bytes
+ 'iterate': 1, # one value for n bytes
+ 'alternate': 2, # alternate two values for n bytes
+ 'blank': 3, # zero for n bytes
+}
+
+"""
+Repeater commands repeat any data that was just decompressed.
+They take an additional signed parameter <s> to mark a relative starting point.
+These wrap around (positive from the start, negative from the current position).
+"""
+lz_commands.update({
+ 'repeat': 4, # n bytes starting from s
+ 'flip': 5, # n bytes in reverse bit order starting from s
+ 'reverse': 6, # n bytes backwards starting from s
+})
+
+"""
+The long command is used when 5 bits aren't enough. Bits 2-4 contain a new control code.
+Bits 0-1 are appended to a new byte as 8-9, allowing a 10-bit parameter.
+"""
+lz_commands.update({
+ 'long': 7, # n is now 10 bits for a new control code
+})
+max_length = 1 << 10 # can't go higher than 10 bits
+lowmax = 1 << 5 # standard 5-bit param
+
+"""
+If 0xff is encountered instead of a command, decompression ends.
+"""
+lz_end = 0xff
+
+
+bit_flipped = [
+ sum(((byte >> i) & 1) << (7 - i) for i in xrange(8))
+ for byte in xrange(0x100)
+]
+
+
+class Compressed:
+
+ """
+ Usage:
+ lz = Compressed(data).output
+ or
+ lz = Compressed().compress(data)
+ or
+ c = Compressed()
+ c.data = data
+ lz = c.compress()
+
+ There are some issues with reproducing the target compressor.
+ Some notes are listed here:
+ - the criteria for detecting a lookback is inconsistent
+ - sometimes lookbacks that are mostly 0s are pruned, sometimes not
+ - target appears to skip ahead if it can use a lookback soon, stopping the current command short or in some cases truncating it with literals.
+ - this has been implemented, but the specifics are unknown
+ - self.min_scores: It's unknown if blank's minimum score should be 1 or 2. Most likely it's 1, with some other hack to account for edge cases.
+ - may be related to the above
+ - target does not appear to compress backwards
+ """
+
+ def __init__(self, *args, **kwargs):
+
+ self.min_scores = {
+ 'blank': 1,
+ 'iterate': 2,
+ 'alternate': 3,
+ 'repeat': 3,
+ 'reverse': 3,
+ 'flip': 3,
+ }
+
+ self.preference = [
+ 'repeat',
+ 'blank',
+ 'flip',
+ 'reverse',
+ 'iterate',
+ 'alternate',
+ #'literal',
+ ]
+
+ self.lookback_methods = 'repeat', 'reverse', 'flip'
+
+ self.__dict__.update({
+ 'data': None,
+ 'commands': lz_commands,
+ 'debug': False,
+ 'literal_only': False,
+ })
+
+ self.arg_names = 'data', 'commands', 'debug', 'literal_only'
+
+ self.__dict__.update(kwargs)
+ self.__dict__.update(dict(zip(self.arg_names, args)))
+
+ if self.data is not None:
+ self.compress()
+
+ def compress(self, data=None):
+ if data is not None:
+ self.data = data
+
+ self.data = list(bytearray(self.data))
+
+ self.indexes = {}
+ self.lookbacks = {}
+ for method in self.lookback_methods:
+ self.lookbacks[method] = {}
+
+ self.address = 0
+ self.end = len(self.data)
+ self.output = []
+ self.literal = None
+
+ while self.address < self.end:
+
+ if self.score():
+ self.do_literal()
+ self.do_winner()
+
+ else:
+ if self.literal == None:
+ self.literal = self.address
+ self.address += 1
+
+ self.do_literal()
+
+ self.output += [lz_end]
+ return self.output
+
+ def reset_scores(self):
+ self.scores = {}
+ self.offsets = {}
+ self.helpers = {}
+ for method in self.min_scores.iterkeys():
+ self.scores[method] = 0
+
+ def bit_flip(self, byte):
+ return bit_flipped[byte]
+
+ def do_literal(self):
+ if self.literal != None:
+ length = abs(self.address - self.literal)
+ start = min(self.literal, self.address + 1)
+ self.helpers['literal'] = self.data[start:start+length]
+ self.do_cmd('literal', length)
+ self.literal = None
+
+ def score(self):
+ self.reset_scores()
+
+ map(self.score_literal, ['iterate', 'alternate', 'blank'])
+
+ for method in self.lookback_methods:
+ self.scores[method], self.offsets[method] = self.find_lookback(method, self.address)
+
+ self.stop_short()
+
+ return any(
+ score
+ > self.min_scores[method] + int(score > lowmax)
+ for method, score in self.scores.iteritems()
+ )
+
+ def stop_short(self):
+ """
+ If a lookback is close, reduce the scores of other commands.
+ """
+ best_method, best_score = max(
+ self.scores.items(),
+ key = lambda x: (
+ x[1],
+ -self.preference.index(x[0])
+ )
+ )
+ for method in self.lookback_methods:
+ min_score = self.min_scores[method]
+ for address in xrange(self.address+1, self.address+best_score):
+ length, index = self.find_lookback(method, address)
+ if length > max(min_score, best_score):
+ # BUG: lookbacks can reduce themselves. This appears to be a bug in the target also.
+ for m, score in self.scores.items():
+ self.scores[m] = min(score, address - self.address)
+
+
+ def read(self, address=None):
+ if address is None:
+ address = self.address
+ if 0 <= address < len(self.data):
+ return self.data[address]
+ return None
+
+ def find_all_lookbacks(self):
+ for method in self.lookback_methods:
+ for address, byte in enumerate(self.data):
+ self.find_lookback(method, address)
+
+ def find_lookback(self, method, address=None):
+ """Temporarily stubbed, because the real function doesn't run in polynomial time."""
+ return 0, None
+
+ def broken_find_lookback(self, method, address=None):
+ if address is None:
+ address = self.address
+
+ existing = self.lookbacks.get(method, {}).get(address)
+ if existing != None:
+ return existing
+
+ lookback = 0, None
+
+ # Better to not carelessly optimize at the moment.
+ """
+ if address < 2:
+ return lookback
+ """
+
+ byte = self.read(address)
+ if byte is None:
+ return lookback
+
+ direction, mutate = {
+ 'repeat': ( 1, int),
+ 'reverse': (-1, int),
+ 'flip': ( 1, self.bit_flip),
+ }[method]
+
+ # Doesn't seem to help
+ """
+ if mutate == self.bit_flip:
+ if byte == 0:
+ self.lookbacks[method][address] = lookback
+ return lookback
+ """
+
+ data_len = len(self.data)
+ is_two_byte_index = lambda index: int(index < address - 0x7f)
+
+ for index in self.get_indexes(mutate(byte)):
+
+ if index >= address:
+ break
+
+ old_length, old_index = lookback
+ if direction == 1:
+ if old_length > data_len - index: break
+ else:
+ if old_length > index: continue
+
+ if self.read(index) in [None]: continue
+
+ length = 1 # we know there's at least one match, or we wouldn't be checking this index
+ while 1:
+ this_byte = self.read(address + length)
+ that_byte = self.read(index + length * direction)
+ if that_byte == None or this_byte != mutate(that_byte):
+ break
+ length += 1
+
+ score = length - is_two_byte_index(index)
+ old_score = old_length - is_two_byte_index(old_index)
+ if score >= old_score or (score == old_score and length > old_length):
+ # XXX maybe avoid two-byte indexes when possible
+ if score >= lookback[0] - is_two_byte_index(lookback[1]):
+ lookback = length, index
+
+ self.lookbacks[method][address] = lookback
+ return lookback
+
+ def get_indexes(self, byte):
+ if not self.indexes.has_key(byte):
+ self.indexes[byte] = []
+ index = -1
+ while 1:
+ try:
+ index = self.data.index(byte, index + 1)
+ except ValueError:
+ break
+ self.indexes[byte].append(index)
+ return self.indexes[byte]
+
+ def score_literal(self, method):
+ address = self.address
+
+ compare = {
+ 'blank': [0],
+ 'iterate': [self.read(address)],
+ 'alternate': [self.read(address), self.read(address + 1)],
+ }[method]
+
+ # XXX may or may not be correct
+ if method == 'alternate' and compare[0] == 0:
+ return
+
+ length = 0
+ while self.read(address + length) == compare[length % len(compare)]:
+ length += 1
+
+ self.scores[method] = length
+ self.helpers[method] = compare
+
+ def do_winner(self):
+ winners = filter(
+ lambda (method, score):
+ score
+ > self.min_scores[method] + int(score > lowmax),
+ self.scores.iteritems()
+ )
+ winners.sort(
+ key = lambda (method, score): (
+ -(score - self.min_scores[method] - int(score > lowmax)),
+ self.preference.index(method)
+ )
+ )
+ winner, score = winners[0]
+
+ length = min(score, max_length)
+ self.do_cmd(winner, length)
+ self.address += length
+
+ def do_cmd(self, cmd, length):
+ start_address = self.address
+
+ cmd_length = length - 1
+
+ output = []
+
+ if length > lowmax:
+ output.append(
+ (self.commands['long'] << 5)
+ + (self.commands[cmd] << 2)
+ + (cmd_length >> 8)
+ )
+ output.append(
+ cmd_length & 0xff
+ )
+ else:
+ output.append(
+ (self.commands[cmd] << 5)
+ + cmd_length
+ )
+
+ self.helpers['blank'] = [] # quick hack
+ output += self.helpers.get(cmd, [])
+
+ if cmd in self.lookback_methods:
+ offset = self.offsets[cmd]
+ # Negative offsets are one byte.
+ # Positive offsets are two.
+ if 0 < start_address - offset - 1 <= 0x7f:
+ offset = (start_address - offset - 1) | 0x80
+ output += [offset]
+ else:
+ output += [offset / 0x100, offset % 0x100] # big endian
+
+ if self.debug:
+ print ' '.join(map(str, [
+ cmd, length, '\t',
+ ' '.join(map('{:02x}'.format, output)),
+ self.data[start_address:start_address+length] if cmd in self.lookback_methods else '',
+ ]))
+
+ self.output += output
+
+
+
+class Decompressed:
+ """
+ Interpret and decompress lz-compressed data, usually 2bpp.
+ """
+
+ """
+ Usage:
+ data = Decompressed(lz).output
+ or
+ data = Decompressed().decompress(lz)
+ or
+ d = Decompressed()
+ d.lz = lz
+ data = d.decompress()
+
+ To decompress from offset 0x80000 in a rom:
+ data = Decompressed(rom, start=0x80000).output
+ """
+
+ lz = None
+ start = 0
+ commands = lz_commands
+ debug = False
+
+ arg_names = 'lz', 'start', 'commands', 'debug'
+
+ def __init__(self, *args, **kwargs):
+ self.__dict__.update(dict(zip(self.arg_names, args)))
+ self.__dict__.update(kwargs)
+
+ self.command_names = dict(map(reversed, self.commands.items()))
+ self.address = self.start
+
+ if self.lz is not None:
+ self.decompress()
+
+ if self.debug: print self.command_list()
+
+
+ def command_list(self):
+ """
+ Print a list of commands that were used. Useful for debugging.
+ """
+
+ text = ''
+
+ output_address = 0
+ for name, attrs in self.used_commands:
+ length = attrs['length']
+ address = attrs['address']
+ offset = attrs['offset']
+ direction = attrs['direction']
+
+ text += '{2:03x} {0}: {1}'.format(name, length, output_address)
+ text += '\t' + ' '.join(
+ '{:02x}'.format(int(byte))
+ for byte in self.lz[ address : address + attrs['cmd_length'] ]
+ )
+
+ if offset is not None:
+ repeated_data = self.output[ offset : offset + length * direction : direction ]
+ if name == 'flip':
+ repeated_data = map(bit_flipped.__getitem__, repeated_data)
+ text += ' [' + ' '.join(map('{:02x}'.format, repeated_data)) + ']'
+
+ text += '\n'
+ output_address += length
+
+ return text
+
+
+ def decompress(self, lz=None):
+
+ if lz is not None:
+ self.lz = lz
+
+ self.lz = bytearray(self.lz)
+
+ self.used_commands = []
+ self.output = []
+
+ while 1:
+
+ cmd_address = self.address
+ self.offset = None
+ self.direction = None
+
+ if (self.byte == lz_end):
+ self.next()
+ break
+
+ self.cmd = (self.byte & 0b11100000) >> 5
+
+ if self.cmd_name == 'long':
+ # 10-bit length
+ self.cmd = (self.byte & 0b00011100) >> 2
+ self.length = (self.next() & 0b00000011) * 0x100
+ self.length += self.next() + 1
+ else:
+ # 5-bit length
+ self.length = (self.next() & 0b00011111) + 1
+
+ self.__class__.__dict__[self.cmd_name](self)
+
+ self.used_commands += [(
+ self.cmd_name,
+ {
+ 'length': self.length,
+ 'address': cmd_address,
+ 'offset': self.offset,
+ 'cmd_length': self.address - cmd_address,
+ 'direction': self.direction,
+ }
+ )]
+
+ # Keep track of the data we just decompressed.
+ self.compressed_data = self.lz[self.start : self.address]
+
+
+ @property
+ def byte(self):
+ return self.lz[ self.address ]
+
+ def next(self):
+ byte = self.byte
+ self.address += 1
+ return byte
+
+ @property
+ def cmd_name(self):
+ return self.command_names.get(self.cmd)
+
+
+ def get_offset(self):
+
+ if self.byte >= 0x80: # negative
+ # negative
+ offset = self.next() & 0x7f
+ offset = len(self.output) - offset - 1
+ else:
+ # positive
+ offset = self.next() * 0x100
+ offset += self.next()
+
+ self.offset = offset
+
+
+ def literal(self):
+ """
+ Copy data directly.
+ """
+ self.output += self.lz[ self.address : self.address + self.length ]
+ self.address += self.length
+
+ def iterate(self):
+ """
+ Write one byte repeatedly.
+ """
+ self.output += [self.next()] * self.length
+
+ def alternate(self):
+ """
+ Write alternating bytes.
+ """
+ alts = [self.next(), self.next()]
+ self.output += [ alts[x & 1] for x in xrange(self.length) ]
+
+ def blank(self):
+ """
+ Write zeros.
+ """
+ self.output += [0] * self.length
+
+ def flip(self):
+ """
+ Repeat flipped bytes from output.
+
+ Example: 11100100 -> 00100111
+ """
+ self._repeat(table=bit_flipped)
+
+ def reverse(self):
+ """
+ Repeat reversed bytes from output.
+ """
+ self._repeat(direction=-1)
+
+ def repeat(self):
+ """
+ Repeat bytes from output.
+ """
+ self._repeat()
+
+ def _repeat(self, direction=1, table=None):
+ self.get_offset()
+ self.direction = direction
+ # Note: appends must be one at a time (this way, repeats can draw from themselves if required)
+ for i in xrange(self.length):
+ byte = self.output[ self.offset + i * direction ]
+ self.output.append( table[byte] if table else byte )
diff --git a/tools/pokemontools/png.py b/tools/pokemontools/png.py
new file mode 100644
index 000000000..db6da1287
--- /dev/null
+++ b/tools/pokemontools/png.py
@@ -0,0 +1,2650 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+
+# png.py - PNG encoder/decoder in pure Python
+#
+# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
+# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
+# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org>
+#
+# Original concept by Johann C. Rocholl.
+#
+# LICENCE (MIT)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+Pure Python PNG Reader/Writer
+
+This Python module implements support for PNG images (see PNG
+specification at http://www.w3.org/TR/2003/REC-PNG-20031110/ ). It reads
+and writes PNG files with all allowable bit depths
+(1/2/4/8/16/24/32/48/64 bits per pixel) and colour combinations:
+greyscale (1/2/4/8/16 bit); RGB, RGBA, LA (greyscale with alpha) with
+8/16 bits per channel; colour mapped images (1/2/4/8 bit).
+Adam7 interlacing is supported for reading and
+writing. A number of optional chunks can be specified (when writing)
+and understood (when reading): ``tRNS``, ``bKGD``, ``gAMA``.
+
+For help, type ``import png; help(png)`` in your python interpreter.
+
+A good place to start is the :class:`Reader` and :class:`Writer`
+classes.
+
+Requires Python 2.3. Limited support is available for Python 2.2, but
+not everything works. Best with Python 2.4 and higher. Installation is
+trivial, but see the ``README.txt`` file (with the source distribution)
+for details.
+
+This file can also be used as a command-line utility to convert
+`Netpbm <http://netpbm.sourceforge.net/>`_ PNM files to PNG, and the
+reverse conversion from PNG to PNM. The interface is similar to that
+of the ``pnmtopng`` program from Netpbm. Type ``python png.py --help``
+at the shell prompt for usage and a list of options.
+
+A note on spelling and terminology
+----------------------------------
+
+Generally British English spelling is used in the documentation. So
+that's "greyscale" and "colour". This not only matches the author's
+native language, it's also used by the PNG specification.
+
+The major colour models supported by PNG (and hence by PyPNG) are:
+greyscale, RGB, greyscale--alpha, RGB--alpha. These are sometimes
+referred to using the abbreviations: L, RGB, LA, RGBA. In this case
+each letter abbreviates a single channel: *L* is for Luminance or Luma
+or Lightness which is the channel used in greyscale images; *R*, *G*,
+*B* stand for Red, Green, Blue, the components of a colour image; *A*
+stands for Alpha, the opacity channel (used for transparency effects,
+but higher values are more opaque, so it makes sense to call it
+opacity).
+
+A note on formats
+-----------------
+
+When getting pixel data out of this module (reading) and presenting
+data to this module (writing) there are a number of ways the data could
+be represented as a Python value. Generally this module uses one of
+three formats called "flat row flat pixel", "boxed row flat pixel", and
+"boxed row boxed pixel". Basically the concern is whether each pixel
+and each row comes in its own little tuple (box), or not.
+
+Consider an image that is 3 pixels wide by 2 pixels high, and each pixel
+has RGB components:
+
+Boxed row flat pixel::
+
+ list([R,G,B, R,G,B, R,G,B],
+ [R,G,B, R,G,B, R,G,B])
+
+Each row appears as its own list, but the pixels are flattened so
+that three values for one pixel simply follow the three values for
+the previous pixel. This is the most common format used, because it
+provides a good compromise between space and convenience. PyPNG regards
+itself as at liberty to replace any sequence type with any sufficiently
+compatible other sequence type; in practice each row is an array (from
+the array module), and the outer list is sometimes an iterator rather
+than an explicit list (so that streaming is possible).
+
+Flat row flat pixel::
+
+ [R,G,B, R,G,B, R,G,B,
+ R,G,B, R,G,B, R,G,B]
+
+The entire image is one single giant sequence of colour values.
+Generally an array will be used (to save space), not a list.
+
+Boxed row boxed pixel::
+
+ list([ (R,G,B), (R,G,B), (R,G,B) ],
+ [ (R,G,B), (R,G,B), (R,G,B) ])
+
+Each row appears in its own list, but each pixel also appears in its own
+tuple. A serious memory burn in Python.
+
+In all cases the top row comes first, and for each row the pixels are
+ordered from left-to-right. Within a pixel the values appear in the
+order, R-G-B-A (or L-A for greyscale--alpha).
+
+There is a fourth format, mentioned because it is used internally,
+is close to what lies inside a PNG file itself, and has some support
+from the public API. This format is called packed. When packed,
+each row is a sequence of bytes (integers from 0 to 255), just as
+it is before PNG scanline filtering is applied. When the bit depth
+is 8 this is essentially the same as boxed row flat pixel; when the
+bit depth is less than 8, several pixels are packed into each byte;
+when the bit depth is 16 (the only value more than 8 that is supported
+by the PNG image format) each pixel value is decomposed into 2 bytes
+(and `packed` is a misnomer). This format is used by the
+:meth:`Writer.write_packed` method. It isn't usually a convenient
+format, but may be just right if the source data for the PNG image
+comes from something that uses a similar format (for example, 1-bit
+BMPs, or another PNG file).
+
+And now, my famous members
+--------------------------
+"""
+
+__version__ = "0.0.18"
+
+import itertools
+import math
+# http://www.python.org/doc/2.4.4/lib/module-operator.html
+import operator
+import struct
+import sys
+# http://www.python.org/doc/2.4.4/lib/module-warnings.html
+import warnings
+import zlib
+
+from array import array
+from functools import reduce
+
+try:
+ # `cpngfilters` is a Cython module: it must be compiled by
+ # Cython for this import to work.
+ # If this import does work, then it overrides pure-python
+ # filtering functions defined later in this file (see `class
+ # pngfilters`).
+ import cpngfilters as pngfilters
+except ImportError:
+ pass
+
+
+__all__ = ['Image', 'Reader', 'Writer', 'write_chunks', 'from_array']
+
+
+# The PNG signature.
+# http://www.w3.org/TR/PNG/#5PNG-file-signature
+_signature = struct.pack('8B', 137, 80, 78, 71, 13, 10, 26, 10)
+
+_adam7 = ((0, 0, 8, 8),
+ (4, 0, 8, 8),
+ (0, 4, 4, 8),
+ (2, 0, 4, 4),
+ (0, 2, 2, 4),
+ (1, 0, 2, 2),
+ (0, 1, 1, 2))
+
+def group(s, n):
+ # See http://www.python.org/doc/2.6/library/functions.html#zip
+ return list(zip(*[iter(s)]*n))
+
+def isarray(x):
+ return isinstance(x, array)
+
+def tostring(row):
+ return row.tostring()
+
+def interleave_planes(ipixels, apixels, ipsize, apsize):
+ """
+ Interleave (colour) planes, e.g. RGB + A = RGBA.
+
+ Return an array of pixels consisting of the `ipsize` elements of
+ data from each pixel in `ipixels` followed by the `apsize` elements
+ of data from each pixel in `apixels`. Conventionally `ipixels`
+ and `apixels` are byte arrays so the sizes are bytes, but it
+ actually works with any arrays of the same type. The returned
+ array is the same type as the input arrays which should be the
+ same type as each other.
+ """
+
+ itotal = len(ipixels)
+ atotal = len(apixels)
+ newtotal = itotal + atotal
+ newpsize = ipsize + apsize
+ # Set up the output buffer
+ # See http://www.python.org/doc/2.4.4/lib/module-array.html#l2h-1356
+ out = array(ipixels.typecode)
+ # It's annoying that there is no cheap way to set the array size :-(
+ out.extend(ipixels)
+ out.extend(apixels)
+ # Interleave in the pixel data
+ for i in range(ipsize):
+ out[i:newtotal:newpsize] = ipixels[i:itotal:ipsize]
+ for i in range(apsize):
+ out[i+ipsize:newtotal:newpsize] = apixels[i:atotal:apsize]
+ return out
+
+def check_palette(palette):
+ """Check a palette argument (to the :class:`Writer` class)
+ for validity. Returns the palette as a list if okay; raises an
+ exception otherwise.
+ """
+
+ # None is the default and is allowed.
+ if palette is None:
+ return None
+
+ p = list(palette)
+ if not (0 < len(p) <= 256):
+ raise ValueError("a palette must have between 1 and 256 entries")
+ seen_triple = False
+ for i,t in enumerate(p):
+ if len(t) not in (3,4):
+ raise ValueError(
+ "palette entry %d: entries must be 3- or 4-tuples." % i)
+ if len(t) == 3:
+ seen_triple = True
+ if seen_triple and len(t) == 4:
+ raise ValueError(
+ "palette entry %d: all 4-tuples must precede all 3-tuples" % i)
+ for x in t:
+ if int(x) != x or not(0 <= x <= 255):
+ raise ValueError(
+ "palette entry %d: values must be integer: 0 <= x <= 255" % i)
+ return p
+
+def check_sizes(size, width, height):
+ """Check that these arguments, in supplied, are consistent.
+ Return a (width, height) pair.
+ """
+
+ if not size:
+ return width, height
+
+ if len(size) != 2:
+ raise ValueError(
+ "size argument should be a pair (width, height)")
+ if width is not None and width != size[0]:
+ raise ValueError(
+ "size[0] (%r) and width (%r) should match when both are used."
+ % (size[0], width))
+ if height is not None and height != size[1]:
+ raise ValueError(
+ "size[1] (%r) and height (%r) should match when both are used."
+ % (size[1], height))
+ return size
+
+def check_color(c, greyscale, which):
+ """Checks that a colour argument for transparent or
+ background options is the right form. Returns the colour
+ (which, if it's a bar integer, is "corrected" to a 1-tuple).
+ """
+
+ if c is None:
+ return c
+ if greyscale:
+ try:
+ len(c)
+ except TypeError:
+ c = (c,)
+ if len(c) != 1:
+ raise ValueError("%s for greyscale must be 1-tuple" %
+ which)
+ if not isinteger(c[0]):
+ raise ValueError(
+ "%s colour for greyscale must be integer" % which)
+ else:
+ if not (len(c) == 3 and
+ isinteger(c[0]) and
+ isinteger(c[1]) and
+ isinteger(c[2])):
+ raise ValueError(
+ "%s colour must be a triple of integers" % which)
+ return c
+
+class Error(Exception):
+ def __str__(self):
+ return self.__class__.__name__ + ': ' + ' '.join(self.args)
+
+class FormatError(Error):
+ """Problem with input file format. In other words, PNG file does
+ not conform to the specification in some way and is invalid.
+ """
+
+class ChunkError(FormatError):
+ pass
+
+
+class Writer:
+ """
+ PNG encoder in pure Python.
+ """
+
+ def __init__(self, width=None, height=None,
+ size=None,
+ greyscale=False,
+ alpha=False,
+ bitdepth=8,
+ palette=None,
+ transparent=None,
+ background=None,
+ gamma=None,
+ compression=None,
+ interlace=False,
+ bytes_per_sample=None, # deprecated
+ planes=None,
+ colormap=None,
+ maxval=None,
+ chunk_limit=2**20,
+ x_pixels_per_unit = None,
+ y_pixels_per_unit = None,
+ unit_is_meter = False):
+ """
+ Create a PNG encoder object.
+
+ Arguments:
+
+ width, height
+ Image size in pixels, as two separate arguments.
+ size
+ Image size (w,h) in pixels, as single argument.
+ greyscale
+ Input data is greyscale, not RGB.
+ alpha
+ Input data has alpha channel (RGBA or LA).
+ bitdepth
+ Bit depth: from 1 to 16.
+ palette
+ Create a palette for a colour mapped image (colour type 3).
+ transparent
+ Specify a transparent colour (create a ``tRNS`` chunk).
+ background
+ Specify a default background colour (create a ``bKGD`` chunk).
+ gamma
+ Specify a gamma value (create a ``gAMA`` chunk).
+ compression
+ zlib compression level: 0 (none) to 9 (more compressed);
+ default: -1 or None.
+ interlace
+ Create an interlaced image.
+ chunk_limit
+ Write multiple ``IDAT`` chunks to save memory.
+ x_pixels_per_unit
+ Number of pixels a unit along the x axis (write a
+ `pHYs` chunk).
+ y_pixels_per_unit
+ Number of pixels a unit along the y axis (write a
+ `pHYs` chunk). Along with `x_pixel_unit`, this gives
+ the pixel size ratio.
+ unit_is_meter
+ `True` to indicate that the unit (for the `pHYs`
+ chunk) is metre.
+
+ The image size (in pixels) can be specified either by using the
+ `width` and `height` arguments, or with the single `size`
+ argument. If `size` is used it should be a pair (*width*,
+ *height*).
+
+ `greyscale` and `alpha` are booleans that specify whether
+ an image is greyscale (or colour), and whether it has an
+ alpha channel (or not).
+
+ `bitdepth` specifies the bit depth of the source pixel values.
+ Each source pixel value must be an integer between 0 and
+ ``2**bitdepth-1``. For example, 8-bit images have values
+ between 0 and 255. PNG only stores images with bit depths of
+ 1,2,4,8, or 16. When `bitdepth` is not one of these values,
+ the next highest valid bit depth is selected, and an ``sBIT``
+ (significant bits) chunk is generated that specifies the
+ original precision of the source image. In this case the
+ supplied pixel values will be rescaled to fit the range of
+ the selected bit depth.
+
+ The details of which bit depth / colour model combinations the
+ PNG file format supports directly, are somewhat arcane
+ (refer to the PNG specification for full details). Briefly:
+ "small" bit depths (1,2,4) are only allowed with greyscale and
+ colour mapped images; colour mapped images cannot have bit depth
+ 16.
+
+ For colour mapped images (in other words, when the `palette`
+ argument is specified) the `bitdepth` argument must match one of
+ the valid PNG bit depths: 1, 2, 4, or 8. (It is valid to have a
+ PNG image with a palette and an ``sBIT`` chunk, but the meaning
+ is slightly different; it would be awkward to press the
+ `bitdepth` argument into service for this.)
+
+ The `palette` option, when specified, causes a colour
+ mapped image to be created: the PNG colour type is set to 3;
+ `greyscale` must not be set; `alpha` must not be set;
+ `transparent` must not be set; the bit depth must be 1,2,4,
+ or 8. When a colour mapped image is created, the pixel values
+ are palette indexes and the `bitdepth` argument specifies the
+ size of these indexes (not the size of the colour values in
+ the palette).
+
+ The palette argument value should be a sequence of 3- or
+ 4-tuples. 3-tuples specify RGB palette entries; 4-tuples
+ specify RGBA palette entries. If both 4-tuples and 3-tuples
+ appear in the sequence then all the 4-tuples must come
+ before all the 3-tuples. A ``PLTE`` chunk is created; if there
+ are 4-tuples then a ``tRNS`` chunk is created as well. The
+ ``PLTE`` chunk will contain all the RGB triples in the same
+ sequence; the ``tRNS`` chunk will contain the alpha channel for
+ all the 4-tuples, in the same sequence. Palette entries
+ are always 8-bit.
+
+ If specified, the `transparent` and `background` parameters must
+ be a tuple with three integer values for red, green, blue, or
+ a simple integer (or singleton tuple) for a greyscale image.
+
+ If specified, the `gamma` parameter must be a positive number
+ (generally, a `float`). A ``gAMA`` chunk will be created.
+ Note that this will not change the values of the pixels as
+ they appear in the PNG file, they are assumed to have already
+ been converted appropriately for the gamma specified.
+
+ The `compression` argument specifies the compression level to
+ be used by the ``zlib`` module. Values from 1 to 9 specify
+ compression, with 9 being "more compressed" (usually smaller
+ and slower, but it doesn't always work out that way). 0 means
+ no compression. -1 and ``None`` both mean that the default
+ level of compession will be picked by the ``zlib`` module
+ (which is generally acceptable).
+
+ If `interlace` is true then an interlaced image is created
+ (using PNG's so far only interace method, *Adam7*). This does
+ not affect how the pixels should be presented to the encoder,
+ rather it changes how they are arranged into the PNG file.
+ On slow connexions interlaced images can be partially decoded
+ by the browser to give a rough view of the image that is
+ successively refined as more image data appears.
+
+ .. note ::
+
+ Enabling the `interlace` option requires the entire image
+ to be processed in working memory.
+
+ `chunk_limit` is used to limit the amount of memory used whilst
+ compressing the image. In order to avoid using large amounts of
+ memory, multiple ``IDAT`` chunks may be created.
+ """
+
+ # At the moment the `planes` argument is ignored;
+ # its purpose is to act as a dummy so that
+ # ``Writer(x, y, **info)`` works, where `info` is a dictionary
+ # returned by Reader.read and friends.
+ # Ditto for `colormap`.
+
+ width, height = check_sizes(size, width, height)
+ del size
+
+ if width <= 0 or height <= 0:
+ raise ValueError("width and height must be greater than zero")
+ if not isinteger(width) or not isinteger(height):
+ raise ValueError("width and height must be integers")
+ # http://www.w3.org/TR/PNG/#7Integers-and-byte-order
+ if width > 2**32-1 or height > 2**32-1:
+ raise ValueError("width and height cannot exceed 2**32-1")
+
+ if alpha and transparent is not None:
+ raise ValueError(
+ "transparent colour not allowed with alpha channel")
+
+ if bytes_per_sample is not None:
+ warnings.warn('please use bitdepth instead of bytes_per_sample',
+ DeprecationWarning)
+ if bytes_per_sample not in (0.125, 0.25, 0.5, 1, 2):
+ raise ValueError(
+ "bytes per sample must be .125, .25, .5, 1, or 2")
+ bitdepth = int(8*bytes_per_sample)
+ del bytes_per_sample
+ if not isinteger(bitdepth) or bitdepth < 1 or 16 < bitdepth:
+ raise ValueError("bitdepth (%r) must be a positive integer <= 16" %
+ bitdepth)
+
+ self.rescale = None
+ palette = check_palette(palette)
+ if palette:
+ if bitdepth not in (1,2,4,8):
+ raise ValueError("with palette, bitdepth must be 1, 2, 4, or 8")
+ if transparent is not None:
+ raise ValueError("transparent and palette not compatible")
+ if alpha:
+ raise ValueError("alpha and palette not compatible")
+ if greyscale:
+ raise ValueError("greyscale and palette not compatible")
+ else:
+ # No palette, check for sBIT chunk generation.
+ if alpha or not greyscale:
+ if bitdepth not in (8,16):
+ targetbitdepth = (8,16)[bitdepth > 8]
+ self.rescale = (bitdepth, targetbitdepth)
+ bitdepth = targetbitdepth
+ del targetbitdepth
+ else:
+ assert greyscale
+ assert not alpha
+ if bitdepth not in (1,2,4,8,16):
+ if bitdepth > 8:
+ targetbitdepth = 16
+ elif bitdepth == 3:
+ targetbitdepth = 4
+ else:
+ assert bitdepth in (5,6,7)
+ targetbitdepth = 8
+ self.rescale = (bitdepth, targetbitdepth)
+ bitdepth = targetbitdepth
+ del targetbitdepth
+
+ if bitdepth < 8 and (alpha or not greyscale and not palette):
+ raise ValueError(
+ "bitdepth < 8 only permitted with greyscale or palette")
+ if bitdepth > 8 and palette:
+ raise ValueError(
+ "bit depth must be 8 or less for images with palette")
+
+ transparent = check_color(transparent, greyscale, 'transparent')
+ background = check_color(background, greyscale, 'background')
+
+ # It's important that the true boolean values (greyscale, alpha,
+ # colormap, interlace) are converted to bool because Iverson's
+ # convention is relied upon later on.
+ self.width = width
+ self.height = height
+ self.transparent = transparent
+ self.background = background
+ self.gamma = gamma
+ self.greyscale = bool(greyscale)
+ self.alpha = bool(alpha)
+ self.colormap = bool(palette)
+ self.bitdepth = int(bitdepth)
+ self.compression = compression
+ self.chunk_limit = chunk_limit
+ self.interlace = bool(interlace)
+ self.palette = palette
+ self.x_pixels_per_unit = x_pixels_per_unit
+ self.y_pixels_per_unit = y_pixels_per_unit
+ self.unit_is_meter = bool(unit_is_meter)
+
+ self.color_type = 4*self.alpha + 2*(not greyscale) + 1*self.colormap
+ assert self.color_type in (0,2,3,4,6)
+
+ self.color_planes = (3,1)[self.greyscale or self.colormap]
+ self.planes = self.color_planes + self.alpha
+ # :todo: fix for bitdepth < 8
+ self.psize = (self.bitdepth/8) * self.planes
+
+ def make_palette(self):
+ """Create the byte sequences for a ``PLTE`` and if necessary a
+ ``tRNS`` chunk. Returned as a pair (*p*, *t*). *t* will be
+ ``None`` if no ``tRNS`` chunk is necessary.
+ """
+
+ p = array('B')
+ t = array('B')
+
+ for x in self.palette:
+ p.extend(x[0:3])
+ if len(x) > 3:
+ t.append(x[3])
+ p = tostring(p)
+ t = tostring(t)
+ if t:
+ return p,t
+ return p,None
+
+ def write(self, outfile, rows):
+ """Write a PNG image to the output file. `rows` should be
+ an iterable that yields each row in boxed row flat pixel
+ format. The rows should be the rows of the original image,
+ so there should be ``self.height`` rows of ``self.width *
+ self.planes`` values. If `interlace` is specified (when
+ creating the instance), then an interlaced PNG file will
+ be written. Supply the rows in the normal image order;
+ the interlacing is carried out internally.
+
+ .. note ::
+
+ Interlacing will require the entire image to be in working
+ memory.
+ """
+
+ if self.interlace:
+ fmt = 'BH'[self.bitdepth > 8]
+ a = array(fmt, itertools.chain(*rows))
+ return self.write_array(outfile, a)
+
+ nrows = self.write_passes(outfile, rows)
+ if nrows != self.height:
+ raise ValueError(
+ "rows supplied (%d) does not match height (%d)" %
+ (nrows, self.height))
+
+ def write_passes(self, outfile, rows, packed=False):
+ """
+ Write a PNG image to the output file.
+
+ Most users are expected to find the :meth:`write` or
+ :meth:`write_array` method more convenient.
+
+ The rows should be given to this method in the order that
+ they appear in the output file. For straightlaced images,
+ this is the usual top to bottom ordering, but for interlaced
+ images the rows should have already been interlaced before
+ passing them to this function.
+
+ `rows` should be an iterable that yields each row. When
+ `packed` is ``False`` the rows should be in boxed row flat pixel
+ format; when `packed` is ``True`` each row should be a packed
+ sequence of bytes.
+ """
+
+ # http://www.w3.org/TR/PNG/#5PNG-file-signature
+ outfile.write(_signature)
+
+ # http://www.w3.org/TR/PNG/#11IHDR
+ write_chunk(outfile, b'IHDR',
+ struct.pack("!2I5B", self.width, self.height,
+ self.bitdepth, self.color_type,
+ 0, 0, self.interlace))
+
+ # See :chunk:order
+ # http://www.w3.org/TR/PNG/#11gAMA
+ if self.gamma is not None:
+ write_chunk(outfile, b'gAMA',
+ struct.pack("!L", int(round(self.gamma*1e5))))
+
+ # See :chunk:order
+ # http://www.w3.org/TR/PNG/#11sBIT
+ if self.rescale:
+ write_chunk(outfile, b'sBIT',
+ struct.pack('%dB' % self.planes,
+ *[self.rescale[0]]*self.planes))
+
+ # :chunk:order: Without a palette (PLTE chunk), ordering is
+ # relatively relaxed. With one, gAMA chunk must precede PLTE
+ # chunk which must precede tRNS and bKGD.
+ # See http://www.w3.org/TR/PNG/#5ChunkOrdering
+ if self.palette:
+ p,t = self.make_palette()
+ write_chunk(outfile, b'PLTE', p)
+ if t:
+ # tRNS chunk is optional. Only needed if palette entries
+ # have alpha.
+ write_chunk(outfile, b'tRNS', t)
+
+ # http://www.w3.org/TR/PNG/#11tRNS
+ if self.transparent is not None:
+ if self.greyscale:
+ write_chunk(outfile, b'tRNS',
+ struct.pack("!1H", *self.transparent))
+ else:
+ write_chunk(outfile, b'tRNS',
+ struct.pack("!3H", *self.transparent))
+
+ # http://www.w3.org/TR/PNG/#11bKGD
+ if self.background is not None:
+ if self.greyscale:
+ write_chunk(outfile, b'bKGD',
+ struct.pack("!1H", *self.background))
+ else:
+ write_chunk(outfile, b'bKGD',
+ struct.pack("!3H", *self.background))
+
+ # http://www.w3.org/TR/PNG/#11pHYs
+ if self.x_pixels_per_unit is not None and self.y_pixels_per_unit is not None:
+ tup = (self.x_pixels_per_unit, self.y_pixels_per_unit, int(self.unit_is_meter))
+ write_chunk(outfile, b'pHYs', struct.pack("!LLB",*tup))
+
+ # http://www.w3.org/TR/PNG/#11IDAT
+ if self.compression is not None:
+ compressor = zlib.compressobj(self.compression)
+ else:
+ compressor = zlib.compressobj()
+
+ # Choose an extend function based on the bitdepth. The extend
+ # function packs/decomposes the pixel values into bytes and
+ # stuffs them onto the data array.
+ data = array('B')
+ if self.bitdepth == 8 or packed:
+ extend = data.extend
+ elif self.bitdepth == 16:
+ # Decompose into bytes
+ def extend(sl):
+ fmt = '!%dH' % len(sl)
+ data.extend(array('B', struct.pack(fmt, *sl)))
+ else:
+ # Pack into bytes
+ assert self.bitdepth < 8
+ # samples per byte
+ spb = int(8/self.bitdepth)
+ def extend(sl):
+ a = array('B', sl)
+ # Adding padding bytes so we can group into a whole
+ # number of spb-tuples.
+ l = float(len(a))
+ extra = math.ceil(l / float(spb))*spb - l
+ a.extend([0]*int(extra))
+ # Pack into bytes
+ l = group(a, spb)
+ l = [reduce(lambda x,y:
+ (x << self.bitdepth) + y, e) for e in l]
+ data.extend(l)
+ if self.rescale:
+ oldextend = extend
+ factor = \
+ float(2**self.rescale[1]-1) / float(2**self.rescale[0]-1)
+ def extend(sl):
+ oldextend([int(round(factor*x)) for x in sl])
+
+ # Build the first row, testing mostly to see if we need to
+ # changed the extend function to cope with NumPy integer types
+ # (they cause our ordinary definition of extend to fail, so we
+ # wrap it). See
+ # http://code.google.com/p/pypng/issues/detail?id=44
+ enumrows = enumerate(rows)
+ del rows
+
+ # First row's filter type.
+ data.append(0)
+ # :todo: Certain exceptions in the call to ``.next()`` or the
+ # following try would indicate no row data supplied.
+ # Should catch.
+ i,row = next(enumrows)
+ try:
+ # If this fails...
+ extend(row)
+ except:
+ # ... try a version that converts the values to int first.
+ # Not only does this work for the (slightly broken) NumPy
+ # types, there are probably lots of other, unknown, "nearly"
+ # int types it works for.
+ def wrapmapint(f):
+ return lambda sl: f([int(x) for x in sl])
+ extend = wrapmapint(extend)
+ del wrapmapint
+ extend(row)
+
+ for i,row in enumrows:
+ # Add "None" filter type. Currently, it's essential that
+ # this filter type be used for every scanline as we do not
+ # mark the first row of a reduced pass image; that means we
+ # could accidentally compute the wrong filtered scanline if
+ # we used "up", "average", or "paeth" on such a line.
+ data.append(0)
+ extend(row)
+ if len(data) > self.chunk_limit:
+ compressed = compressor.compress(tostring(data))
+ if len(compressed):
+ write_chunk(outfile, b'IDAT', compressed)
+ # Because of our very witty definition of ``extend``,
+ # above, we must re-use the same ``data`` object. Hence
+ # we use ``del`` to empty this one, rather than create a
+ # fresh one (which would be my natural FP instinct).
+ del data[:]
+ if len(data):
+ compressed = compressor.compress(tostring(data))
+ else:
+ compressed = b''
+ flushed = compressor.flush()
+ if len(compressed) or len(flushed):
+ write_chunk(outfile, b'IDAT', compressed + flushed)
+ # http://www.w3.org/TR/PNG/#11IEND
+ write_chunk(outfile, b'IEND')
+ return i+1
+
+ def write_array(self, outfile, pixels):
+ """
+ Write an array in flat row flat pixel format as a PNG file on
+ the output file. See also :meth:`write` method.
+ """
+
+ if self.interlace:
+ self.write_passes(outfile, self.array_scanlines_interlace(pixels))
+ else:
+ self.write_passes(outfile, self.array_scanlines(pixels))
+
+ def write_packed(self, outfile, rows):
+ """
+ Write PNG file to `outfile`. The pixel data comes from `rows`
+ which should be in boxed row packed format. Each row should be
+ a sequence of packed bytes.
+
+ Technically, this method does work for interlaced images but it
+ is best avoided. For interlaced images, the rows should be
+ presented in the order that they appear in the file.
+
+ This method should not be used when the source image bit depth
+ is not one naturally supported by PNG; the bit depth should be
+ 1, 2, 4, 8, or 16.
+ """
+
+ if self.rescale:
+ raise Error("write_packed method not suitable for bit depth %d" %
+ self.rescale[0])
+ return self.write_passes(outfile, rows, packed=True)
+
+ def convert_pnm(self, infile, outfile):
+ """
+ Convert a PNM file containing raw pixel data into a PNG file
+ with the parameters set in the writer object. Works for
+ (binary) PGM, PPM, and PAM formats.
+ """
+
+ if self.interlace:
+ pixels = array('B')
+ pixels.fromfile(infile,
+ (self.bitdepth/8) * self.color_planes *
+ self.width * self.height)
+ self.write_passes(outfile, self.array_scanlines_interlace(pixels))
+ else:
+ self.write_passes(outfile, self.file_scanlines(infile))
+
+ def convert_ppm_and_pgm(self, ppmfile, pgmfile, outfile):
+ """
+ Convert a PPM and PGM file containing raw pixel data into a
+ PNG outfile with the parameters set in the writer object.
+ """
+ pixels = array('B')
+ pixels.fromfile(ppmfile,
+ (self.bitdepth/8) * self.color_planes *
+ self.width * self.height)
+ apixels = array('B')
+ apixels.fromfile(pgmfile,
+ (self.bitdepth/8) *
+ self.width * self.height)
+ pixels = interleave_planes(pixels, apixels,
+ (self.bitdepth/8) * self.color_planes,
+ (self.bitdepth/8))
+ if self.interlace:
+ self.write_passes(outfile, self.array_scanlines_interlace(pixels))
+ else:
+ self.write_passes(outfile, self.array_scanlines(pixels))
+
+ def file_scanlines(self, infile):
+ """
+ Generates boxed rows in flat pixel format, from the input file
+ `infile`. It assumes that the input file is in a "Netpbm-like"
+ binary format, and is positioned at the beginning of the first
+ pixel. The number of pixels to read is taken from the image
+ dimensions (`width`, `height`, `planes`) and the number of bytes
+ per value is implied by the image `bitdepth`.
+ """
+
+ # Values per row
+ vpr = self.width * self.planes
+ row_bytes = vpr
+ if self.bitdepth > 8:
+ assert self.bitdepth == 16
+ row_bytes *= 2
+ fmt = '>%dH' % vpr
+ def line():
+ return array('H', struct.unpack(fmt, infile.read(row_bytes)))
+ else:
+ def line():
+ scanline = array('B', infile.read(row_bytes))
+ return scanline
+ for y in range(self.height):
+ yield line()
+
+ def array_scanlines(self, pixels):
+ """
+ Generates boxed rows (flat pixels) from flat rows (flat pixels)
+ in an array.
+ """
+
+ # Values per row
+ vpr = self.width * self.planes
+ stop = 0
+ for y in range(self.height):
+ start = stop
+ stop = start + vpr
+ yield pixels[start:stop]
+
+ def array_scanlines_interlace(self, pixels):
+ """
+ Generator for interlaced scanlines from an array. `pixels` is
+ the full source image in flat row flat pixel format. The
+ generator yields each scanline of the reduced passes in turn, in
+ boxed row flat pixel format.
+ """
+
+ # http://www.w3.org/TR/PNG/#8InterlaceMethods
+ # Array type.
+ fmt = 'BH'[self.bitdepth > 8]
+ # Value per row
+ vpr = self.width * self.planes
+ for xstart, ystart, xstep, ystep in _adam7:
+ if xstart >= self.width:
+ continue
+ # Pixels per row (of reduced image)
+ ppr = int(math.ceil((self.width-xstart)/float(xstep)))
+ # number of values in reduced image row.
+ row_len = ppr*self.planes
+ for y in range(ystart, self.height, ystep):
+ if xstep == 1:
+ offset = y * vpr
+ yield pixels[offset:offset+vpr]
+ else:
+ row = array(fmt)
+ # There's no easier way to set the length of an array
+ row.extend(pixels[0:row_len])
+ offset = y * vpr + xstart * self.planes
+ end_offset = (y+1) * vpr
+ skip = self.planes * xstep
+ for i in range(self.planes):
+ row[i::self.planes] = \
+ pixels[offset+i:end_offset:skip]
+ yield row
+
+def write_chunk(outfile, tag, data=b''):
+ """
+ Write a PNG chunk to the output file, including length and
+ checksum.
+ """
+
+ # http://www.w3.org/TR/PNG/#5Chunk-layout
+ outfile.write(struct.pack("!I", len(data)))
+ outfile.write(tag)
+ outfile.write(data)
+ checksum = zlib.crc32(tag)
+ checksum = zlib.crc32(data, checksum)
+ checksum &= 2**32-1
+ outfile.write(struct.pack("!I", checksum))
+
+def write_chunks(out, chunks):
+ """Create a PNG file by writing out the chunks."""
+
+ out.write(_signature)
+ for chunk in chunks:
+ write_chunk(out, *chunk)
+
+def filter_scanline(type, line, fo, prev=None):
+ """Apply a scanline filter to a scanline. `type` specifies the
+ filter type (0 to 4); `line` specifies the current (unfiltered)
+ scanline as a sequence of bytes; `prev` specifies the previous
+ (unfiltered) scanline as a sequence of bytes. `fo` specifies the
+ filter offset; normally this is size of a pixel in bytes (the number
+ of bytes per sample times the number of channels), but when this is
+ < 1 (for bit depths < 8) then the filter offset is 1.
+ """
+
+ assert 0 <= type < 5
+
+ # The output array. Which, pathetically, we extend one-byte at a
+ # time (fortunately this is linear).
+ out = array('B', [type])
+
+ def sub():
+ ai = -fo
+ for x in line:
+ if ai >= 0:
+ x = (x - line[ai]) & 0xff
+ out.append(x)
+ ai += 1
+ def up():
+ for i,x in enumerate(line):
+ x = (x - prev[i]) & 0xff
+ out.append(x)
+ def average():
+ ai = -fo
+ for i,x in enumerate(line):
+ if ai >= 0:
+ x = (x - ((line[ai] + prev[i]) >> 1)) & 0xff
+ else:
+ x = (x - (prev[i] >> 1)) & 0xff
+ out.append(x)
+ ai += 1
+ def paeth():
+ # http://www.w3.org/TR/PNG/#9Filter-type-4-Paeth
+ ai = -fo # also used for ci
+ for i,x in enumerate(line):
+ a = 0
+ b = prev[i]
+ c = 0
+
+ if ai >= 0:
+ a = line[ai]
+ c = prev[ai]
+ p = a + b - c
+ pa = abs(p - a)
+ pb = abs(p - b)
+ pc = abs(p - c)
+ if pa <= pb and pa <= pc:
+ Pr = a
+ elif pb <= pc:
+ Pr = b
+ else:
+ Pr = c
+
+ x = (x - Pr) & 0xff
+ out.append(x)
+ ai += 1
+
+ if not prev:
+ # We're on the first line. Some of the filters can be reduced
+ # to simpler cases which makes handling the line "off the top"
+ # of the image simpler. "up" becomes "none"; "paeth" becomes
+ # "left" (non-trivial, but true). "average" needs to be handled
+ # specially.
+ if type == 2: # "up"
+ type = 0
+ elif type == 3:
+ prev = [0]*len(line)
+ elif type == 4: # "paeth"
+ type = 1
+ if type == 0:
+ out.extend(line)
+ elif type == 1:
+ sub()
+ elif type == 2:
+ up()
+ elif type == 3:
+ average()
+ else: # type == 4
+ paeth()
+ return out
+
+
+def from_array(a, mode=None, info={}):
+ """Create a PNG :class:`Image` object from a 2- or 3-dimensional
+ array. One application of this function is easy PIL-style saving:
+ ``png.from_array(pixels, 'L').save('foo.png')``.
+
+ Unless they are specified using the *info* parameter, the PNG's
+ height and width are taken from the array size. For a 3 dimensional
+ array the first axis is the height; the second axis is the width;
+ and the third axis is the channel number. Thus an RGB image that is
+ 16 pixels high and 8 wide will use an array that is 16x8x3. For 2
+ dimensional arrays the first axis is the height, but the second axis
+ is ``width*channels``, so an RGB image that is 16 pixels high and 8
+ wide will use a 2-dimensional array that is 16x24 (each row will be
+ 8*3 = 24 sample values).
+
+ *mode* is a string that specifies the image colour format in a
+ PIL-style mode. It can be:
+
+ ``'L'``
+ greyscale (1 channel)
+ ``'LA'``
+ greyscale with alpha (2 channel)
+ ``'RGB'``
+ colour image (3 channel)
+ ``'RGBA'``
+ colour image with alpha (4 channel)
+
+ The mode string can also specify the bit depth (overriding how this
+ function normally derives the bit depth, see below). Appending
+ ``';16'`` to the mode will cause the PNG to be 16 bits per channel;
+ any decimal from 1 to 16 can be used to specify the bit depth.
+
+ When a 2-dimensional array is used *mode* determines how many
+ channels the image has, and so allows the width to be derived from
+ the second array dimension.
+
+ The array is expected to be a ``numpy`` array, but it can be any
+ suitable Python sequence. For example, a list of lists can be used:
+ ``png.from_array([[0, 255, 0], [255, 0, 255]], 'L')``. The exact
+ rules are: ``len(a)`` gives the first dimension, height;
+ ``len(a[0])`` gives the second dimension; ``len(a[0][0])`` gives the
+ third dimension, unless an exception is raised in which case a
+ 2-dimensional array is assumed. It's slightly more complicated than
+ that because an iterator of rows can be used, and it all still
+ works. Using an iterator allows data to be streamed efficiently.
+
+ The bit depth of the PNG is normally taken from the array element's
+ datatype (but if *mode* specifies a bitdepth then that is used
+ instead). The array element's datatype is determined in a way which
+ is supposed to work both for ``numpy`` arrays and for Python
+ ``array.array`` objects. A 1 byte datatype will give a bit depth of
+ 8, a 2 byte datatype will give a bit depth of 16. If the datatype
+ does not have an implicit size, for example it is a plain Python
+ list of lists, as above, then a default of 8 is used.
+
+ The *info* parameter is a dictionary that can be used to specify
+ metadata (in the same style as the arguments to the
+ :class:`png.Writer` class). For this function the keys that are
+ useful are:
+
+ height
+ overrides the height derived from the array dimensions and allows
+ *a* to be an iterable.
+ width
+ overrides the width derived from the array dimensions.
+ bitdepth
+ overrides the bit depth derived from the element datatype (but
+ must match *mode* if that also specifies a bit depth).
+
+ Generally anything specified in the
+ *info* dictionary will override any implicit choices that this
+ function would otherwise make, but must match any explicit ones.
+ For example, if the *info* dictionary has a ``greyscale`` key then
+ this must be true when mode is ``'L'`` or ``'LA'`` and false when
+ mode is ``'RGB'`` or ``'RGBA'``.
+ """
+
+ # We abuse the *info* parameter by modifying it. Take a copy here.
+ # (Also typechecks *info* to some extent).
+ info = dict(info)
+
+ # Syntax check mode string.
+ bitdepth = None
+ try:
+ # Assign the 'L' or 'RGBA' part to `gotmode`.
+ if mode.startswith('L'):
+ gotmode = 'L'
+ mode = mode[1:]
+ elif mode.startswith('RGB'):
+ gotmode = 'RGB'
+ mode = mode[3:]
+ else:
+ raise Error()
+ if mode.startswith('A'):
+ gotmode += 'A'
+ mode = mode[1:]
+
+ # Skip any optional ';'
+ while mode.startswith(';'):
+ mode = mode[1:]
+
+ # Parse optional bitdepth
+ if mode:
+ try:
+ bitdepth = int(mode)
+ except (TypeError, ValueError):
+ raise Error()
+ except Error:
+ raise Error("mode string should be 'RGB' or 'L;16' or similar.")
+ mode = gotmode
+
+ # Get bitdepth from *mode* if possible.
+ if bitdepth:
+ if info.get('bitdepth') and bitdepth != info['bitdepth']:
+ raise Error("mode bitdepth (%d) should match info bitdepth (%d)." %
+ (bitdepth, info['bitdepth']))
+ info['bitdepth'] = bitdepth
+
+ # Fill in and/or check entries in *info*.
+ # Dimensions.
+ if 'size' in info:
+ # Check width, height, size all match where used.
+ for dimension,axis in [('width', 0), ('height', 1)]:
+ if dimension in info:
+ if info[dimension] != info['size'][axis]:
+ raise Error(
+ "info[%r] should match info['size'][%r]." %
+ (dimension, axis))
+ info['width'],info['height'] = info['size']
+ if 'height' not in info:
+ try:
+ l = len(a)
+ except TypeError:
+ raise Error(
+ "len(a) does not work, supply info['height'] instead.")
+ info['height'] = l
+ # Colour format.
+ if 'greyscale' in info:
+ if bool(info['greyscale']) != ('L' in mode):
+ raise Error("info['greyscale'] should match mode.")
+ info['greyscale'] = 'L' in mode
+ if 'alpha' in info:
+ if bool(info['alpha']) != ('A' in mode):
+ raise Error("info['alpha'] should match mode.")
+ info['alpha'] = 'A' in mode
+
+ planes = len(mode)
+ if 'planes' in info:
+ if info['planes'] != planes:
+ raise Error("info['planes'] should match mode.")
+
+ # In order to work out whether we the array is 2D or 3D we need its
+ # first row, which requires that we take a copy of its iterator.
+ # We may also need the first row to derive width and bitdepth.
+ a,t = itertools.tee(a)
+ row = next(t)
+ del t
+ try:
+ row[0][0]
+ threed = True
+ testelement = row[0]
+ except (IndexError, TypeError):
+ threed = False
+ testelement = row
+ if 'width' not in info:
+ if threed:
+ width = len(row)
+ else:
+ width = len(row) // planes
+ info['width'] = width
+
+ if threed:
+ # Flatten the threed rows
+ a = (itertools.chain.from_iterable(x) for x in a)
+
+ if 'bitdepth' not in info:
+ try:
+ dtype = testelement.dtype
+ # goto the "else:" clause. Sorry.
+ except AttributeError:
+ try:
+ # Try a Python array.array.
+ bitdepth = 8 * testelement.itemsize
+ except AttributeError:
+ # We can't determine it from the array element's
+ # datatype, use a default of 8.
+ bitdepth = 8
+ else:
+ # If we got here without exception, we now assume that
+ # the array is a numpy array.
+ if dtype.kind == 'b':
+ bitdepth = 1
+ else:
+ bitdepth = 8 * dtype.itemsize
+ info['bitdepth'] = bitdepth
+
+ for thing in 'width height bitdepth greyscale alpha'.split():
+ assert thing in info
+ return Image(a, info)
+
+# So that refugee's from PIL feel more at home. Not documented.
+fromarray = from_array
+
+class Image:
+ """A PNG image. You can create an :class:`Image` object from
+ an array of pixels by calling :meth:`png.from_array`. It can be
+ saved to disk with the :meth:`save` method.
+ """
+
+ def __init__(self, rows, info):
+ """
+ .. note ::
+
+ The constructor is not public. Please do not call it.
+ """
+
+ self.rows = rows
+ self.info = info
+
+ def save(self, file):
+ """Save the image to *file*. If *file* looks like an open file
+ descriptor then it is used, otherwise it is treated as a
+ filename and a fresh file is opened.
+
+ In general, you can only call this method once; after it has
+ been called the first time and the PNG image has been saved, the
+ source data will have been streamed, and cannot be streamed
+ again.
+ """
+
+ w = Writer(**self.info)
+
+ try:
+ file.write
+ def close(): pass
+ except AttributeError:
+ file = open(file, 'wb')
+ def close(): file.close()
+
+ try:
+ w.write(file, self.rows)
+ finally:
+ close()
+
+class _readable:
+ """
+ A simple file-like interface for strings and arrays.
+ """
+
+ def __init__(self, buf):
+ self.buf = buf
+ self.offset = 0
+
+ def read(self, n):
+ r = self.buf[self.offset:self.offset+n]
+ if isarray(r):
+ r = r.tostring()
+ self.offset += n
+ return r
+
+try:
+ str(b'dummy', 'ascii')
+except TypeError:
+ as_str = str
+else:
+ def as_str(x):
+ return str(x, 'ascii')
+
+class Reader:
+ """
+ PNG decoder in pure Python.
+ """
+
+ def __init__(self, _guess=None, **kw):
+ """
+ Create a PNG decoder object.
+
+ The constructor expects exactly one keyword argument. If you
+ supply a positional argument instead, it will guess the input
+ type. You can choose among the following keyword arguments:
+
+ filename
+ Name of input file (a PNG file).
+ file
+ A file-like object (object with a read() method).
+ bytes
+ ``array`` or ``string`` with PNG data.
+
+ """
+ if ((_guess is not None and len(kw) != 0) or
+ (_guess is None and len(kw) != 1)):
+ raise TypeError("Reader() takes exactly 1 argument")
+
+ # Will be the first 8 bytes, later on. See validate_signature.
+ self.signature = None
+ self.transparent = None
+ # A pair of (len,type) if a chunk has been read but its data and
+ # checksum have not (in other words the file position is just
+ # past the 4 bytes that specify the chunk type). See preamble
+ # method for how this is used.
+ self.atchunk = None
+
+ if _guess is not None:
+ if isarray(_guess):
+ kw["bytes"] = _guess
+ elif isinstance(_guess, str):
+ kw["filename"] = _guess
+ elif hasattr(_guess, 'read'):
+ kw["file"] = _guess
+
+ if "filename" in kw:
+ self.file = open(kw["filename"], "rb")
+ elif "file" in kw:
+ self.file = kw["file"]
+ elif "bytes" in kw:
+ self.file = _readable(kw["bytes"])
+ else:
+ raise TypeError("expecting filename, file or bytes array")
+
+
+ def chunk(self, seek=None, lenient=False):
+ """
+ Read the next PNG chunk from the input file; returns a
+ (*type*, *data*) tuple. *type* is the chunk's type as a
+ byte string (all PNG chunk types are 4 bytes long).
+ *data* is the chunk's data content, as a byte string.
+
+ If the optional `seek` argument is
+ specified then it will keep reading chunks until it either runs
+ out of file or finds the type specified by the argument. Note
+ that in general the order of chunks in PNGs is unspecified, so
+ using `seek` can cause you to miss chunks.
+
+ If the optional `lenient` argument evaluates to `True`,
+ checksum failures will raise warnings rather than exceptions.
+ """
+
+ self.validate_signature()
+
+ while True:
+ # http://www.w3.org/TR/PNG/#5Chunk-layout
+ if not self.atchunk:
+ self.atchunk = self.chunklentype()
+ length, type = self.atchunk
+ self.atchunk = None
+ data = self.file.read(length)
+ if len(data) != length:
+ raise ChunkError('Chunk %s too short for required %i octets.'
+ % (type, length))
+ checksum = self.file.read(4)
+ if len(checksum) != 4:
+ raise ChunkError('Chunk %s too short for checksum.' % type)
+ if seek and type != seek:
+ continue
+ verify = zlib.crc32(type)
+ verify = zlib.crc32(data, verify)
+ # Whether the output from zlib.crc32 is signed or not varies
+ # according to hideous implementation details, see
+ # http://bugs.python.org/issue1202 .
+ # We coerce it to be positive here (in a way which works on
+ # Python 2.3 and older).
+ verify &= 2**32 - 1
+ verify = struct.pack('!I', verify)
+ if checksum != verify:
+ (a, ) = struct.unpack('!I', checksum)
+ (b, ) = struct.unpack('!I', verify)
+ message = "Checksum error in %s chunk: 0x%08X != 0x%08X." % (type, a, b)
+ if lenient:
+ warnings.warn(message, RuntimeWarning)
+ else:
+ raise ChunkError(message)
+ return type, data
+
+ def chunks(self):
+ """Return an iterator that will yield each chunk as a
+ (*chunktype*, *content*) pair.
+ """
+
+ while True:
+ t,v = self.chunk()
+ yield t,v
+ if t == b'IEND':
+ break
+
+ def undo_filter(self, filter_type, scanline, previous):
+ """Undo the filter for a scanline. `scanline` is a sequence of
+ bytes that does not include the initial filter type byte.
+ `previous` is decoded previous scanline (for straightlaced
+ images this is the previous pixel row, but for interlaced
+ images, it is the previous scanline in the reduced image, which
+ in general is not the previous pixel row in the final image).
+ When there is no previous scanline (the first row of a
+ straightlaced image, or the first row in one of the passes in an
+ interlaced image), then this argument should be ``None``.
+
+ The scanline will have the effects of filtering removed, and the
+ result will be returned as a fresh sequence of bytes.
+ """
+
+ # :todo: Would it be better to update scanline in place?
+ # Yes, with the Cython extension making the undo_filter fast,
+ # updating scanline inplace makes the code 3 times faster
+ # (reading 50 images of 800x800 went from 40s to 16s)
+ result = scanline
+
+ if filter_type == 0:
+ return result
+
+ if filter_type not in (1,2,3,4):
+ raise FormatError('Invalid PNG Filter Type.'
+ ' See http://www.w3.org/TR/2003/REC-PNG-20031110/#9Filters .')
+
+ # Filter unit. The stride from one pixel to the corresponding
+ # byte from the previous pixel. Normally this is the pixel
+ # size in bytes, but when this is smaller than 1, the previous
+ # byte is used instead.
+ fu = max(1, self.psize)
+
+ # For the first line of a pass, synthesize a dummy previous
+ # line. An alternative approach would be to observe that on the
+ # first line 'up' is the same as 'null', 'paeth' is the same
+ # as 'sub', with only 'average' requiring any special case.
+ if not previous:
+ previous = array('B', [0]*len(scanline))
+
+ def sub():
+ """Undo sub filter."""
+
+ ai = 0
+ # Loop starts at index fu. Observe that the initial part
+ # of the result is already filled in correctly with
+ # scanline.
+ for i in range(fu, len(result)):
+ x = scanline[i]
+ a = result[ai]
+ result[i] = (x + a) & 0xff
+ ai += 1
+
+ def up():
+ """Undo up filter."""
+
+ for i in range(len(result)):
+ x = scanline[i]
+ b = previous[i]
+ result[i] = (x + b) & 0xff
+
+ def average():
+ """Undo average filter."""
+
+ ai = -fu
+ for i in range(len(result)):
+ x = scanline[i]
+ if ai < 0:
+ a = 0
+ else:
+ a = result[ai]
+ b = previous[i]
+ result[i] = (x + ((a + b) >> 1)) & 0xff
+ ai += 1
+
+ def paeth():
+ """Undo Paeth filter."""
+
+ # Also used for ci.
+ ai = -fu
+ for i in range(len(result)):
+ x = scanline[i]
+ if ai < 0:
+ a = c = 0
+ else:
+ a = result[ai]
+ c = previous[ai]
+ b = previous[i]
+ p = a + b - c
+ pa = abs(p - a)
+ pb = abs(p - b)
+ pc = abs(p - c)
+ if pa <= pb and pa <= pc:
+ pr = a
+ elif pb <= pc:
+ pr = b
+ else:
+ pr = c
+ result[i] = (x + pr) & 0xff
+ ai += 1
+
+ # Call appropriate filter algorithm. Note that 0 has already
+ # been dealt with.
+ (None,
+ pngfilters.undo_filter_sub,
+ pngfilters.undo_filter_up,
+ pngfilters.undo_filter_average,
+ pngfilters.undo_filter_paeth)[filter_type](fu, scanline, previous, result)
+ return result
+
+ def deinterlace(self, raw):
+ """
+ Read raw pixel data, undo filters, deinterlace, and flatten.
+ Return in flat row flat pixel format.
+ """
+
+ # Values per row (of the target image)
+ vpr = self.width * self.planes
+
+ # Make a result array, and make it big enough. Interleaving
+ # writes to the output array randomly (well, not quite), so the
+ # entire output array must be in memory.
+ fmt = 'BH'[self.bitdepth > 8]
+ a = array(fmt, [0]*vpr*self.height)
+ source_offset = 0
+
+ for xstart, ystart, xstep, ystep in _adam7:
+ if xstart >= self.width:
+ continue
+ # The previous (reconstructed) scanline. None at the
+ # beginning of a pass to indicate that there is no previous
+ # line.
+ recon = None
+ # Pixels per row (reduced pass image)
+ ppr = int(math.ceil((self.width-xstart)/float(xstep)))
+ # Row size in bytes for this pass.
+ row_size = int(math.ceil(self.psize * ppr))
+ for y in range(ystart, self.height, ystep):
+ filter_type = raw[source_offset]
+ source_offset += 1
+ scanline = raw[source_offset:source_offset+row_size]
+ source_offset += row_size
+ recon = self.undo_filter(filter_type, scanline, recon)
+ # Convert so that there is one element per pixel value
+ flat = self.serialtoflat(recon, ppr)
+ if xstep == 1:
+ assert xstart == 0
+ offset = y * vpr
+ a[offset:offset+vpr] = flat
+ else:
+ offset = y * vpr + xstart * self.planes
+ end_offset = (y+1) * vpr
+ skip = self.planes * xstep
+ for i in range(self.planes):
+ a[offset+i:end_offset:skip] = \
+ flat[i::self.planes]
+ return a
+
+ def iterboxed(self, rows):
+ """Iterator that yields each scanline in boxed row flat pixel
+ format. `rows` should be an iterator that yields the bytes of
+ each row in turn.
+ """
+
+ def asvalues(raw):
+ """Convert a row of raw bytes into a flat row. Result will
+ be a freshly allocated object, not shared with
+ argument.
+ """
+
+ if self.bitdepth == 8:
+ return array('B', raw)
+ if self.bitdepth == 16:
+ raw = tostring(raw)
+ return array('H', struct.unpack('!%dH' % (len(raw)//2), raw))
+ assert self.bitdepth < 8
+ width = self.width
+ # Samples per byte
+ spb = 8//self.bitdepth
+ out = array('B')
+ mask = 2**self.bitdepth - 1
+ shifts = [self.bitdepth * i
+ for i in reversed(list(range(spb)))]
+ for o in raw:
+ out.extend([mask&(o>>i) for i in shifts])
+ return out[:width]
+
+ return map(asvalues, rows)
+
+ def serialtoflat(self, bytes, width=None):
+ """Convert serial format (byte stream) pixel data to flat row
+ flat pixel.
+ """
+
+ if self.bitdepth == 8:
+ return bytes
+ if self.bitdepth == 16:
+ bytes = tostring(bytes)
+ return array('H',
+ struct.unpack('!%dH' % (len(bytes)//2), bytes))
+ assert self.bitdepth < 8
+ if width is None:
+ width = self.width
+ # Samples per byte
+ spb = 8//self.bitdepth
+ out = array('B')
+ mask = 2**self.bitdepth - 1
+ shifts = list(map(self.bitdepth.__mul__, reversed(list(range(spb)))))
+ l = width
+ for o in bytes:
+ out.extend([(mask&(o>>s)) for s in shifts][:l])
+ l -= spb
+ if l <= 0:
+ l = width
+ return out
+
+ def iterstraight(self, raw):
+ """Iterator that undoes the effect of filtering, and yields
+ each row in serialised format (as a sequence of bytes).
+ Assumes input is straightlaced. `raw` should be an iterable
+ that yields the raw bytes in chunks of arbitrary size.
+ """
+
+ # length of row, in bytes
+ rb = self.row_bytes
+ a = array('B')
+ # The previous (reconstructed) scanline. None indicates first
+ # line of image.
+ recon = None
+ for some in raw:
+ a.extend(some)
+ while len(a) >= rb + 1:
+ filter_type = a[0]
+ scanline = a[1:rb+1]
+ del a[:rb+1]
+ recon = self.undo_filter(filter_type, scanline, recon)
+ yield recon
+ if len(a) != 0:
+ # :file:format We get here with a file format error:
+ # when the available bytes (after decompressing) do not
+ # pack into exact rows.
+ raise FormatError(
+ 'Wrong size for decompressed IDAT chunk.')
+ assert len(a) == 0
+
+ def validate_signature(self):
+ """If signature (header) has not been read then read and
+ validate it; otherwise do nothing.
+ """
+
+ if self.signature:
+ return
+ self.signature = self.file.read(8)
+ if self.signature != _signature:
+ raise FormatError("PNG file has invalid signature.")
+
+ def preamble(self, lenient=False):
+ """
+ Extract the image metadata by reading the initial part of
+ the PNG file up to the start of the ``IDAT`` chunk. All the
+ chunks that precede the ``IDAT`` chunk are read and either
+ processed for metadata or discarded.
+
+ If the optional `lenient` argument evaluates to `True`, checksum
+ failures will raise warnings rather than exceptions.
+ """
+
+ self.validate_signature()
+
+ while True:
+ if not self.atchunk:
+ self.atchunk = self.chunklentype()
+ if self.atchunk is None:
+ raise FormatError(
+ 'This PNG file has no IDAT chunks.')
+ if self.atchunk[1] == b'IDAT':
+ return
+ self.process_chunk(lenient=lenient)
+
+ def chunklentype(self):
+ """Reads just enough of the input to determine the next
+ chunk's length and type, returned as a (*length*, *type*) pair
+ where *type* is a string. If there are no more chunks, ``None``
+ is returned.
+ """
+
+ x = self.file.read(8)
+ if not x:
+ return None
+ if len(x) != 8:
+ raise FormatError(
+ 'End of file whilst reading chunk length and type.')
+ length,type = struct.unpack('!I4s', x)
+ if length > 2**31-1:
+ raise FormatError('Chunk %s is too large: %d.' % (type,length))
+ return length,type
+
+ def process_chunk(self, lenient=False):
+ """Process the next chunk and its data. This only processes the
+ following chunk types, all others are ignored: ``IHDR``,
+ ``PLTE``, ``bKGD``, ``tRNS``, ``gAMA``, ``sBIT``, ``pHYs``.
+
+ If the optional `lenient` argument evaluates to `True`,
+ checksum failures will raise warnings rather than exceptions.
+ """
+
+ type, data = self.chunk(lenient=lenient)
+ method = '_process_' + as_str(type)
+ m = getattr(self, method, None)
+ if m:
+ m(data)
+
+ def _process_IHDR(self, data):
+ # http://www.w3.org/TR/PNG/#11IHDR
+ if len(data) != 13:
+ raise FormatError('IHDR chunk has incorrect length.')
+ (self.width, self.height, self.bitdepth, self.color_type,
+ self.compression, self.filter,
+ self.interlace) = struct.unpack("!2I5B", data)
+
+ check_bitdepth_colortype(self.bitdepth, self.color_type)
+
+ if self.compression != 0:
+ raise Error("unknown compression method %d" % self.compression)
+ if self.filter != 0:
+ raise FormatError("Unknown filter method %d,"
+ " see http://www.w3.org/TR/2003/REC-PNG-20031110/#9Filters ."
+ % self.filter)
+ if self.interlace not in (0,1):
+ raise FormatError("Unknown interlace method %d,"
+ " see http://www.w3.org/TR/2003/REC-PNG-20031110/#8InterlaceMethods ."
+ % self.interlace)
+
+ # Derived values
+ # http://www.w3.org/TR/PNG/#6Colour-values
+ colormap = bool(self.color_type & 1)
+ greyscale = not (self.color_type & 2)
+ alpha = bool(self.color_type & 4)
+ color_planes = (3,1)[greyscale or colormap]
+ planes = color_planes + alpha
+
+ self.colormap = colormap
+ self.greyscale = greyscale
+ self.alpha = alpha
+ self.color_planes = color_planes
+ self.planes = planes
+ self.psize = float(self.bitdepth)/float(8) * planes
+ if int(self.psize) == self.psize:
+ self.psize = int(self.psize)
+ self.row_bytes = int(math.ceil(self.width * self.psize))
+ # Stores PLTE chunk if present, and is used to check
+ # chunk ordering constraints.
+ self.plte = None
+ # Stores tRNS chunk if present, and is used to check chunk
+ # ordering constraints.
+ self.trns = None
+ # Stores sbit chunk if present.
+ self.sbit = None
+
+ def _process_PLTE(self, data):
+ # http://www.w3.org/TR/PNG/#11PLTE
+ if self.plte:
+ warnings.warn("Multiple PLTE chunks present.")
+ self.plte = data
+ if len(data) % 3 != 0:
+ raise FormatError(
+ "PLTE chunk's length should be a multiple of 3.")
+ if len(data) > (2**self.bitdepth)*3:
+ raise FormatError("PLTE chunk is too long.")
+ if len(data) == 0:
+ raise FormatError("Empty PLTE is not allowed.")
+
+ def _process_bKGD(self, data):
+ try:
+ if self.colormap:
+ if not self.plte:
+ warnings.warn(
+ "PLTE chunk is required before bKGD chunk.")
+ self.background = struct.unpack('B', data)
+ else:
+ self.background = struct.unpack("!%dH" % self.color_planes,
+ data)
+ except struct.error:
+ raise FormatError("bKGD chunk has incorrect length.")
+
+ def _process_tRNS(self, data):
+ # http://www.w3.org/TR/PNG/#11tRNS
+ self.trns = data
+ if self.colormap:
+ if not self.plte:
+ warnings.warn("PLTE chunk is required before tRNS chunk.")
+ else:
+ if len(data) > len(self.plte)/3:
+ # Was warning, but promoted to Error as it
+ # would otherwise cause pain later on.
+ raise FormatError("tRNS chunk is too long.")
+ else:
+ if self.alpha:
+ raise FormatError(
+ "tRNS chunk is not valid with colour type %d." %
+ self.color_type)
+ try:
+ self.transparent = \
+ struct.unpack("!%dH" % self.color_planes, data)
+ except struct.error:
+ raise FormatError("tRNS chunk has incorrect length.")
+
+ def _process_gAMA(self, data):
+ try:
+ self.gamma = struct.unpack("!L", data)[0] / 100000.0
+ except struct.error:
+ raise FormatError("gAMA chunk has incorrect length.")
+
+ def _process_sBIT(self, data):
+ self.sbit = data
+ if (self.colormap and len(data) != 3 or
+ not self.colormap and len(data) != self.planes):
+ raise FormatError("sBIT chunk has incorrect length.")
+
+ def _process_pHYs(self, data):
+ # http://www.w3.org/TR/PNG/#11pHYs
+ self.phys = data
+ fmt = "!LLB"
+ if len(data) != struct.calcsize(fmt):
+ raise FormatError("pHYs chunk has incorrect length.")
+ self.x_pixels_per_unit, self.y_pixels_per_unit, unit = struct.unpack(fmt,data)
+ self.unit_is_meter = bool(unit)
+
+ def read(self, lenient=False):
+ """
+ Read the PNG file and decode it. Returns (`width`, `height`,
+ `pixels`, `metadata`).
+
+ May use excessive memory.
+
+ `pixels` are returned in boxed row flat pixel format.
+
+ If the optional `lenient` argument evaluates to True,
+ checksum failures will raise warnings rather than exceptions.
+ """
+
+ def iteridat():
+ """Iterator that yields all the ``IDAT`` chunks as strings."""
+ while True:
+ try:
+ type, data = self.chunk(lenient=lenient)
+ except ValueError as e:
+ raise ChunkError(e.args[0])
+ if type == b'IEND':
+ # http://www.w3.org/TR/PNG/#11IEND
+ break
+ if type != b'IDAT':
+ continue
+ # type == b'IDAT'
+ # http://www.w3.org/TR/PNG/#11IDAT
+ if self.colormap and not self.plte:
+ warnings.warn("PLTE chunk is required before IDAT chunk")
+ yield data
+
+ def iterdecomp(idat):
+ """Iterator that yields decompressed strings. `idat` should
+ be an iterator that yields the ``IDAT`` chunk data.
+ """
+
+ # Currently, with no max_length parameter to decompress,
+ # this routine will do one yield per IDAT chunk: Not very
+ # incremental.
+ d = zlib.decompressobj()
+ # Each IDAT chunk is passed to the decompressor, then any
+ # remaining state is decompressed out.
+ for data in idat:
+ # :todo: add a max_length argument here to limit output
+ # size.
+ yield array('B', d.decompress(data))
+ yield array('B', d.flush())
+
+ self.preamble(lenient=lenient)
+ raw = iterdecomp(iteridat())
+
+ if self.interlace:
+ raw = array('B', itertools.chain(*raw))
+ arraycode = 'BH'[self.bitdepth>8]
+ # Like :meth:`group` but producing an array.array object for
+ # each row.
+ pixels = map(lambda *row: array(arraycode, row),
+ *[iter(self.deinterlace(raw))]*self.width*self.planes)
+ else:
+ pixels = self.iterboxed(self.iterstraight(raw))
+ meta = dict()
+ for attr in 'greyscale alpha planes bitdepth interlace'.split():
+ meta[attr] = getattr(self, attr)
+ meta['size'] = (self.width, self.height)
+ for attr in 'gamma transparent background'.split():
+ a = getattr(self, attr, None)
+ if a is not None:
+ meta[attr] = a
+ if self.plte:
+ meta['palette'] = self.palette()
+ return self.width, self.height, pixels, meta
+
+
+ def read_flat(self):
+ """
+ Read a PNG file and decode it into flat row flat pixel format.
+ Returns (*width*, *height*, *pixels*, *metadata*).
+
+ May use excessive memory.
+
+ `pixels` are returned in flat row flat pixel format.
+
+ See also the :meth:`read` method which returns pixels in the
+ more stream-friendly boxed row flat pixel format.
+ """
+
+ x, y, pixel, meta = self.read()
+ arraycode = 'BH'[meta['bitdepth']>8]
+ pixel = array(arraycode, itertools.chain(*pixel))
+ return x, y, pixel, meta
+
+ def palette(self, alpha='natural'):
+ """Returns a palette that is a sequence of 3-tuples or 4-tuples,
+ synthesizing it from the ``PLTE`` and ``tRNS`` chunks. These
+ chunks should have already been processed (for example, by
+ calling the :meth:`preamble` method). All the tuples are the
+ same size: 3-tuples if there is no ``tRNS`` chunk, 4-tuples when
+ there is a ``tRNS`` chunk. Assumes that the image is colour type
+ 3 and therefore a ``PLTE`` chunk is required.
+
+ If the `alpha` argument is ``'force'`` then an alpha channel is
+ always added, forcing the result to be a sequence of 4-tuples.
+ """
+
+ if not self.plte:
+ raise FormatError(
+ "Required PLTE chunk is missing in colour type 3 image.")
+ plte = group(array('B', self.plte), 3)
+ if self.trns or alpha == 'force':
+ trns = array('B', self.trns or '')
+ trns.extend([255]*(len(plte)-len(trns)))
+ plte = list(map(operator.add, plte, group(trns, 1)))
+ return plte
+
+ def asDirect(self):
+ """Returns the image data as a direct representation of an
+ ``x * y * planes`` array. This method is intended to remove the
+ need for callers to deal with palettes and transparency
+ themselves. Images with a palette (colour type 3)
+ are converted to RGB or RGBA; images with transparency (a
+ ``tRNS`` chunk) are converted to LA or RGBA as appropriate.
+ When returned in this format the pixel values represent the
+ colour value directly without needing to refer to palettes or
+ transparency information.
+
+ Like the :meth:`read` method this method returns a 4-tuple:
+
+ (*width*, *height*, *pixels*, *meta*)
+
+ This method normally returns pixel values with the bit depth
+ they have in the source image, but when the source PNG has an
+ ``sBIT`` chunk it is inspected and can reduce the bit depth of
+ the result pixels; pixel values will be reduced according to
+ the bit depth specified in the ``sBIT`` chunk (PNG nerds should
+ note a single result bit depth is used for all channels; the
+ maximum of the ones specified in the ``sBIT`` chunk. An RGB565
+ image will be rescaled to 6-bit RGB666).
+
+ The *meta* dictionary that is returned reflects the `direct`
+ format and not the original source image. For example, an RGB
+ source image with a ``tRNS`` chunk to represent a transparent
+ colour, will have ``planes=3`` and ``alpha=False`` for the
+ source image, but the *meta* dictionary returned by this method
+ will have ``planes=4`` and ``alpha=True`` because an alpha
+ channel is synthesized and added.
+
+ *pixels* is the pixel data in boxed row flat pixel format (just
+ like the :meth:`read` method).
+
+ All the other aspects of the image data are not changed.
+ """
+
+ self.preamble()
+
+ # Simple case, no conversion necessary.
+ if not self.colormap and not self.trns and not self.sbit:
+ return self.read()
+
+ x,y,pixels,meta = self.read()
+
+ if self.colormap:
+ meta['colormap'] = False
+ meta['alpha'] = bool(self.trns)
+ meta['bitdepth'] = 8
+ meta['planes'] = 3 + bool(self.trns)
+ plte = self.palette()
+ def iterpal(pixels):
+ for row in pixels:
+ row = [plte[x] for x in row]
+ yield array('B', itertools.chain(*row))
+ pixels = iterpal(pixels)
+ elif self.trns:
+ # It would be nice if there was some reasonable way
+ # of doing this without generating a whole load of
+ # intermediate tuples. But tuples does seem like the
+ # easiest way, with no other way clearly much simpler or
+ # much faster. (Actually, the L to LA conversion could
+ # perhaps go faster (all those 1-tuples!), but I still
+ # wonder whether the code proliferation is worth it)
+ it = self.transparent
+ maxval = 2**meta['bitdepth']-1
+ planes = meta['planes']
+ meta['alpha'] = True
+ meta['planes'] += 1
+ typecode = 'BH'[meta['bitdepth']>8]
+ def itertrns(pixels):
+ for row in pixels:
+ # For each row we group it into pixels, then form a
+ # characterisation vector that says whether each
+ # pixel is opaque or not. Then we convert
+ # True/False to 0/maxval (by multiplication),
+ # and add it as the extra channel.
+ row = group(row, planes)
+ opa = map(it.__ne__, row)
+ opa = map(maxval.__mul__, opa)
+ opa = list(zip(opa)) # convert to 1-tuples
+ yield array(typecode,
+ itertools.chain(*map(operator.add, row, opa)))
+ pixels = itertrns(pixels)
+ targetbitdepth = None
+ if self.sbit:
+ sbit = struct.unpack('%dB' % len(self.sbit), self.sbit)
+ targetbitdepth = max(sbit)
+ if targetbitdepth > meta['bitdepth']:
+ raise Error('sBIT chunk %r exceeds bitdepth %d' %
+ (sbit,self.bitdepth))
+ if min(sbit) <= 0:
+ raise Error('sBIT chunk %r has a 0-entry' % sbit)
+ if targetbitdepth == meta['bitdepth']:
+ targetbitdepth = None
+ if targetbitdepth:
+ shift = meta['bitdepth'] - targetbitdepth
+ meta['bitdepth'] = targetbitdepth
+ def itershift(pixels):
+ for row in pixels:
+ yield [p >> shift for p in row]
+ pixels = itershift(pixels)
+ return x,y,pixels,meta
+
+ def asFloat(self, maxval=1.0):
+ """Return image pixels as per :meth:`asDirect` method, but scale
+ all pixel values to be floating point values between 0.0 and
+ *maxval*.
+ """
+
+ x,y,pixels,info = self.asDirect()
+ sourcemaxval = 2**info['bitdepth']-1
+ del info['bitdepth']
+ info['maxval'] = float(maxval)
+ factor = float(maxval)/float(sourcemaxval)
+ def iterfloat():
+ for row in pixels:
+ yield [factor * p for p in row]
+ return x,y,iterfloat(),info
+
+ def _as_rescale(self, get, targetbitdepth):
+ """Helper used by :meth:`asRGB8` and :meth:`asRGBA8`."""
+
+ width,height,pixels,meta = get()
+ maxval = 2**meta['bitdepth'] - 1
+ targetmaxval = 2**targetbitdepth - 1
+ factor = float(targetmaxval) / float(maxval)
+ meta['bitdepth'] = targetbitdepth
+ def iterscale():
+ for row in pixels:
+ yield [int(round(x*factor)) for x in row]
+ if maxval == targetmaxval:
+ return width, height, pixels, meta
+ else:
+ return width, height, iterscale(), meta
+
+ def asRGB8(self):
+ """Return the image data as an RGB pixels with 8-bits per
+ sample. This is like the :meth:`asRGB` method except that
+ this method additionally rescales the values so that they
+ are all between 0 and 255 (8-bit). In the case where the
+ source image has a bit depth < 8 the transformation preserves
+ all the information; where the source image has bit depth
+ > 8, then rescaling to 8-bit values loses precision. No
+ dithering is performed. Like :meth:`asRGB`, an alpha channel
+ in the source image will raise an exception.
+
+ This function returns a 4-tuple:
+ (*width*, *height*, *pixels*, *metadata*).
+ *width*, *height*, *metadata* are as per the
+ :meth:`read` method.
+
+ *pixels* is the pixel data in boxed row flat pixel format.
+ """
+
+ return self._as_rescale(self.asRGB, 8)
+
+ def asRGBA8(self):
+ """Return the image data as RGBA pixels with 8-bits per
+ sample. This method is similar to :meth:`asRGB8` and
+ :meth:`asRGBA`: The result pixels have an alpha channel, *and*
+ values are rescaled to the range 0 to 255. The alpha channel is
+ synthesized if necessary (with a small speed penalty).
+ """
+
+ return self._as_rescale(self.asRGBA, 8)
+
+ def asRGB(self):
+ """Return image as RGB pixels. RGB colour images are passed
+ through unchanged; greyscales are expanded into RGB
+ triplets (there is a small speed overhead for doing this).
+
+ An alpha channel in the source image will raise an
+ exception.
+
+ The return values are as for the :meth:`read` method
+ except that the *metadata* reflect the returned pixels, not the
+ source image. In particular, for this method
+ ``metadata['greyscale']`` will be ``False``.
+ """
+
+ width,height,pixels,meta = self.asDirect()
+ if meta['alpha']:
+ raise Error("will not convert image with alpha channel to RGB")
+ if not meta['greyscale']:
+ return width,height,pixels,meta
+ meta['greyscale'] = False
+ typecode = 'BH'[meta['bitdepth'] > 8]
+ def iterrgb():
+ for row in pixels:
+ a = array(typecode, [0]) * 3 * width
+ for i in range(3):
+ a[i::3] = row
+ yield a
+ return width,height,iterrgb(),meta
+
+ def asRGBA(self):
+ """Return image as RGBA pixels. Greyscales are expanded into
+ RGB triplets; an alpha channel is synthesized if necessary.
+ The return values are as for the :meth:`read` method
+ except that the *metadata* reflect the returned pixels, not the
+ source image. In particular, for this method
+ ``metadata['greyscale']`` will be ``False``, and
+ ``metadata['alpha']`` will be ``True``.
+ """
+
+ width,height,pixels,meta = self.asDirect()
+ if meta['alpha'] and not meta['greyscale']:
+ return width,height,pixels,meta
+ typecode = 'BH'[meta['bitdepth'] > 8]
+ maxval = 2**meta['bitdepth'] - 1
+ maxbuffer = struct.pack('=' + typecode, maxval) * 4 * width
+ def newarray():
+ return array(typecode, maxbuffer)
+
+ if meta['alpha'] and meta['greyscale']:
+ # LA to RGBA
+ def convert():
+ for row in pixels:
+ # Create a fresh target row, then copy L channel
+ # into first three target channels, and A channel
+ # into fourth channel.
+ a = newarray()
+ pngfilters.convert_la_to_rgba(row, a)
+ yield a
+ elif meta['greyscale']:
+ # L to RGBA
+ def convert():
+ for row in pixels:
+ a = newarray()
+ pngfilters.convert_l_to_rgba(row, a)
+ yield a
+ else:
+ assert not meta['alpha'] and not meta['greyscale']
+ # RGB to RGBA
+ def convert():
+ for row in pixels:
+ a = newarray()
+ pngfilters.convert_rgb_to_rgba(row, a)
+ yield a
+ meta['alpha'] = True
+ meta['greyscale'] = False
+ return width,height,convert(),meta
+
+def check_bitdepth_colortype(bitdepth, colortype):
+ """Check that `bitdepth` and `colortype` are both valid,
+ and specified in a valid combination. Returns if valid,
+ raise an Exception if not valid.
+ """
+
+ if bitdepth not in (1,2,4,8,16):
+ raise FormatError("invalid bit depth %d" % bitdepth)
+ if colortype not in (0,2,3,4,6):
+ raise FormatError("invalid colour type %d" % colortype)
+ # Check indexed (palettized) images have 8 or fewer bits
+ # per pixel; check only indexed or greyscale images have
+ # fewer than 8 bits per pixel.
+ if colortype & 1 and bitdepth > 8:
+ raise FormatError(
+ "Indexed images (colour type %d) cannot"
+ " have bitdepth > 8 (bit depth %d)."
+ " See http://www.w3.org/TR/2003/REC-PNG-20031110/#table111 ."
+ % (bitdepth, colortype))
+ if bitdepth < 8 and colortype not in (0,3):
+ raise FormatError("Illegal combination of bit depth (%d)"
+ " and colour type (%d)."
+ " See http://www.w3.org/TR/2003/REC-PNG-20031110/#table111 ."
+ % (bitdepth, colortype))
+
+def isinteger(x):
+ try:
+ return int(x) == x
+ except (TypeError, ValueError):
+ return False
+
+
+# === Support for users without Cython ===
+
+try:
+ pngfilters
+except NameError:
+ class pngfilters(object):
+ def undo_filter_sub(filter_unit, scanline, previous, result):
+ """Undo sub filter."""
+
+ ai = 0
+ # Loops starts at index fu. Observe that the initial part
+ # of the result is already filled in correctly with
+ # scanline.
+ for i in range(filter_unit, len(result)):
+ x = scanline[i]
+ a = result[ai]
+ result[i] = (x + a) & 0xff
+ ai += 1
+ undo_filter_sub = staticmethod(undo_filter_sub)
+
+ def undo_filter_up(filter_unit, scanline, previous, result):
+ """Undo up filter."""
+
+ for i in range(len(result)):
+ x = scanline[i]
+ b = previous[i]
+ result[i] = (x + b) & 0xff
+ undo_filter_up = staticmethod(undo_filter_up)
+
+ def undo_filter_average(filter_unit, scanline, previous, result):
+ """Undo up filter."""
+
+ ai = -filter_unit
+ for i in range(len(result)):
+ x = scanline[i]
+ if ai < 0:
+ a = 0
+ else:
+ a = result[ai]
+ b = previous[i]
+ result[i] = (x + ((a + b) >> 1)) & 0xff
+ ai += 1
+ undo_filter_average = staticmethod(undo_filter_average)
+
+ def undo_filter_paeth(filter_unit, scanline, previous, result):
+ """Undo Paeth filter."""
+
+ # Also used for ci.
+ ai = -filter_unit
+ for i in range(len(result)):
+ x = scanline[i]
+ if ai < 0:
+ a = c = 0
+ else:
+ a = result[ai]
+ c = previous[ai]
+ b = previous[i]
+ p = a + b - c
+ pa = abs(p - a)
+ pb = abs(p - b)
+ pc = abs(p - c)
+ if pa <= pb and pa <= pc:
+ pr = a
+ elif pb <= pc:
+ pr = b
+ else:
+ pr = c
+ result[i] = (x + pr) & 0xff
+ ai += 1
+ undo_filter_paeth = staticmethod(undo_filter_paeth)
+
+ def convert_la_to_rgba(row, result):
+ for i in range(3):
+ result[i::4] = row[0::2]
+ result[3::4] = row[1::2]
+ convert_la_to_rgba = staticmethod(convert_la_to_rgba)
+
+ def convert_l_to_rgba(row, result):
+ """Convert a grayscale image to RGBA. This method assumes
+ the alpha channel in result is already correctly
+ initialized.
+ """
+ for i in range(3):
+ result[i::4] = row
+ convert_l_to_rgba = staticmethod(convert_l_to_rgba)
+
+ def convert_rgb_to_rgba(row, result):
+ """Convert an RGB image to RGBA. This method assumes the
+ alpha channel in result is already correctly initialized.
+ """
+ for i in range(3):
+ result[i::4] = row[i::3]
+ convert_rgb_to_rgba = staticmethod(convert_rgb_to_rgba)
+
+
+# === Command Line Support ===
+
+def read_pam_header(infile):
+ """
+ Read (the rest of a) PAM header. `infile` should be positioned
+ immediately after the initial 'P7' line (at the beginning of the
+ second line). Returns are as for `read_pnm_header`.
+ """
+
+ # Unlike PBM, PGM, and PPM, we can read the header a line at a time.
+ header = dict()
+ while True:
+ l = infile.readline().strip()
+ if l == b'ENDHDR':
+ break
+ if not l:
+ raise EOFError('PAM ended prematurely')
+ if l[0] == b'#':
+ continue
+ l = l.split(None, 1)
+ if l[0] not in header:
+ header[l[0]] = l[1]
+ else:
+ header[l[0]] += b' ' + l[1]
+
+ required = [b'WIDTH', b'HEIGHT', b'DEPTH', b'MAXVAL']
+ WIDTH,HEIGHT,DEPTH,MAXVAL = required
+ present = [x for x in required if x in header]
+ if len(present) != len(required):
+ raise Error('PAM file must specify WIDTH, HEIGHT, DEPTH, and MAXVAL')
+ width = int(header[WIDTH])
+ height = int(header[HEIGHT])
+ depth = int(header[DEPTH])
+ maxval = int(header[MAXVAL])
+ if (width <= 0 or
+ height <= 0 or
+ depth <= 0 or
+ maxval <= 0):
+ raise Error(
+ 'WIDTH, HEIGHT, DEPTH, MAXVAL must all be positive integers')
+ return 'P7', width, height, depth, maxval
+
+def read_pnm_header(infile, supported=(b'P5', b'P6')):
+ """
+ Read a PNM header, returning (format,width,height,depth,maxval).
+ `width` and `height` are in pixels. `depth` is the number of
+ channels in the image; for PBM and PGM it is synthesized as 1, for
+ PPM as 3; for PAM images it is read from the header. `maxval` is
+ synthesized (as 1) for PBM images.
+ """
+
+ # Generally, see http://netpbm.sourceforge.net/doc/ppm.html
+ # and http://netpbm.sourceforge.net/doc/pam.html
+
+ # Technically 'P7' must be followed by a newline, so by using
+ # rstrip() we are being liberal in what we accept. I think this
+ # is acceptable.
+ type = infile.read(3).rstrip()
+ if type not in supported:
+ raise NotImplementedError('file format %s not supported' % type)
+ if type == b'P7':
+ # PAM header parsing is completely different.
+ return read_pam_header(infile)
+ # Expected number of tokens in header (3 for P4, 4 for P6)
+ expected = 4
+ pbm = (b'P1', b'P4')
+ if type in pbm:
+ expected = 3
+ header = [type]
+
+ # We have to read the rest of the header byte by byte because the
+ # final whitespace character (immediately following the MAXVAL in
+ # the case of P6) may not be a newline. Of course all PNM files in
+ # the wild use a newline at this point, so it's tempting to use
+ # readline; but it would be wrong.
+ def getc():
+ c = infile.read(1)
+ if not c:
+ raise Error('premature EOF reading PNM header')
+ return c
+
+ c = getc()
+ while True:
+ # Skip whitespace that precedes a token.
+ while c.isspace():
+ c = getc()
+ # Skip comments.
+ while c == '#':
+ while c not in b'\n\r':
+ c = getc()
+ if not c.isdigit():
+ raise Error('unexpected character %s found in header' % c)
+ # According to the specification it is legal to have comments
+ # that appear in the middle of a token.
+ # This is bonkers; I've never seen it; and it's a bit awkward to
+ # code good lexers in Python (no goto). So we break on such
+ # cases.
+ token = b''
+ while c.isdigit():
+ token += c
+ c = getc()
+ # Slight hack. All "tokens" are decimal integers, so convert
+ # them here.
+ header.append(int(token))
+ if len(header) == expected:
+ break
+ # Skip comments (again)
+ while c == '#':
+ while c not in '\n\r':
+ c = getc()
+ if not c.isspace():
+ raise Error('expected header to end with whitespace, not %s' % c)
+
+ if type in pbm:
+ # synthesize a MAXVAL
+ header.append(1)
+ depth = (1,3)[type == b'P6']
+ return header[0], header[1], header[2], depth, header[3]
+
+def write_pnm(file, width, height, pixels, meta):
+ """Write a Netpbm PNM/PAM file.
+ """
+
+ bitdepth = meta['bitdepth']
+ maxval = 2**bitdepth - 1
+ # Rudely, the number of image planes can be used to determine
+ # whether we are L (PGM), LA (PAM), RGB (PPM), or RGBA (PAM).
+ planes = meta['planes']
+ # Can be an assert as long as we assume that pixels and meta came
+ # from a PNG file.
+ assert planes in (1,2,3,4)
+ if planes in (1,3):
+ if 1 == planes:
+ # PGM
+ # Could generate PBM if maxval is 1, but we don't (for one
+ # thing, we'd have to convert the data, not just blat it
+ # out).
+ fmt = 'P5'
+ else:
+ # PPM
+ fmt = 'P6'
+ header = '%s %d %d %d\n' % (fmt, width, height, maxval)
+ if planes in (2,4):
+ # PAM
+ # See http://netpbm.sourceforge.net/doc/pam.html
+ if 2 == planes:
+ tupltype = 'GRAYSCALE_ALPHA'
+ else:
+ tupltype = 'RGB_ALPHA'
+ header = ('P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\n'
+ 'TUPLTYPE %s\nENDHDR\n' %
+ (width, height, planes, maxval, tupltype))
+ file.write(header.encode('ascii'))
+ # Values per row
+ vpr = planes * width
+ # struct format
+ fmt = '>%d' % vpr
+ if maxval > 0xff:
+ fmt = fmt + 'H'
+ else:
+ fmt = fmt + 'B'
+ for row in pixels:
+ file.write(struct.pack(fmt, *row))
+ file.flush()
+
+def color_triple(color):
+ """
+ Convert a command line colour value to a RGB triple of integers.
+ FIXME: Somewhere we need support for greyscale backgrounds etc.
+ """
+ if color.startswith('#') and len(color) == 4:
+ return (int(color[1], 16),
+ int(color[2], 16),
+ int(color[3], 16))
+ if color.startswith('#') and len(color) == 7:
+ return (int(color[1:3], 16),
+ int(color[3:5], 16),
+ int(color[5:7], 16))
+ elif color.startswith('#') and len(color) == 13:
+ return (int(color[1:5], 16),
+ int(color[5:9], 16),
+ int(color[9:13], 16))
+
+def _add_common_options(parser):
+ """Call *parser.add_option* for each of the options that are
+ common between this PNG--PNM conversion tool and the gen
+ tool.
+ """
+ parser.add_option("-i", "--interlace",
+ default=False, action="store_true",
+ help="create an interlaced PNG file (Adam7)")
+ parser.add_option("-t", "--transparent",
+ action="store", type="string", metavar="#RRGGBB",
+ help="mark the specified colour as transparent")
+ parser.add_option("-b", "--background",
+ action="store", type="string", metavar="#RRGGBB",
+ help="save the specified background colour")
+ parser.add_option("-g", "--gamma",
+ action="store", type="float", metavar="value",
+ help="save the specified gamma value")
+ parser.add_option("-c", "--compression",
+ action="store", type="int", metavar="level",
+ help="zlib compression level (0-9)")
+ return parser
+
+def _main(argv):
+ """
+ Run the PNG encoder with options from the command line.
+ """
+
+ # Parse command line arguments
+ from optparse import OptionParser
+ version = '%prog ' + __version__
+ parser = OptionParser(version=version)
+ parser.set_usage("%prog [options] [imagefile]")
+ parser.add_option('-r', '--read-png', default=False,
+ action='store_true',
+ help='Read PNG, write PNM')
+ parser.add_option("-a", "--alpha",
+ action="store", type="string", metavar="pgmfile",
+ help="alpha channel transparency (RGBA)")
+ _add_common_options(parser)
+
+ (options, args) = parser.parse_args(args=argv[1:])
+
+ # Convert options
+ if options.transparent is not None:
+ options.transparent = color_triple(options.transparent)
+ if options.background is not None:
+ options.background = color_triple(options.background)
+
+ # Prepare input and output files
+ if len(args) == 0:
+ infilename = '-'
+ infile = sys.stdin
+ elif len(args) == 1:
+ infilename = args[0]
+ infile = open(infilename, 'rb')
+ else:
+ parser.error("more than one input file")
+ outfile = sys.stdout
+ if sys.platform == "win32":
+ import msvcrt, os
+ msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+
+ if options.read_png:
+ # Encode PNG to PPM
+ png = Reader(file=infile)
+ width,height,pixels,meta = png.asDirect()
+ write_pnm(outfile, width, height, pixels, meta)
+ else:
+ # Encode PNM to PNG
+ format, width, height, depth, maxval = \
+ read_pnm_header(infile, (b'P5',b'P6',b'P7'))
+ # When it comes to the variety of input formats, we do something
+ # rather rude. Observe that L, LA, RGB, RGBA are the 4 colour
+ # types supported by PNG and that they correspond to 1, 2, 3, 4
+ # channels respectively. So we use the number of channels in
+ # the source image to determine which one we have. We do not
+ # care about TUPLTYPE.
+ greyscale = depth <= 2
+ pamalpha = depth in (2,4)
+ supported = [2**x-1 for x in range(1,17)]
+ try:
+ mi = supported.index(maxval)
+ except ValueError:
+ raise NotImplementedError(
+ 'your maxval (%s) not in supported list %s' %
+ (maxval, str(supported)))
+ bitdepth = mi+1
+ writer = Writer(width, height,
+ greyscale=greyscale,
+ bitdepth=bitdepth,
+ interlace=options.interlace,
+ transparent=options.transparent,
+ background=options.background,
+ alpha=bool(pamalpha or options.alpha),
+ gamma=options.gamma,
+ compression=options.compression)
+ if options.alpha:
+ pgmfile = open(options.alpha, 'rb')
+ format, awidth, aheight, adepth, amaxval = \
+ read_pnm_header(pgmfile, 'P5')
+ if amaxval != '255':
+ raise NotImplementedError(
+ 'maxval %s not supported for alpha channel' % amaxval)
+ if (awidth, aheight) != (width, height):
+ raise ValueError("alpha channel image size mismatch"
+ " (%s has %sx%s but %s has %sx%s)"
+ % (infilename, width, height,
+ options.alpha, awidth, aheight))
+ writer.convert_ppm_and_pgm(infile, pgmfile, outfile)
+ else:
+ writer.convert_pnm(infile, outfile)
+
+
+if __name__ == '__main__':
+ try:
+ _main(sys.argv)
+ except Error as e:
+ print(e, file=sys.stderr)
diff --git a/wram.asm b/wram.asm
index e19e99e4a..f15e9f296 100644
--- a/wram.asm
+++ b/wram.asm
@@ -354,55 +354,27 @@ wTileMap:: ; c4a0
wTileMapEnd::
-SECTION "Battle", WRAM0
+SECTION "Miscellaneous", WRAM0
+; This union spans 480 bytes from c608 to c7e8.
UNION ; c608
-; unidentified uses
-wc608:: ds 53
-wc63d:: ds 5
-wc642:: ds 5
-wc647:: ds 33
-wc668:: ds 32
-wc688:: ds 2
-wc68a:: ds 350
-
-NEXTU ; c608
; surrounding tiles
+; This buffer determines the size for the rest of the union;
+; it uses exactly 480 bytes.
wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT
NEXTU ; c608
; box save buffer
+; SaveBoxAddress uses this buffer in three steps because it
+; needs more space than the buffer can hold.
wBoxPartialData:: ds 480
wBoxPartialDataEnd::
NEXTU ; c608
-; odd egg
-wOddEgg:: party_struct wOddEgg
-wOddEggName:: ds MON_NAME_LENGTH
-wOddEggOTName:: ds MON_NAME_LENGTH
-
-NEXTU ; c608
; battle tower temp struct
wBT_OTTemp:: battle_tower_struct wBT_OTTemp
NEXTU ; c608
-; hall of fame temp struct
-wHallOfFameTemp:: hall_of_fame wHallOfFameTemp
-
-NEXTU ; c608
-; timeset temp storage
-wTimeSetBuffer::
- ds 20
-wInitHourBuffer:: db ; c61c
- ds 9
-wInitMinuteBuffer:: db ; c626
-
-NEXTU ; c608
-; link engine data
-wLink_c608:: ds 10
-wc612:: ds 10
-
-NEXTU ; c608
; battle data
wBattle::
wEnemyMoveStruct:: move_struct wEnemyMoveStruct ; c608
@@ -578,9 +550,6 @@ wPlayerAtkLevel:: db ; c6cc
wPlayerDefLevel:: db ; c6cd
wPlayerSpdLevel:: db ; c6ce
wPlayerSAtkLevel:: db ; c6cf
-
-UNION ; c6d0
-; finish battle RAM
wPlayerSDefLevel:: db ; c6d0
wPlayerAccLevel:: db ; c6d1
wPlayerEvaLevel:: db ; c6d2
@@ -739,12 +708,108 @@ wSomeoneIsRampaging:: db ; c73b
wPlayerJustGotFrozen:: db ; c73c
wEnemyJustGotFrozen:: db ; c73d
wBattleEnd::
-; Battle RAM
-; c741
+
+NEXTU ; c608
+; unown puzzle
+wUnownPuzzle::
+ ds 200
+wPuzzlePieces:: ds 6 * 6
+ ds 244
+wUnownPuzzleEnd::
+
+NEXTU ; c608
+
+; This union spans 200 bytes from c608 to c6d0.
+UNION ; c608
+; timeset temp storage
+wTimeSetBuffer::
+ ds 20
+wInitHourBuffer:: db ; c61c
+ ds 9
+wInitMinuteBuffer:: db ; c626
+ ds 19
+wTimeSetBufferEnd::
+
+NEXTU ; c608
+; hall of fame temp struct
+wHallOfFameTemp:: hall_of_fame wHallOfFameTemp
+
+NEXTU ; c608
+; link engine data
+wLink_c608:: ds 10
+wc612:: ds 10
+
+NEXTU ; c608
+; odd egg
+wOddEgg:: party_struct wOddEgg
+wOddEggName:: ds MON_NAME_LENGTH
+wOddEggOTName:: ds NAME_LENGTH
+
+NEXTU ; c608
+; mobile data
+wc608:: ds 53
+wc63d:: ds 5
+wc642:: ds 5
+wc647:: ds 33
+wc668:: ds 32
+wc688:: ds 2
+wc68a:: ds 4
+ ds 66
+
+ENDU ; c6d0
+
+; This union spans 280 bytes from c6d0 to c7e8.
+UNION ; c6d0
+; pokedex
+wPokedexDataStart:: ; c6d0
+wPokedexOrder:: ds $100 ; >= NUM_POKEMON
+wPokedexOrderEnd::
+wDexListingScrollOffset:: db ; offset of the first displayed entry from the start
+wDexListingCursor:: db ; Dex cursor
+wDexListingEnd:: db ; Last mon to display
+wDexListingHeight:: db ; number of entries displayed at once in the dex listing
+wCurDexMode:: db ; Pokedex Mode
+wDexSearchMonType1:: db ; first type to search
+wDexSearchMonType2:: db ; second type to search
+wDexSearchResultCount:: db
+wDexArrowCursorPosIndex:: db
+wDexArrowCursorDelayCounter:: db
+wDexArrowCursorBlinkCounter:: db
+wDexSearchSlowpokeFrame:: db
+wUnlockedUnownMode:: db
+wDexCurUnownIndex:: db
+wDexUnownCount:: db
+wDexConvertedMonType:: db ; mon type converted from dex search mon type
+wDexListingScrollOffsetBackup:: db
+wDexListingCursorBackup:: db
+wBackupDexListingCursor:: db
+wBackupDexListingPage:: db
+wDexCurLocation:: db
+if DEF(_CRYSTAL11)
+wPokedexStatus:: db
+wPokedexDataEnd::
+else
+wPokedexDataEnd:: ds 1
+endc
+ ds 2
+
+NEXTU ; c6d0
+; pokegear
+wPokegearPhoneLoadNameBuffer:: db ; c6d0
+wPokegearPhoneCursorPosition:: db ; c6d1
+wPokegearPhoneScrollPosition:: db ; c6d2
+wPokegearPhoneSelectedPerson:: db ; c6d3
+wPokegearPhoneSubmenuCursor:: db ; c6d4
+wPokegearMapCursorObjectPointer:: dw ; c6d5
+wPokegearMapCursorLandmark:: db ; c6d7
+wPokegearMapPlayerIconLandmark:: db ; c6d8
+wPokegearRadioChannelBank:: db ; c6d9
+wPokegearRadioChannelAddr:: dw ; c6da
+wPokegearRadioMusicPlaying:: db ; c6dc
NEXTU ; c6d0
; trade
-wTrademons::
+wTrademons:: ; c6d0
wPlayerTrademon:: trademon wPlayerTrademon
wOTTrademon:: trademon wOTTrademon
wTrademonsEnd::
@@ -765,22 +830,8 @@ wNamingScreenLastCharacter:: db ; c6d7
wNamingScreenStringEntryCoord:: dw ; c6d8
NEXTU ; c6d0
-; pokegear
-wPokegearPhoneLoadNameBuffer:: db ; c6d0
-wPokegearPhoneCursorPosition:: db ; c6d1
-wPokegearPhoneScrollPosition:: db ; c6d2
-wPokegearPhoneSelectedPerson:: db ; c6d3
-wPokegearPhoneSubmenuCursor:: db ; c6d4
-wPokegearMapCursorObjectPointer:: dw ; c6d5
-wPokegearMapCursorLandmark:: db ; c6d7
-wPokegearMapPlayerIconLandmark:: db ; c6d8
-wPokegearRadioChannelBank:: db ; c6d9
-wPokegearRadioChannelAddr:: dw ; c6da
-wPokegearRadioMusicPlaying:: db ; c6dc
-
-NEXTU ; c6d0
; slot machine
-wSlots::
+wSlots:: ; c6d0
wReel1:: slot_reel wReel1
wReel2:: slot_reel wReel2
wReel3:: slot_reel wReel3
@@ -805,7 +856,7 @@ wSlotsEnd::
NEXTU ; c6d0
; card flip
-wCardFlip::
+wCardFlip:: ; c6d0
wDeck:: ds 24
wDeckEnd::
; c6e8
@@ -817,7 +868,7 @@ wCardFlipEnd::
NEXTU ; c6d0
; dummy game
-wDummyGame::
+wDummyGame:: ; c6d0
wDummyGameCards:: ds 9 * 5
wDummyGameCardsEnd::
wDummyGameLastCardPicked:: db ; c6fd
@@ -832,46 +883,6 @@ wDummyGameNumCardsMatched:: db ; c709
wDummyGameEnd::
NEXTU ; c6d0
-; unown puzzle
-wUnownPuzzle::
-wPuzzlePieces:: ds 6 * 6
-wUnownPuzzleEnd::
-
-NEXTU ; c6d0
-; pokedex
-wPokedexDataStart::
-wPokedexOrder:: ds $100 ; >= NUM_POKEMON
-wPokedexOrderEnd::
-wDexListingScrollOffset:: db ; offset of the first displayed entry from the start
-wDexListingCursor:: db ; Dex cursor
-wDexListingEnd:: db ; Last mon to display
-wDexListingHeight:: db ; number of entries displayed at once in the dex listing
-wCurDexMode:: db ; Pokedex Mode
-wDexSearchMonType1:: db ; first type to search
-wDexSearchMonType2:: db ; second type to search
-wDexSearchResultCount:: db
-wDexArrowCursorPosIndex:: db
-wDexArrowCursorDelayCounter:: db
-wDexArrowCursorBlinkCounter:: db
-wDexSearchSlowpokeFrame:: db
-wUnlockedUnownMode:: db
-wDexCurUnownIndex:: db
-wDexUnownCount:: db
-wDexConvertedMonType:: db ; mon type converted from dex search mon type
-wDexListingScrollOffsetBackup:: db
-wDexListingCursorBackup:: db
-wBackupDexListingCursor:: db
-wBackupDexListingPage:: db
-wDexCurLocation:: db
-if DEF(_CRYSTAL11)
-wPokedexStatus:: db
-wPokedexDataEnd::
-else
-wPokedexDataEnd:: ds 1
-endc
- ds 2
-
-NEXTU ; c6d0
; mobile data
wc6d0:: ds 56
wc708:: db
@@ -896,10 +907,11 @@ wc7d2:: ds 1
wc7d3:: ds 1
wc7d4:: ds 1
ENDU ; c7e8
+
ENDU ; c7e8
-wc7e8:: ds 24
-wc7e8_End::
+wUnusedC7E8:: ds 24
+wUnusedC7E8End::
SECTION "Overworld Map", WRAM0
@@ -1710,6 +1722,7 @@ NEXTU ; d002
wTempDayOfWeek::
wApricorns::
wKeepSevenBiasChance:: ; used in the slots to handle the favoring of 7 symbol streaks
+wSuicuneFrame::
db
ds 2
wStartFlypoint:: db
@@ -1966,7 +1979,9 @@ wTempMon:: party_struct wTempMon ; d10e
wSpriteFlags:: db ; d13e
-wHandlePlayerStep:: dw ; d13f
+wHandlePlayerStep:: db ; d13f
+
+ ds 1
wPartyMenuActionText:: db ; d141
@@ -1992,14 +2007,8 @@ wPlayerBGMapOffsetY:: db ; used in FollowNotExact; unit is pixels
; Player movement
wPlayerStepVectorX:: db ; d14e
wPlayerStepVectorY:: db ; d14f
-wPlayerStepFlags:: db ; d150
-wPlayerStepDirection:: ; d151
-; bit 7: Start step
-; bit 6: Stop step
-; bit 5: Doing step
-; bit 4: In midair
-; bits 0-3: unused
- db
+wPlayerStepFlags:: db ; d150
+wPlayerStepDirection:: db ; d151
wBGMapAnchor:: dw ; d152
@@ -2278,10 +2287,7 @@ wBattleAction:: db ; d430
wd431:: db
wMapStatus:: db ; d432
-wMapEventStatus:: ; d433
-; 0: do map events
-; 1: do background events
- db
+wMapEventStatus:: db ; d433
wScriptFlags:: ; d434
; bit 3: priority jump
@@ -3061,7 +3067,7 @@ NEXTU ; d419
wBattleObjectTempID:: db
wBattleObjectTempXCoord:: db
wBattleObjectTempYCoord:: db
-wBattleObjectTemp0b:: db
+wBattleObjectTempParam:: db
NEXTU ; d419
wBattleAnimTempOAMFlags:: db