summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-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
75 files changed, 2737 insertions, 2813 deletions
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