diff options
Diffstat (limited to 'src')
34 files changed, 6994 insertions, 3091 deletions
diff --git a/src/audio/music1_headers.asm b/src/audio/music1_headers.asm index 05f33bb..26cdff4 100644 --- a/src/audio/music1_headers.asm +++ b/src/audio/music1_headers.asm @@ -41,19 +41,19 @@ SongHeaderPointers1: ; f4f05 (3d:4f05) dw Music_DuelTheme2 dw Music_DuelTheme3 dw Music_PauseMenu - dw $0000 + dw NULL dw Music_DeckMachine dw Music_CardPop dw Music_Overworld - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL dw Music_Unused13 dw Music_Unused14 dw Music_MatchStart1 @@ -107,10 +107,10 @@ Music_PauseMenu: ; f4f68 (3d:4f68) ;Music_PCMainMenu db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_DeckMachine: ; f4f7a (3d:4f7a) db %1111 @@ -135,147 +135,147 @@ Music_Overworld: ; f4f8c (3d:4f8c) ;Music_PokemonDome db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_ChallengeHall db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Club1 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Club2 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Club3 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Ronald db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Imakuni db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_HallOfHonor db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Credits db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_Unused13: ; f4fe6 (3d:4fe6) db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_Unused14: ; f4fef (3d:4fef) db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_MatchStart1: ; f4ff8 (3d:4ff8) db %0001 dw Music_MatchStart1_Ch1 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL Music_MatchStart2: ; f5001 (3d:5001) db %0011 dw Music_MatchStart2_Ch1 dw Music_MatchStart2_Ch2 - dw $0000 - dw $0000 + dw NULL + dw NULL Music_MatchStart3: ; f500a (3d:500a) db %0011 dw Music_MatchStart3_Ch1 dw Music_MatchStart3_Ch2 - dw $0000 - dw $0000 + dw NULL + dw NULL Music_MatchVictory: ; f5013 (3d:5013) db %0111 dw Music_MatchVictory_Ch1 dw Music_MatchVictory_Ch2 dw Music_MatchVictory_Ch3 - dw $0000 + dw NULL Music_MatchLoss: ; f501c (3d:501c) db %0111 dw Music_MatchLoss_Ch1 dw Music_MatchLoss_Ch2 dw Music_MatchLoss_Ch3 - dw $0000 + dw NULL Music_MatchDraw: ; f5025 (3d:5025) db %0111 dw Music_MatchDraw_Ch1 dw Music_MatchDraw_Ch2 dw Music_MatchDraw_Ch3 - dw $0000 + dw NULL Music_Unused1b: ; f502e (3d:502e) db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_BoosterPack: ; f5037 (3d:5037) db %0111 dw Music_BoosterPack_Ch1 dw Music_BoosterPack_Ch2 dw Music_BoosterPack_Ch3 - dw $0000 + dw NULL Music_Medal: ; f5040 (3d:5040) db %0111 dw Music_Medal_Ch1 dw Music_Medal_Ch2 dw Music_Medal_Ch3 - dw $0000 + dw NULL Music_Unused1e: ; f5049 (3d:5049) db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL diff --git a/src/audio/music2_headers.asm b/src/audio/music2_headers.asm index 206d8fd..3a088f7 100644 --- a/src/audio/music2_headers.asm +++ b/src/audio/music2_headers.asm @@ -36,15 +36,15 @@ SongBanks2: ; f8ee6 (3e:4ee6) SongHeaderPointers2: ; f8f05 (3e:4f05) dw Music_Stop - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL dw Music_PCMainMenu - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw Music_PokemonDome dw Music_ChallengeHall dw Music_Club1 @@ -54,56 +54,56 @@ SongHeaderPointers2: ; f8f05 (3e:4f05) dw Music_Imakuni dw Music_HallOfHonor dw Music_Credits - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Stop db %0000 ;Music_TitleScreen db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_DuelTheme1 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_DuelTheme2 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_DuelTheme3 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_PauseMenu db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_PCMainMenu: ; f8f71 (3e:4f71) db %1111 @@ -114,24 +114,24 @@ Music_PCMainMenu: ; f8f71 (3e:4f71) ;Music_DeckMachine db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_CardPop db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Overworld db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL Music_PokemonDome: ; f8f95 (3e:4f95) db %1111 @@ -159,7 +159,7 @@ Music_Club2: ; f8fb0 (3e:4fb0) dw Music_Club2_Ch1 dw Music_Club2_Ch2 dw Music_Club2_Ch3 - dw $0000 + dw NULL Music_Club3: ; f8fb9 (3e:4fb9) db %1111 @@ -187,7 +187,7 @@ Music_HallOfHonor: ; f8fd4 (3e:4fd4) dw Music_HallOfHonor_Ch1 dw Music_HallOfHonor_Ch2 dw Music_HallOfHonor_Ch3 - dw $0000 + dw NULL Music_Credits: ; f8fdd (3e:4fdd) db %1111 @@ -198,84 +198,84 @@ Music_Credits: ; f8fdd (3e:4fdd) ;Music_Unused13 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Unused14 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_MatchStart1 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_MatchStart2 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_MatchStart3 db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_MatchVictory db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_MatchLoss db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_MatchDraw db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Unused1b db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_BoosterPack db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Medal db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL ;Music_Unused1e db %0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL diff --git a/src/constants/misc_constants.asm b/src/constants/misc_constants.asm index 47b9bf6..45d8bf2 100644 --- a/src/constants/misc_constants.asm +++ b/src/constants/misc_constants.asm @@ -49,3 +49,8 @@ OWMODE_MAP EQU 0 OWMODE_MOVE EQU 1 OWMODE_START_SCRIPT EQU 2 OWMODE_SCRIPT EQU 3 + +NULL EQU $0000 + +FALSE EQU 0 +TRUE EQU 1 diff --git a/src/constants/script_constants.asm b/src/constants/script_constants.asm index 9f37375..358acc3 100644 --- a/src/constants/script_constants.asm +++ b/src/constants/script_constants.asm @@ -1,123 +1,123 @@ const_def - const EVENT_FLAG_00 ; $00 - const EVENT_FLAG_01 ; $01 - const EVENT_TEMP_TALKED_TO_IMAKUNI ; $02 - const EVENT_TEMP_BATTLED_IMAKUNI ; $03 - const EVENT_FLAG_04 ; $04 - const EVENT_FLAG_05 ; $05 - const EVENT_FLAG_06 ; $06 - const EVENT_FLAG_07 ; $07 - const EVENT_FLAG_08 ; $08 - const EVENT_FLAG_09 ; $09 - const EVENT_FLAG_0A ; $0a - const EVENT_BEAT_AMY ; $0b - const EVENT_FLAG_0C ; $0c - const EVENT_FLAG_0D ; $0d - const EVENT_FLAG_0E ; $0e - const EVENT_FLAG_0F ; $0f - const EVENT_FLAG_10 ; $10 - const EVENT_FLAG_11 ; $11 - const EVENT_FLAG_12 ; $12 - const EVENT_IMAKUNI_STATE ; $13 - const EVENT_FLAG_14 ; $14 - const EVENT_BEAT_SARA ; $15 - const EVENT_BEAT_AMANDA ; $16 - const EVENT_FLAG_17 ; $17 - const EVENT_FLAG_18 ; $18 - const EVENT_FLAG_19 ; $19 - const EVENT_FLAG_1A ; $1a - const EVENT_FLAG_1B ; $1b - const EVENT_FLAG_1C ; $1c - const EVENT_FLAG_1D ; $1d - const EVENT_FLAG_1E ; $1e - const EVENT_FLAG_1F ; $1f - const EVENT_FLAG_20 ; $20 - const EVENT_FLAG_21 ; $21 - const EVENT_RECEIVED_LEGENDARY_CARD ; $22 - const EVENT_FLAG_23 ; $23 - const EVENT_FLAG_24 ; $24 - const EVENT_FLAG_25 ; $25 - const EVENT_FLAG_26 ; $26 - const EVENT_FLAG_27 ; $27 - const EVENT_FLAG_28 ; $28 - const EVENT_FLAG_29 ; $29 - const EVENT_FLAG_2A ; $2a - const EVENT_FLAG_2B ; $2b - const EVENT_FLAG_2C ; $2c - const EVENT_FLAG_2D ; $2d - const EVENT_MEDAL_COUNT ; $2e - const EVENT_FLAG_2F ; $2f - const EVENT_FLAG_30 ; $30 - const EVENT_FLAG_31 ; $31 - const EVENT_FLAG_32 ; $32 - const EVENT_JOSHUA_STATE ; $33 - const EVENT_IMAKUNI_ROOM ; $34 - const EVENT_FLAG_35 ; $35 - const EVENT_IMAKUNI_WIN_COUNT ; $36 - const EVENT_FLAG_37 ; $37 - const EVENT_FLAG_38 ; $38 - const EVENT_FLAG_39 ; $39 - const EVENT_FLAG_3A ; $3a - const EVENT_FLAG_3B ; $3b - const FLAG_BEAT_BRITTANY ; $3c - const EVENT_FLAG_3D ; $3d - const EVENT_FLAG_3E ; $3e - const EVENT_FLAG_3F ; $3f - const EVENT_FLAG_40 ; $40 - const EVENT_FLAG_41 ; $41 - const EVENT_FLAG_42 ; $42 - const EVENT_FLAG_43 ; $43 - const EVENT_FLAG_44 ; $44 - const EVENT_FLAG_45 ; $45 - const EVENT_FLAG_46 ; $46 - const EVENT_FLAG_47 ; $47 - const EVENT_FLAG_48 ; $48 - const EVENT_FLAG_49 ; $49 - const EVENT_FLAG_4A ; $4a - const EVENT_FLAG_4B ; $4b - const EVENT_FLAG_4C ; $4c - const EVENT_FLAG_4D ; $4d - const EVENT_FLAG_4E ; $4e - const EVENT_FLAG_4F ; $4f - const EVENT_FLAG_50 ; $50 - const EVENT_FLAG_51 ; $51 - const EVENT_FLAG_52 ; $52 - const EVENT_FLAG_53 ; $53 - const EVENT_FLAG_54 ; $54 - const EVENT_FLAG_55 ; $55 - const EVENT_FLAG_56 ; $56 - const EVENT_FLAG_57 ; $57 - const EVENT_FLAG_58 ; $58 - const EVENT_FLAG_59 ; $59 - const EVENT_FLAG_5A ; $5a - const EVENT_FLAG_5B ; $5b - const EVENT_FLAG_5C ; $5c - const EVENT_FLAG_5D ; $5d - const EVENT_FLAG_5E ; $5e - const EVENT_FLAG_5F ; $5f - const EVENT_FLAG_60 ; $60 - const EVENT_FLAG_61 ; $61 - const EVENT_FLAG_62 ; $62 - const EVENT_FLAG_63 ; $63 - const EVENT_FLAG_64 ; $64 - const EVENT_FLAG_65 ; $65 - const EVENT_FLAG_66 ; $66 - const EVENT_FLAG_67 ; $67 - const EVENT_FLAG_68 ; $68 - const EVENT_FLAG_69 ; $69 - const EVENT_FLAG_6A ; $6a - const EVENT_FLAG_6B ; $6b - const EVENT_FLAG_6C ; $6c - const EVENT_FLAG_6D ; $6d - const EVENT_FLAG_6E ; $6e - const EVENT_FLAG_6F ; $6f - const EVENT_FLAG_70 ; $70 - const EVENT_FLAG_71 ; $71 - const EVENT_FLAG_72 ; $72 - const EVENT_FLAG_73 ; $73 - const EVENT_FLAG_74 ; $74 - const EVENT_FLAG_75 ; $75 - const EVENT_FLAG_76 ; $76 + const EVENT_TEMP_TRADED_WITH_ISHIHARA ; $00 + const EVENT_TEMP_GIFTED_TO_MAN1 ; $01 + const EVENT_TEMP_TALKED_TO_IMAKUNI ; $02 + const EVENT_TEMP_DUELED_IMAKUNI ; $03 + const EVENT_TEMP_TRADED_WITH_LASS2 ; $04 + const EVENT_TEMP_05 ; $05 + const EVENT_TEMP_06 ; $06 + const EVENT_TEMP_07 ; $07 + const EVENT_BEAT_NIKKI ; $08 + const EVENT_BEAT_RICK ; $09 + const EVENT_BEAT_KEN ; $0a + const EVENT_BEAT_AMY ; $0b + const EVENT_BEAT_ISAAC ; $0c + const EVENT_BEAT_MURRAY ; $0d + const EVENT_BEAT_GENE ; $0e + const EVENT_BEAT_MITCH ; $0f + const EVENT_MEDAL_FLAGS ; $10 + const EVENT_PUPIL_MICHAEL_STATE ; $11 + const EVENT_GAL1_TRADE_STATE ; $12 + const EVENT_IMAKUNI_STATE ; $13 + const EVENT_LASS1_MENTIONED_IMAKUNI ; $14 + const EVENT_BEAT_SARA ; $15 + const EVENT_BEAT_AMANDA ; $16 + const EVENT_PUPIL_CHRIS_STATE ; $17 + const EVENT_MATTHEW_STATE ; $18 + const EVENT_CHAP2_TRADE_STATE ; $19 + const EVENT_DAVID_STATE ; $1a + const EVENT_JOSEPH_STATE ; $1b + const EVENT_ISHIHARA_MENTIONED ; $1c + const EVENT_ISHIHARA_MET ; $1d + const EVENT_ISHIHARAS_HOUSE_MENTIONED ; $1e + const EVENT_ISHIHARA_TRADE_STATE ; $1f + const EVENT_PUPIL_JESSICA_STATE ; $20 + const EVENT_LAD2_STATE ; $21 + const EVENT_RECEIVED_LEGENDARY_CARDS ; $22 + const EVENT_KEN_HAD_ENOUGH_CARDS ; $23 + const EVENT_KEN_TALKED ; $24 + const EVENT_BEAT_JENNIFER ; $25 + const EVENT_BEAT_NICHOLAS ; $26 + const EVENT_BEAT_BRANDON ; $27 + const EVENT_ISAAC_TALKED ; $28 + const EVENT_MAN1_TALKED ; $29 + const EVENT_MAN1_WAITING_FOR_CARD ; $2a + const EVENT_MAN1_REQUESTED_CARD_ID ; $2b + const EVENT_MAN1_GIFT_SEQUENCE_STATE ; $2c + const EVENT_MAN1_GIFTED_CARD_FLAGS ; $2d + const EVENT_MEDAL_COUNT ; $2e + const EVENT_DANIEL_TALKED ; $2f + const EVENT_MURRAY_TALKED ; $30 + const EVENT_PAPPY1_STATE ; $31 + const EVENT_RONALD_PSYCHIC_CLUB_LOBBY_ENCOUNTER ; $32 + const EVENT_JOSHUA_STATE ; $33 + const EVENT_IMAKUNI_ROOM ; $34 + const EVENT_NIKKI_STATE ; $35 + const EVENT_IMAKUNI_WIN_COUNT ; $36 + const EVENT_LASS2_TRADE_STATE ; $37 + const EVENT_ISHIHARA_WANTS_TO_TRADE ; $38 + const EVENT_ISHIHARA_CONGRATULATED_PLAYER ; $39 + const EVENT_BEAT_KRISTIN ; $3a + const EVENT_BEAT_HEATHER ; $3b + const EVENT_BEAT_BRITTANY ; $3c + const EVENT_DRMASON_CONGRATULATED_PLAYER ; $3d + const EVENT_MASON_LAB_STATE ; $3e + const EVENT_CHALLENGE_CUP_1_STATE ; $3f + const EVENT_CHALLENGE_CUP_2_STATE ; $40 + const EVENT_CHALLENGE_CUP_3_STATE ; $41 + const EVENT_CHALLENGE_CUP_STARTING ; $42 + const EVENT_CHALLENGE_CUP_STAGE_VISITED ; $43 + const EVENT_CHALLENGE_CUP_NUMBER ; $44 + const EVENT_CHALLENGE_CUP_OPPONENT_NUMBER ; $45 + const EVENT_CHALLENGE_CUP_OPPONENT_CHOSEN ; $46 + const EVENT_CHALLENGE_CUP_IN_MENU ; $47 + const EVENT_CHALLENGE_CUP_1_RESULT ; $48 + const EVENT_CHALLENGE_CUP_2_RESULT ; $49 + const EVENT_CHALLENGE_CUP_3_RESULT ; $4a + const EVENT_RONALD_FIRST_CLUB_ENTRANCE_ENCOUNTER ; $4b + const EVENT_RONALD_FIRST_DUEL_STATE ; $4c + const EVENT_RONALD_SECOND_DUEL_STATE ; $4d + const EVENT_RONALD_TALKED ; $4e + const EVENT_RONALD_POKEMON_DOME_ENTRANCE_ENCOUNTER ; $4f + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_1 ; $50 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_2 ; $51 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_3 ; $52 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_4 ; $53 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_5 ; $54 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_6 ; $55 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_7 ; $56 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_8 ; $57 + const EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE ; $58 + const EVENT_PLAYER_ENTERED_CHALLENGE_CUP ; $59 + const EVENT_FIGHTING_DECK_MACHINE_ACTIVE ; $5a + const EVENT_ROCK_DECK_MACHINE_ACTIVE ; $5b + const EVENT_WATER_DECK_MACHINE_ACTIVE ; $5c + const EVENT_LIGHTNING_DECK_MACHINE_ACTIVE ; $5d + const EVENT_GRASS_DECK_MACHINE_ACTIVE ; $5e + const EVENT_PSYCHIC_DECK_MACHINE_ACTIVE ; $5f + const EVENT_SCIENCE_DECK_MACHINE_ACTIVE ; $60 + const EVENT_FIRE_DECK_MACHINE_ACTIVE ; $61 + const EVENT_ALL_DECK_MACHINE_FLAGS ; $62 + const EVENT_HALL_OF_HONOR_DOORS_OPEN ; $63 + const EVENT_CHALLENGED_GRAND_MASTERS ; $64 + const EVENT_POKEMON_DOME_STATE ; $65 + const EVENT_POKEMON_DOME_IN_MENU ; $66 + const EVENT_CHALLENGED_RONALD ; $67 + const EVENT_COURTNEY_STATE ; $68 + const EVENT_STEVE_STATE ; $69 + const EVENT_JACK_STATE ; $6a + const EVENT_ROD_STATE ; $6b + const EVENT_RONALD_POKEMON_DOME_STATE ; $6c + const EVENT_RECEIVED_ZAPDOS ; $6d + const EVENT_RECEIVED_MOLTRES ; $6e + const EVENT_RECEIVED_ARTICUNO ; $6f + const EVENT_RECEIVED_DRAGONITE ; $70 + const EVENT_LEGENDARY_CARDS_RECEIVED_FLAGS ; $71 + const EVENT_GIFT_CENTER_MENU_CHOICE ; $72 + const EVENT_AARON_BOOSTER_REWARD ; $73 + const EVENT_CONSOLE ; $74 + const EVENT_SAM_TUTORIAL_MENU_CHOICE ; $75 + const EVENT_AARON_DECK_MENU_CHOICE ; $76 EVENT_FLAG_AMOUNT EQU const_value EVENT_FLAG_BYTES EQU $40 @@ -138,8 +138,6 @@ IMAKUNI_SCIENCE_CLUB EQU 1 IMAKUNI_LIGHTNING_CLUB EQU 2 IMAKUNI_WATER_CLUB EQU 3 -NULL EQU $0000 - NORTH EQU $00 EAST EQU $01 SOUTH EQU $02 diff --git a/src/data/attack_animations.asm b/src/data/attack_animations.asm index 8d11f68..d0ad4aa 100644 --- a/src/data/attack_animations.asm +++ b/src/data/attack_animations.asm @@ -21,7 +21,7 @@ anim_end2: MACRO ENDM
PointerTable_AttackAnimation:
- dw $0000 ; ATK_ANIM_NONE
+ dw NULL ; ATK_ANIM_NONE
dw AttackAnimation_Hit ; ATK_ANIM_HIT
dw AttackAnimation_BigHit ; ATK_ANIM_BIG_HIT
dw AttackAnimation_Hit ; ATK_ANIM_3
diff --git a/src/data/booster_packs.asm b/src/data/booster_packs.asm index 44a401f..51bb8c2 100644 --- a/src/data/booster_packs.asm +++ b/src/data/booster_packs.asm @@ -14,7 +14,7 @@ ENDM ; For the energy or energy generation function, there are three options: ; - Pointer to a function that generates energies (some generate one, some generate a full pack) ; - A single energy of a specific type -; - $0000 if no card in the pack is an energy +; - NULL if no card in the pack is an energy ; As for Card Type Chances, note that whenever one card of the 10 is drawn, the chances of ; the type of that card are reduced by the original average of all 8 types (capping the result at 1). @@ -232,7 +232,7 @@ BoosterPack_EvolutionTrainer:: ; 1e580 (7:6580) BoosterPack_MysteryNeutral:: ; 1e58c (7:658c) booster_set MYSTERY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 17 ; Grass Type Chance @@ -247,7 +247,7 @@ BoosterPack_MysteryNeutral:: ; 1e58c (7:658c) BoosterPack_MysteryGrassColorless:: ; 1e598 (7:6598) booster_set MYSTERY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 48 ; Grass Type Chance @@ -262,7 +262,7 @@ BoosterPack_MysteryGrassColorless:: ; 1e598 (7:6598) BoosterPack_MysteryWaterColorless:: ; 1e5a4 (7:65a4) booster_set MYSTERY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 12 ; Grass Type Chance @@ -277,7 +277,7 @@ BoosterPack_MysteryWaterColorless:: ; 1e5a4 (7:65a4) BoosterPack_MysteryLightningColorless:: ; 1e5b0 (7:65b0) booster_set MYSTERY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 12 ; Grass Type Chance @@ -292,7 +292,7 @@ BoosterPack_MysteryLightningColorless:: ; 1e5b0 (7:65b0) BoosterPack_MysteryFightingColorless:: ; 1e5bc (7:65bc) booster_set MYSTERY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 12 ; Grass Type Chance @@ -307,7 +307,7 @@ BoosterPack_MysteryFightingColorless:: ; 1e5bc (7:65bc) BoosterPack_MysteryTrainerColorless:: ; 1e5c8 (7:65c8) booster_set MYSTERY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 12 ; Grass Type Chance @@ -322,7 +322,7 @@ BoosterPack_MysteryTrainerColorless:: ; 1e5c8 (7:65c8) BoosterPack_LaboratoryMostlyNeutral:: ; 1e5d4 (7:65d4) booster_set LABORATORY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 20 ; Grass Type Chance @@ -337,7 +337,7 @@ BoosterPack_LaboratoryMostlyNeutral:: ; 1e5d4 (7:65d4) BoosterPack_LaboratoryGrass:: ; 1e5e0 (7:65e0) booster_set LABORATORY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 48 ; Grass Type Chance @@ -352,7 +352,7 @@ BoosterPack_LaboratoryGrass:: ; 1e5e0 (7:65e0) BoosterPack_LaboratoryWater:: ; 1e5ec (7:65ec) booster_set LABORATORY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 16 ; Grass Type Chance @@ -367,7 +367,7 @@ BoosterPack_LaboratoryWater:: ; 1e5ec (7:65ec) BoosterPack_LaboratoryPsychic:: ; 1e5f8 (7:65f8) booster_set LABORATORY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 16 ; Grass Type Chance @@ -382,7 +382,7 @@ BoosterPack_LaboratoryPsychic:: ; 1e5f8 (7:65f8) BoosterPack_LaboratoryTrainer:: ; 1e604 (7:6604) booster_set LABORATORY ; booster pack set - dw $0000 ; energy or energy generation function + dw NULL ; energy or energy generation function ; Card Type Chances db 16 ; Grass Type Chance diff --git a/src/data/cards.asm b/src/data/cards.asm index a045188..9c1ae11 100644 --- a/src/data/cards.asm +++ b/src/data/cards.asm @@ -2,7 +2,7 @@ ; convenience once the meaning of all fields is figured out. CardPointers: ; 30c5c (c:4c5c) - dw $0000 + dw NULL dw GrassEnergyCard dw FireEnergyCard dw WaterEnergyCard @@ -231,7 +231,7 @@ CardPointers: ; 30c5c (c:4c5c) dw PokemonFluteCard dw GamblerCard dw RecycleCard - dw $0000 + dw NULL BulbasaurCard: ; 30e28 (c:4e28) db TYPE_PKMN_GRASS ; type diff --git a/src/data/decks.asm b/src/data/decks.asm index 424874b..8b800f4 100644 --- a/src/data/decks.asm +++ b/src/data/decks.asm @@ -54,7 +54,7 @@ DeckPointers: ; 30000 (c:4000) dw FlamethrowerDeck dw ReshuffleDeck dw ImakuniDeck - dw $0000 + dw NULL UnnamedDeck: ; 30070 (c:4070) db 20, PSYCHIC_ENERGY diff --git a/src/data/map_objects.asm b/src/data/map_objects.asm index 069b12d..34e2def 100644 --- a/src/data/map_objects.asm +++ b/src/data/map_objects.asm @@ -8,7 +8,7 @@ MasonLabObjects: ; 13b04 (3:7b04) db NORTH, 18, 2 dw PrintInteractableObjectText tx Text04a0 - tx Text049f + tx WhatIsADeckText db NORTH, 20, 2 dw PrintInteractableObjectText @@ -41,9 +41,9 @@ MasonLabObjects: ; 13b04 (3:7b04) tx Text04ab db NORTH, 2, 2 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db $ff @@ -51,103 +51,103 @@ MasonLabObjects: ; 13b04 (3:7b04) DeckMachineRoomObjects: ; 13b4d (3:7b4d) db NORTH, 2, 2 dw Script_d932 - tx Text041b - tx Text041a + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 4, 2 dw Script_d932 - tx Text041b - tx Text041a + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 2 - dw $593f - tx Text041b - tx Text041a + dw Script_d93f + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 8, 2 - dw $593f - tx Text041b - tx Text041a + dw Script_d93f + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 10, 2 - dw $5995 - tx Text041b - tx Text041a + dw Script_d995 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 12, 2 - dw $5995 - tx Text041b - tx Text041a + dw Script_d995 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 14, 2 - dw $59c2 - tx Text041b - tx Text041a + dw Script_d9c2 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 16, 2 - dw $59c2 - tx Text041b - tx Text041a + dw Script_d9c2 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 18, 2 - dw $59ef - tx Text041b - tx Text041a + dw Script_d9ef + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 20, 2 - dw $59ef - tx Text041b - tx Text041a + dw Script_d9ef + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 14, 10 - dw $5a1c - tx Text041b - tx Text041a + dw Script_da1c + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 16, 10 - dw $5a1c - tx Text041b - tx Text041a + dw Script_da1c + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 18, 10 - dw $5a49 - tx Text041b - tx Text041a + dw Script_da49 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 20, 10 - dw $5a49 - tx Text041b - tx Text041a + dw Script_da49 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 14, 18 - dw $5a76 - tx Text041b - tx Text041a + dw Script_da76 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 16, 18 - dw $5a76 - tx Text041b - tx Text041a + dw Script_da76 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 18, 18 - dw $5aa3 - tx Text041b - tx Text041a + dw Script_daa3 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 20, 18 - dw $5aa3 - tx Text041b - tx Text041a + dw Script_daa3 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 2, 18 - dw $5ad0 - tx Text041b - tx Text041a + dw Script_dad0 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 4, 18 - dw $5ad0 - tx Text041b - tx Text041a + dw Script_dad0 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db $ff @@ -233,18 +233,18 @@ FightingClubLobbyObjects: ; 13c6f (3:7c6f) tx Text04c9 db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -267,18 +267,18 @@ RockClubLobbyObjects: ; 13ca6 (3:7ca6) tx Text04cf db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -301,18 +301,18 @@ WaterClubLobbyObjects: ; 13cdd (3:7cdd) tx Text04d5 db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -335,18 +335,18 @@ LightningClubLobbyObjects: ; 13d14 (3:7d14) tx Text04db db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -369,18 +369,18 @@ GrassClubLobbyObjects: ; 13d4b (3:7d4b) tx Text04e1 db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -403,18 +403,18 @@ PsychicClubLobbyObjects: ; 13d82 (3:7d82) tx Text04e7 db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -437,18 +437,18 @@ ScienceClubLobbyObjects: ; 13db9 (3:7db9) tx Text04ed db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -471,18 +471,18 @@ FireClubLobbyObjects: ; 13df0 (3:7df0) tx Text04f3 db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -505,18 +505,18 @@ ChallengeHallLobbyObjects: ; 13e27 (3:7e27) tx Text04f9 db NORTH, 2, 8 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 6, 6 dw Script_fc52 - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db NORTH, 10, 6 dw Func_fc7a - tx Text041b + tx PlaceholderMessageText tx ClerkNPCName db $ff @@ -564,19 +564,19 @@ PokemonDomeEntranceObjects: ; 13e5e (3:7e5e) tx Text0507 db NORTH, 22, 0 - dw $76af + dw Script_f6af tx Text0558 tx Text0509 db NORTH, 24, 0 - dw $76af + dw Script_f6af tx Text0558 tx Text0509 db NORTH, 28, 2 - dw PC_c7ea - tx Text041b - tx Text041a + dw PCMenu + tx PlaceholderMessageText + tx PokemonTradingCards101Text db $ff @@ -585,23 +585,23 @@ HallOfHonorObjects: ; 13ec2 (3:7ec2) ; Legendary Cards db NORTH, 10, 10 dw Script_fbf1 - dw $0000 - dw $0000 + dw NULL + dw NULL ; Legendary Cards db NORTH, 12, 10 dw Script_fbf1 - dw $0000 - dw $0000 + dw NULL + dw NULL db NORTH, 10, 2 - dw $7be1 - tx Text041b - tx Text041a + dw Script_fbe1 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db NORTH, 12, 2 - dw $7be1 - tx Text041b - tx Text041a + dw Script_fbe1 + tx PlaceholderMessageText + tx PokemonTradingCards101Text db $ff diff --git a/src/data/map_scripts.asm b/src/data/map_scripts.asm index 3084f8b..0ee337d 100644 --- a/src/data/map_scripts.asm +++ b/src/data/map_scripts.asm @@ -1,7 +1,7 @@ ; each map has a maximum of 8 scripts ; scripts are referenced with ids [0,2,4,6,8,a,c,e] ; each script id is used for a specific event -; if a script pointer is $0000, that map has no script for that event +; if a script pointer is NULL, that map has no script for that event ; 0: NPC data ; 2: Called after every NPC is loaded (unused) ; 4: Interactable Objects @@ -13,341 +13,341 @@ MapScripts: ; 1162a (4:562a) ; OVERWORLD_MAP - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL dw LoadOverworld - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL ; MASON_LABORATORY dw MasonLabNPCS - dw $0000 + dw NULL dw MasonLabObjects dw MasonLabPressedA dw MasonLabLoadMap dw MasonLaboratoryAfterDuel - dw $0000 + dw NULL dw MasonLabCloseTextBox ; DECK_MACHINE_ROOM dw DeckMachineRoomNPCS - dw $0000 + dw NULL dw DeckMachineRoomObjects - dw $0000 - dw $0000 - dw $589f - dw $0000 - dw $58ad + dw NULL + dw NULL + dw DeckMachineRoomAfterDuel + dw NULL + dw DeckMachineRoomCloseTextBox ; ISHIHARAS_HOUSE dw IshiharasHouseNPCS - dw $0000 + dw NULL dw IshiharasHouseObjects - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL ; FIGHTING_CLUB_ENTRANCE dw FightingClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; FIGHTING_CLUB_LOBBY dw FightingClubLobbyNPCS - dw $0000 + dw NULL dw FightingClubLobbyObjects - dw $0000 - dw $0000 + dw NULL + dw NULL dw FightingClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; FIGHTING_CLUB dw FightingClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL dw FightingClubAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; ROCK_CLUB_ENTRANCE dw RockClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; ROCK_CLUB_LOBBY dw RockClubLobbyNPCS - dw $0000 + dw NULL dw RockClubLobbyObjects - dw $0000 - dw $0000 + dw NULL + dw NULL dw RockClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; ROCK_CLUB dw RockClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $5fd6 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw RockClubAfterDuel + dw NULL + dw NULL ; WATER_CLUB_ENTRANCE dw WaterClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; WATER_CLUB_LOBBY dw WaterClubLobbyNPCS - dw $0000 + dw NULL dw WaterClubLobbyObjects - dw $0000 - dw $0000 + dw NULL + dw NULL dw WaterClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; WATER_CLUB dw WaterClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL dw WaterClubAfterDuel dw WaterClubMovePlayer - dw $0000 + dw NULL ; LIGHTNING_CLUB_ENTRANCE dw LightningClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; LIGHTNING_CLUB_LOBBY dw LightningClubLobbyNPCS - dw $0000 + dw NULL dw LightningClubLobbyObjects - dw $0000 - dw $0000 + dw NULL + dw NULL dw LightningClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; LIGHTNING_CLUB dw LightningClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $63e8 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw LightningClubAfterDuel + dw NULL + dw NULL ; GRASS_CLUB_ENTRANCE dw GrassClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw GrassClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; GRASS_CLUB_LOBBY dw GrassClubLobbyNPCS - dw $0000 + dw NULL dw GrassClubLobbyObjects - dw $0000 - dw $0000 + dw NULL + dw NULL dw GrassClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; GRASS_CLUB dw GrassClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $66e7 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw GrassClubAfterDuel + dw NULL + dw NULL ; PSYCHIC_CLUB_ENTRANCE dw PsychicClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; PSYCHIC_CLUB_LOBBY dw PsychicClubLobbyNPCS - dw $0000 + dw NULL dw PsychicClubLobbyObjects - dw $0000 - dw $6971 + dw NULL + dw PsychicClubLobbyLoadMap dw PsychicClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; PSYCHIC_CLUB dw PsychicClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $6a46 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw PsychicClubAfterDuel + dw NULL + dw NULL ; SCIENCE_CLUB_ENTRANCE dw ScienceClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; SCIENCE_CLUB_LOBBY dw ScienceClubLobbyNPCS - dw $0000 + dw NULL dw ScienceClubLobbyObjects - dw $0000 - dw $0000 + dw NULL + dw NULL dw ScienceClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; SCIENCE_CLUB dw ScienceClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $6bf1 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw ScienceClubAfterDuel + dw NULL + dw NULL ; FIRE_CLUB_ENTRANCE dw FireClubEntranceNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw LoadClubEntrance dw ClubEntranceAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; FIRE_CLUB_LOBBY dw FireClubLobbyNPCS - dw $0000 + dw NULL dw FireClubLobbyObjects dw FireClubPressedA - dw $0000 + dw NULL dw FireClubLobbyAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; FIRE_CLUB dw FireClubNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL dw FireClubAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; CHALLENGE_HALL_ENTRANCE dw ChallengeHallEntranceNPCS - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL + dw NULL ; CHALLENGE_HALL_LOBBY dw ChallengeHallLobbyNPCS - dw $0000 + dw NULL dw ChallengeHallLobbyObjects - dw $0000 + dw NULL dw ChallengeHallLobbyLoadMap - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL ; CHALLENGE_HALL dw ChallengeHallNPCS - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL dw ChallengeHallLoadMap dw ChallengeHallAfterDuel - dw $0000 - dw $0000 + dw NULL + dw NULL ; POKEMON_DOME_ENTRANCE dw PokemonDomeEntranceNPCS - dw $0000 + dw NULL dw PokemonDomeEntranceObjects - dw $0000 - dw $7607 - dw $0000 - dw $0000 - dw $762a + dw NULL + dw PokemonDomeEntranceLoadMap + dw NULL + dw NULL + dw PokemonDomeEntranceCloseTextBox ; POKEMON_DOME dw PokemonDomeNPCS - dw $0000 - dw $0000 - dw $0000 - dw $7706 - dw $76e0 - dw $76c6 - dw $7718 + dw NULL + dw NULL + dw NULL + dw PokemonDomeLoadMap + dw PokemonDomeAfterDuel + dw PokemonDomeMovePlayer + dw PokemonDomeCloseTextBox ; HALL_OF_HONOR dw HallOfHonorNPCS - dw $0000 + dw NULL dw HallOfHonorObjects - dw $0000 + dw NULL dw HallOfHonorLoadMap - dw $0000 - dw $0000 - dw $0000 + dw NULL + dw NULL + dw NULL diff --git a/src/data/npc_map_data.asm b/src/data/npc_map_data.asm index 7c01e72..5278db3 100644 --- a/src/data/npc_map_data.asm +++ b/src/data/npc_map_data.asm @@ -1,33 +1,33 @@ -; NPC Map data. Note: pre-load functions also run after battles +; NPC Map data. Note: pre-load functions also run after duels ; Format: ; NPC, X position, Y Position, Direction, ; pre-load function. (Resets c flag if NPC should not be loaded) MasonLabNPCS: ; 772f (4:1372f) db NPC_DRMASON, $0e, $06, SOUTH - dw $5710 + dw Preload_DrMason db NPC_SAM, $04, $0e, EAST - dw $5604 + dw Preload_Sam db NPC_TECH1, $16, $08, WEST - dw $0000 + dw NULL db NPC_TECH2, $16, $14, SOUTH - dw $0000 + dw NULL db NPC_TECH3, $16, $16, WEST - dw $0000 + dw NULL db NPC_TECH4, $0a, $16, EAST - dw $0000 + dw NULL db NPC_TECH5, $06, $04, SOUTH - dw $55eb + dw Preload_Tech5 db $00 DeckMachineRoomNPCS: ; 775a (4:1375a) db NPC_TECH6, $06, $08, SOUTH - dw $0000 + dw NULL db NPC_TECH7, $06, $16, WEST - dw $0000 + dw NULL db NPC_TECH8, $0a, $12, WEST - dw $0000 + dw NULL db NPC_AARON, $0c, $0c, WEST - dw $0000 + dw NULL db $00 IshiharasHouseNPCS: ; 7773 (4:13773) @@ -41,308 +41,308 @@ IshiharasHouseNPCS: ; 7773 (4:13773) FightingClubEntranceNPCS: ; 7786 (4:13786) db NPC_CLERK1, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 FightingClubLobbyNPCS: ; 779f (4:1379f) db NPC_MAN1, $0c, $0e, WEST - dw $0000 + dw NULL db NPC_IMAKUNI, $12, $02, NORTH - dw $5ceb + dw Preload_ImakuniInFightingClubLobby db NPC_SPECS1, $12, $10, EAST - dw $0000 + dw NULL db NPC_BUTCH, $14, $10, WEST - dw $0000 + dw NULL db NPC_GRANNY1, $04, $10, WEST - dw $5d98 + dw Preload_Granny1 db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 FightingClubNPCS: ; 77ca (4:137ca) db NPC_CHRIS, $04, $08, SOUTH - dw $5e43 + dw Preload_ChrisInFightingClub db NPC_MICHAEL, $0e, $0a, SOUTH - dw $5e79 + dw Preload_MichaelInFightingClub db NPC_JESSICA, $12, $06, EAST - dw $5ea5 + dw Preload_JessicaInFightingClub db NPC_MITCH, $0a, $04, SOUTH - dw $0000 + dw NULL db $00 RockClubEntranceNPCS: ; 77e3 (4:137e3) db NPC_CLERK2, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 RockClubLobbyNPCS: ; 77fc (4:137fc) db NPC_CHRIS, $12, $08, WEST - dw $5ee9 + dw Preload_ChrisInRockClubLobby db NPC_MATTHEW, $06, $0e, EAST - dw $0000 + dw NULL db NPC_WOMAN1, $14, $12, NORTH - dw $0000 + dw NULL db NPC_CHAP1, $0e, $10, EAST - dw $0000 + dw NULL db NPC_LASS3, $10, $04, SOUTH - dw $5fcb + dw Preload_Lass3 db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 RockClubNPCS: ; 7827 (4:13827) db NPC_RYAN, $14, $0e, EAST - dw $0000 + dw NULL db NPC_ANDREW, $06, $14, NORTH - dw $0000 + dw NULL db NPC_GENE, $0c, $06, NORTH - dw $0000 + dw NULL db $00 WaterClubEntranceNPCS: ; 783a (4:1383a) db NPC_CLERK3, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 WaterClubLobbyNPCS: ; 7853 (4:13853) db NPC_GAL1, $06, $0e, SOUTH - dw $0000 + dw NULL db NPC_LASS1, $10, $0a, SOUTH - dw $0000 + dw NULL db NPC_IMAKUNI, $12, $02, NORTH dw Preload_ImakuniInWaterClubLobby db NPC_MAN2, $04, $12, EAST - dw Preload_Man2InWaterClubLobby + dw Preload_Man2 db NPC_PAPPY2, $16, $10, NORTH - dw $0000 + dw NULL db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 WaterClubNPCS: ; 787e (4:1387e) db NPC_SARA, $06, $12, EAST - dw $0000 + dw NULL db NPC_AMANDA, $16, $14, WEST - dw $0000 + dw NULL db NPC_JOSHUA, $16, $08, SOUTH - dw $0000 + dw NULL db NPC_AMY, $16, $04, SOUTH dw Preload_Amy db $00 LightningClubEntranceNPCS: ; 7897 (4:13897) db NPC_CLERK4, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 LightningClubLobbyNPCS: ; 78b0 (4:138b0) db NPC_CHAP2, $12, $10, WEST - dw $0000 + dw NULL db NPC_IMAKUNI, $12, $02, NORTH - dw $637b + dw Preload_ImakuniInLightningClubLobby db NPC_LASS4, $08, $0c, SOUTH - dw $0000 + dw NULL db NPC_HOOD1, $14, $08, SOUTH - dw $0000 + dw NULL db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 LightningClubNPCS: ; 78d5 (4:138d5) db NPC_JENNIFER, $0e, $12, SOUTH - dw $0000 + dw NULL db NPC_NICHOLAS, $06, $0a, SOUTH - dw $0000 + dw NULL db NPC_BRANDON, $16, $0c, NORTH - dw $0000 + dw NULL db NPC_ISAAC, $0c, $04, NORTH - dw $6494 + dw Preload_Isaac db $00 GrassClubEntranceNPCS: ; 78ee (4:138ee) db NPC_CLERK5, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_MICHAEL, $0e, $08, SOUTH - dw $656a + dw Preload_MichaelInGrassClubEntrance db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 GrassClubLobbyNPCS: ; 790d (4:1390d) db NPC_BRITTANY, $0c, $0e, WEST - dw $0000 + dw NULL db NPC_LASS2, $12, $08, SOUTH - dw $0000 + dw NULL db NPC_GRANNY2, $04, $10, EAST - dw $0000 + dw NULL db NPC_GAL2, $14, $10, NORTH - dw $66dc + dw Preload_Gal2 db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 GrassClubNPCS: ; 7932 (4:13932) db NPC_KRISTIN, $04, $0a, EAST - dw $0000 + dw NULL db NPC_HEATHER, $0e, $10, SOUTH - dw $0000 + dw NULL db NPC_NIKKI, $0c, $04, SOUTH - dw $6796 + dw Preload_NikkiInGrassClub db $00 PsychicClubEntranceNPCS: ; 7945 (4:13945) db NPC_CLERK6, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db NPC_LAD3, $0e, $04, SOUTH - dw $0000 + dw NULL db $00 PsychicClubLobbyNPCS: ; 7964 (4:13964) db NPC_ROBERT, $14, $08, NORTH - dw $0000 + dw NULL db NPC_PAPPY1, $04, $10, EAST - dw $0000 + dw NULL db NPC_RONALD1, $0c, $0a, EAST - dw $69f7 + dw Preload_Ronald1InPsychicClubLobby db NPC_GAL3, $10, $0e, WEST - dw $0000 + dw NULL db NPC_CHAP4, $18, $10, SOUTH - dw $0000 + dw NULL db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 PsychicClubNPCS: ; 798f (4:1398f) db NPC_DANIEL, $08, $08, NORTH - dw $0000 + dw NULL db NPC_STEPHANIE, $16, $0c, EAST - dw $0000 + dw NULL db NPC_MURRAY2, $02, $02, WEST - dw $6ad0 + dw Preload_Murray2 db NPC_MURRAY1, $0c, $06, SOUTH - dw $6ada + dw Preload_Murray1 db $00 ScienceClubEntranceNPCS: ; 79a8 (4:139a8) db NPC_CLERK7, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 ScienceClubLobbyNPCS: ; 79c1 (4:139c1) db NPC_LAD1, $12, $12, NORTH - dw $0000 + dw NULL db NPC_IMAKUNI, $12, $02, NORTH - dw $6b65 + dw Preload_ImakuniInScienceClubLobby db NPC_MAN3, $04, $0e, WEST - dw $0000 + dw NULL db NPC_SPECS2, $0c, $0e, WEST - dw $0000 + dw NULL db NPC_SPECS3, $16, $08, SOUTH - dw $0000 + dw NULL db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 ScienceClubNPCS: ; 79ec (4:139ec) db NPC_JOSEPH, $08, $0a, SOUTH - dw $6cc4 + dw Preload_Joseph db NPC_DAVID, $14, $04, NORTH - dw $0000 + dw NULL db NPC_ERIK, $06, $12, SOUTH - dw $0000 + dw NULL db NPC_RICK, $04, $04, NORTH - dw $0000 + dw NULL db $00 FireClubEntranceNPCS: ; 7a05 (4:13a05) db NPC_CLERK8, $06, $02, SOUTH - dw $0000 + dw NULL db NPC_RONALD1, $08, $fe, SOUTH - dw $685b + dw Preload_Ronald1InClubEntrance db NPC_RONALD2, $fe, $08, NORTH - dw $689a + dw Preload_Ronald2InClubEntrance db NPC_RONALD3, $fe, $08, NORTH - dw $6915 + dw Preload_Ronald3InClubEntrance db $00 FireClubLobbyNPCS: ; 7a1e (4:13a1e) db NPC_JESSICA, $0c, $0e, WEST - dw $6d8d + dw Preload_JessicaInFireClubLobby db NPC_LAD2, $12, $06, EAST - dw $6e25 + dw Preload_Lad2 db NPC_CHAP3, $06, $0a, NORTH - dw $0000 + dw NULL db NPC_MANIA, $14, $12, NORTH - dw $0000 + dw NULL db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 FireClubNPCS: ; 7a43 (4:13a43) db NPC_JOHN, $0c, $12, SOUTH - dw $0000 + dw NULL db NPC_ADAM, $08, $0e, SOUTH - dw $0000 + dw NULL db NPC_JONATHAN, $12, $0a, SOUTH - dw $0000 + dw NULL db NPC_KEN, $0e, $04, SOUTH - dw $0000 + dw NULL db $00 ChallengeHallEntranceNPCS: ; 7a5c (4:13a5c) @@ -366,7 +366,7 @@ ChallengeHallLobbyNPCS: ; 7a63 (4:13a63) db NPC_RONALD1, $08, $0c, SOUTH dw Preload_ChallengeHallLobbyRonald1 db NPC_CLERK10, $06, $04, SOUTH - dw $0000 + dw NULL db NPC_GIFT_CENTER_CLERK, $0a, $04, SOUTH dw Preload_GiftCenterClerk db $00 @@ -386,33 +386,33 @@ ChallengeHallNPCS: ; 7a9a (4:13a9a) PokemonDomeEntranceNPCS: ; 7ab9 (4:13ab9) db NPC_RONALD1, $0e, $12, SOUTH - dw $0000 + dw NULL db $00 PokemonDomeNPCS: ; 7ac0 (4:13ac0) db NPC_COURTNEY, $12, $02, SOUTH - dw $774b + dw Preload_Courtney db NPC_STEVE, $16, $02, SOUTH - dw $778c + dw Preload_Steve db NPC_JACK, $08, $02, SOUTH - dw $77a3 + dw Preload_Jack db NPC_ROD, $0c, $02, SOUTH - dw $77ba + dw Preload_Rod db NPC_RONALD1, $1e, $00, SOUTH - dw $77d6 + dw Preload_Ronald1InPokemonDome db $00 HallOfHonorNPCS: ; 7adf (4:13adf) db NPC_LEGENDARY_CARD_TOP_LEFT, $0a, $08, SOUTH - dw $0000 + dw NULL db NPC_LEGENDARY_CARD_TOP_RIGHT, $0c, $08, SOUTH - dw $0000 + dw NULL db NPC_LEGENDARY_CARD_LEFT_SPARK, $08, $0a, SOUTH - dw $0000 + dw NULL db NPC_LEGENDARY_CARD_BOTTOM_LEFT, $0a, $0a, SOUTH - dw $0000 + dw NULL db NPC_LEGENDARY_CARD_BOTTOM_RIGHT, $0c, $0a, SOUTH - dw $0000 + dw NULL db NPC_LEGENDARY_CARD_RIGHT_SPARK, $0e, $0a, SOUTH - dw $0000 + dw NULL db $00 diff --git a/src/data/npcs.asm b/src/data/npcs.asm index d7280b6..34885d6 100644 --- a/src/data/npcs.asm +++ b/src/data/npcs.asm @@ -710,7 +710,7 @@ Murray1NPCHeader: db $00 db $12 db $00 - dw Script_Murray1 + dw Script_Murray tx MurrayNPCName db MURRAY_PIC db STRANGE_PSYSHOCK_DECK_ID @@ -723,7 +723,7 @@ Murray2NPCHeader: db $03 db $15 db $10 - dw Script_Murray2 + dw Script_Murray tx MurrayNPCName db MURRAY_PIC db STRANGE_PSYSHOCK_DECK_ID diff --git a/src/data/warps.asm b/src/data/warps.asm index cb34721..cba8053 100644 --- a/src/data/warps.asm +++ b/src/data/warps.asm @@ -1,5 +1,5 @@ WarpDataPointers: ; 1c099 (7:4099) - dw $0000 + dw NULL dw MasonLaboratoryWarpData dw DeckMachineRoomWarpData dw IshiharasHouseWarpData diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 2d0ebf5..03c5e96 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -188,29 +188,29 @@ MainDuelLoop: ; 40ee (1:40ee) ; load the correct music and animation depending on result ld a, [wDuelFinished] cp TURN_PLAYER_WON - jr z, .active_duelist_won_battle + jr z, .active_duelist_won_duel cp TURN_PLAYER_LOST - jr z, .active_duelist_lost_battle + jr z, .active_duelist_lost_duel ld a, DUEL_ANIM_DUEL_DRAW ld c, MUSIC_MATCH_DRAW ldtx hl, DuelWasADrawText jr .handle_duel_finished -.active_duelist_won_battle +.active_duelist_won_duel ldh a, [hWhoseTurn] cp PLAYER_TURN - jr nz, .opponent_won_battle -.player_won_battle + jr nz, .opponent_won_duel +.player_won_duel xor a ; DUEL_WIN ld [wDuelResult], a ld a, DUEL_ANIM_DUEL_WIN ld c, MUSIC_MATCH_VICTORY ldtx hl, WonDuelText jr .handle_duel_finished -.active_duelist_lost_battle +.active_duelist_lost_duel ldh a, [hWhoseTurn] cp PLAYER_TURN - jr nz, .player_won_battle -.opponent_won_battle + jr nz, .player_won_duel +.opponent_won_duel ld a, DUEL_LOSS ld [wDuelResult], a ld a, DUEL_ANIM_DUEL_LOSS @@ -232,7 +232,7 @@ MainDuelLoop: ; 40ee (1:40ee) jr nz, .wait_song ld a, [wDuelFinished] cp TURN_PLAYER_TIED - jr z, .tied_battle + jr z, .tied_duel call Func_39fc call WaitForWideTextBoxInput call Func_3b31 @@ -241,7 +241,7 @@ MainDuelLoop: ; 40ee (1:40ee) ldh [hWhoseTurn], a ret -.tied_battle +.tied_duel call WaitForWideTextBoxInput call Func_3b31 ld a, [wDuelTheme] @@ -510,7 +510,7 @@ OpenActivePokemonScreen: ; 4376 (1:4376) ; triggered by selecting the "Pkmn Power" item in the duel menu DuelMenu_PkmnPower: ; 438e (1:438e) - call $6431 + call Func_6431 jp c, DuelMainInterface call UseAttackOrPokemonPower jp DuelMainInterface @@ -1027,7 +1027,7 @@ EnergyDiscardCardListParameters: ; 46f3 (1:46f3) db 4 ; number of items selectable without scrolling db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; triggered by selecting the "Attack" item in the duel menu DuelMenu_Attack: ; 46fc (1:46fc) @@ -1168,28 +1168,28 @@ AttackMenuParameters: ; 47e4 (1:47e4) db 2 ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; display the card page with id at wMovePageNumber of wLoadedCard1 -DisplayMovePage: ; $47ec (1:47ec) +DisplayMovePage: ; 47ec (1:47ec) ld a, [wMovePageNumber] ld hl, MovePageDisplayPointerTable jp JumpToFunctionInTable -MovePageDisplayPointerTable: ; $47f5 (1:47f5) +MovePageDisplayPointerTable: ; 47f5 (1:47f5) dw DisplayMovePage_Move1Page1 ; MOVEPAGE_MOVE1_1 dw DisplayMovePage_Move1Page2 ; MOVEPAGE_MOVE1_2 dw DisplayMovePage_Move2Page1 ; MOVEPAGE_MOVE2_1 dw DisplayMovePage_Move2Page2 ; MOVEPAGE_MOVE2_2 ; display MOVEPAGE_MOVE1_1 -DisplayMovePage_Move1Page1: ; $47fd (1:47fd) +DisplayMovePage_Move1Page1: ; 47fd (1:47fd) call DisplayCardPage_PokemonMove1Page1 jr SwitchMovePage ; display MOVEPAGE_MOVE1_2 if it exists. otherwise return in order ; to switch back to MOVEPAGE_MOVE1_1 and display it instead. -DisplayMovePage_Move1Page2: ; $4802 (1:4802) +DisplayMovePage_Move1Page2: ; 4802 (1:4802) ld hl, wLoadedCard1Move1Description + 2 ld a, [hli] or [hl] @@ -1198,13 +1198,13 @@ DisplayMovePage_Move1Page2: ; $4802 (1:4802) jr SwitchMovePage ; display MOVEPAGE_MOVE2_1 -DisplayMovePage_Move2Page1: ; $480d (1:480d) +DisplayMovePage_Move2Page1: ; 480d (1:480d) call DisplayCardPage_PokemonMove2Page1 jr SwitchMovePage ; display MOVEPAGE_MOVE2_2 if it exists. otherwise return in order ; to switch back to MOVEPAGE_MOVE2_1 and display it instead. -DisplayMovePage_Move2Page2: ; $4812 (1:4812) +DisplayMovePage_Move2Page2: ; 4812 (1:4812) ld hl, wLoadedCard1Move2Description + 2 ld a, [hli] or [hl] @@ -1214,7 +1214,7 @@ DisplayMovePage_Move2Page2: ; $4812 (1:4812) ; switch to MOVEPAGE_MOVE*_2 if in MOVEPAGE_MOVE*_1 and vice versa. ; sets the next move page to switch to if Right or Left are pressed. -SwitchMovePage: ; $481b (1:481b) +SwitchMovePage: ; 481b (1:481b) ld hl, wMovePageNumber ld a, $01 xor [hl] @@ -2152,7 +2152,7 @@ NoBasicPokemonCardListParameters: ; 4e37 (1:4e37) db 7 ; number of items selectable without scrolling db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; used only during the practice duel with Sam. ; displays the list with the player's cards in hand, and the player's name above the list. @@ -2664,7 +2664,7 @@ DoPracticeDuelAction: ; 51e7 (1:51e7) jp JumpToFunctionInTable PracticeDuelActionTable: ; 51f8 (1:51f8) - dw $0000 + dw NULL dw PracticeDuel_DrawSevenCards dw PracticeDuel_PlayGoldeen dw PracticeDuel_PutStaryuInBench @@ -3484,7 +3484,7 @@ ItemSelectionMenuParameters: ; 5708 (1:5708) db 2 ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 CardListParameters: ; 5710 (1:5710) db 1, 3 ; cursor x, cursor y @@ -5694,7 +5694,135 @@ PrintPlayAreaCardAttachedEnergies: ; 63e6 (1:63e6) ret ; 0x6423 - INCROM $6423, $6510 +Func_6423: ; 6423 (1:6423) + ld hl, wDefaultText + ld e, $08 +.asm_6428 + ld a, [hli] + call JPWriteByteToBGMap0 + inc b + dec e + jr nz, .asm_6428 + ret +; 0x6431 + +Func_6431: ; 6431 (1:6431) + xor a + ld [wSelectedDuelSubMenuItem], a + +Func_6435: + call Func_64b0 + ld hl, PlayAreaScreenMenuParameters_ActivePokemonIncluded + ld a, [wSelectedDuelSubMenuItem] + call InitializeMenuParameters + ld a, [wNumPlayAreaItems] + ld [wNumMenuItems], a +.asm_6447 + call DoFrame + call HandleMenuInput + ldh [hTempPlayAreaLocation_ff9d], a + ld [wHUDEnergyAndHPBarsX], a + jr nc, .asm_6447 + cp $ff + jr z, .asm_649b + ld [wSelectedDuelSubMenuItem], a + ldh a, [hKeysPressed] + and START + jr nz, .asm_649d + ldh a, [hCurMenuItem] + add a + ld e, a + ld d, $00 + ld hl, wDuelTempList + 1 + add hl, de + ld a, [hld] + cp $04 + jr nz, .asm_6447 + ld a, [hl] + ldh [hTempCardIndex_ff98], a + ld d, a + ld e, $00 + call CopyMoveDataAndDamage_FromDeckIndex + call DisplayUsePokemonPowerScreen + ld a, EFFECTCMDTYPE_INITIAL_EFFECT_1 + call TryExecuteEffectCommandFunction + jr nc, .asm_648c + ldtx hl, PokemonPowerSelectNotRequiredText + call DrawWideTextBox_WaitForInput + jp Func_6435 +.asm_648c + ldtx hl, UseThisPokemonPowerText + call YesOrNoMenuWithText + jp c, Func_6435 + ldh a, [hTempCardIndex_ff98] + ldh [hTemp_ffa0], a + or a + ret +.asm_649b + scf + ret +.asm_649d + ldh a, [hCurMenuItem] + add DUELVARS_ARENA_CARD + call GetTurnDuelistVariable + call GetCardIDFromDeckIndex + call LoadCardDataToBuffer1_FromCardID + call OpenCardPage_FromCheckPlayArea + jp Func_6435 +; 0x64b0 + +Func_64b0: ; 64b0 (1:64b0) + call ZeroObjectPositionsAndToggleOAMCopy + call EmptyScreen + call LoadDuelCardSymbolTiles + call LoadDuelCheckPokemonScreenTiles + ld de, wDuelTempList + call SetListPointer + ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA + call GetTurnDuelistVariable + ld c, a + ld b, $00 +.asm_64ca + push hl + push bc + ld a, b + ld [wHUDEnergyAndHPBarsX], a + ld a, b + add a + add b + ld [wCurPlayAreaY], a + ld a, b + add DUELVARS_ARENA_CARD + call GetTurnDuelistVariable + call SetNextElementOfList + call PrintPlayAreaCardHeader + call PrintPlayAreaCardLocation + call Func_64fc + ld a, [wLoadedCard1Move1Category] + call SetNextElementOfList + pop bc + pop hl + inc b + dec c + jr nz, .asm_64ca + ld a, b + ld [wNumPlayAreaItems], a + call EnableLCD + ret +; 0x64fc + +Func_64fc: ; 64fc (1:64fc) + ld a, [wLoadedCard1Move1Category] + cp POKEMON_POWER + ret nz + ld a, [wCurPlayAreaY] + inc a + ld e, a + ld d, $04 + ld hl, wLoadedCard1Move1Name + call InitTextPrinting_ProcessTextFromPointerToID + ret +; 0x6510 ; display the screen that prompts the player to use the selected card's ; Pokemon Power. Includes the card's information above, and the Pokemon Power's @@ -8134,7 +8262,7 @@ Func_73d8: ; 73d8 (1:73d8) ld [hli], a ld [hl], a .asm_73ec - ld hl, $7408 + ld hl, Data_7408 call PlaceTextItems call DrawDuelistPortraitsAndNames ld a, [wOpponentDeckID] @@ -8144,8 +8272,8 @@ Func_73d8: ; 73d8 (1:73d8) lb bc, 15, 10 call WriteTwoByteNumberInTxSymbolFormat ret -; 0x7408 +Data_7408: ; 7408 (1:7408) INCROM $7408, $7415 Func_7415: ; 7415 (1:7415) diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 1e6179b..01e8872 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -1379,8 +1379,8 @@ Func_8764: ; 8764 (2:4764) call LoadCursorTile ; reset ce5c and ce56 xor a - ld [$ce5c], a - ld [$ce56], a + ld [wce5c], a + ld [wce56], a ; draw play area screen for the turn player ldh a, [hWhoseTurn] @@ -1389,13 +1389,13 @@ Func_8764: ; 8764 (2:4764) call DrawYourOrOppPlayAreaScreen .swap - ld a, [$ce56] + ld a, [wce56] or a jr z, .draw_menu ; if ce56 != 0, swap turn call SwapTurn xor a - ld [$ce56], a + ld [wce56], a .draw_menu xor a @@ -1430,7 +1430,7 @@ Func_8764: ; 8764 (2:4764) ld l, a call DrawYourOrOppPlayAreaScreen xor a - ld [$ce56], a + ld [wce56], a .text call DrawWideTextBox @@ -1482,7 +1482,7 @@ PlayAreaMenuParameters: ; 8811 (2:4811) db 2 ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 Func_8819: ; 8819 (2:4819) ld a, [wPrizeCardCursorPosition] @@ -1506,7 +1506,7 @@ Func_8819: ; 8819 (2:4819) ld a, c add $40 - ld [$ce5c], a + ld [wce5c], a ld a, c add DUELVARS_PRIZE_CARDS call GetTurnDuelistVariable @@ -1524,7 +1524,7 @@ Func_8849: ; 8849 (2:4849) call CreateDeckCardList ret c ld a, %01111111 - ld [$ce5c], a + ld [wce5c], a ld a, [wDuelTempList] ; fallthrough @@ -1535,11 +1535,11 @@ Func_8849: ; 8849 (2:4849) ; with upper bit set if turn was swapped Func_8855: ; 8855 (2:4855) ld b, a - ld a, [$ce5c] + ld a, [wce5c] or a jr nz, .display ld a, b - ld [$ce5c], a + ld [wce5c], a .display ld a, b call LoadCardDataToBuffer1_FromDeckIndex @@ -1550,15 +1550,15 @@ Func_8855: ; 8855 (2:4855) pop af ; if ce56 != 0, swap turn - ld a, [$ce56] + ld a, [wce56] or a jr z, .dont_swap call SwapTurn - ld a, [$ce5c] + ld a, [wce5c] or %10000000 ret .dont_swap - ld a, [$ce5c] + ld a, [wce5c] ret Func_8883: ; 8883 (2:4883) @@ -1597,7 +1597,7 @@ Func_8883: ; 8883 (2:4883) call SwapTurn ld a, $01 - ld [$ce56], a + ld [wce56], a jp Func_8764.loop_2 Func_8764_TransitionTable: ; 88c2 (2:48c2) @@ -1866,13 +1866,13 @@ Func_8cd4: ; 8cd4 (2:4cd4) Func_8cf9: ; 8cf9 (2:4cf9) call EnableSRAM xor a - ld hl, $b703 + ld hl, sb703 ld [hli], a inc a ld [hli], a ld [hli], a ld [hl], a - ld [$b701], a + ld [sb701], a call DisableSRAM Func_8d0b: ; 8d0b (2:4d0b) ld hl, Unknown_8d15 @@ -2106,7 +2106,7 @@ Func_8f05: ; 8f05 (2:4f05) ret Func_8f38: ; 8f38 (2:4f38) - ld hl, $b701 + ld hl, sb701 call EnableSRAM ld a, [hli] ld h, [hl] @@ -2127,7 +2127,7 @@ Func_8f38: ; 8f38 (2:4f38) inc hl ld [hl], $20 inc hl - ld de, $c592 + ld de, wc592 ld a, [de] inc de ld [hli], a @@ -2138,7 +2138,7 @@ Func_8f38: ; 8f38 (2:4f38) ld [hli], a xor a ld [hl], a - ld hl, $b701 + ld hl, sb701 call EnableSRAM ld e, [hl] inc hl @@ -2447,17 +2447,17 @@ Func_9152: ; 9152 (2:5152) Func_9168: ; 9168 (2:5168) ld [hffb5], a call Func_8d56 - ld de, $0000 - ld bc, $1404 + lb de, 0, 0 + lb bc, 20, 4 call DrawRegularTextBox - ld de, $0003 - ld bc, $1404 + lb de, 0, 3 + lb bc, 20, 4 call DrawRegularTextBox - ld de, $0006 - ld bc, $1404 + lb de, 0, 6 + lb bc, 20, 4 call DrawRegularTextBox - ld de, $0009 - ld bc, $1404 + lb de, 0, 9 + lb bc, 20, 4 call DrawRegularTextBox ld hl, Unknown_9242 call PlaceTextItems @@ -2709,13 +2709,25 @@ CalculateOnesAndTensDigits: ; 98a6 (2:58a6) pop af ret - INCROM $98c7, $9e41 + INCROM $98c7, $9a6d + +Func_9a6d: ; 9a6d (2:5a6d) + INCROM $9a6d, $9e41 Func_9e41: ; 9e41 (2:5e41) INCROM $9e41, $a288 Func_a288: ; a288 (2:6288) - INCROM $a288, $b177 + INCROM $a288, $a913 + +Func_a913: ; a913 (2:6913) + INCROM $a913, $ad51 + +Func_ad51: ; ad51 (2:6d51) + INCROM $ad51, $adfe + +Func_adfe: ; adfe (2:6dfe) + INCROM $adfe, $b177 Func_b177: ; b177 (2:7177) INCROM $b177, $b19d @@ -2728,20 +2740,20 @@ Func_b19d: ; b19d (2:719d) ld [hl], e inc hl ld [hl], d - call $7379 + call Func_b379 ld a, $3c ld [wd0a5], a xor a .asm_b1b3 - ld hl, $76fb - call $5a6d - call $7704 - call $7545 + ld hl, Unknown_b6fb + call Func_9a6d + call Func_b704 + call Func_b545 ldtx hl, PleaseSelectDeckText call DrawWideTextBox_PrintText ld de, $0224 ; PleaseSelectDeckText? - call $7285 - call $729f + call Func_b285 + call Func_b29f jr c, .asm_b1b3 cp $ff ret z @@ -2751,15 +2763,16 @@ Func_b19d: ; b19d (2:719d) ld [wd088], a call ResetCheckMenuCursorPositionAndBlink call DrawWideTextBox - ld hl, $7274 + ld hl, Unknown_b274 call PlaceTextItems +.asm_b1e7 call DoFrame call HandleCheckMenuInput - jp nc, $71e7 + jp nc, .asm_b1e7 cp $ff jr nz, .asm_b1fa ld a, [wd086] - jp $71b3 + jp .asm_b1b3 .asm_b1fa ld a, [wCheckMenuCursorYPosition] @@ -2768,66 +2781,108 @@ Func_b19d: ; b19d (2:719d) add [hl] or a jr nz, .asm_b22c - call $735b + call Func_b35b jr nc, .asm_b216 - call $7592 + call Func_b592 ld a, [wd086] - jp c, $71b3 + jp c, .asm_b1b3 jr .asm_b25e .asm_b216 - ld hl, $0272 + ldtx hl, OKIfFileDeletedText call YesOrNoMenuWithText ld a, [wd086] jr c, .asm_b1b3 - call $7592 + call Func_b592 ld a, [wd086] - jp c, $71b3 + jp c, .asm_b1b3 jr .asm_b25e .asm_b22c cp $1 jr nz, .asm_b24c - call $735b + call Func_b35b jr c, .asm_b240 - call $76ca + call Func_b6ca ld a, [wd086] - jp c, $71b3 + jp c, .asm_b1b3 jr .asm_b25e .asm_b240 ld hl, WaitForVBlank call DrawWideTextBox_WaitForInput ld a, [wd086] - jp $71b3 + jp .asm_b1b3 .asm_b24c cp $2 jr nz, .asm_b273 - call $735b + call Func_b35b jr c, .asm_b240 - call $77c6 + call Func_b7c6 ld a, [wd086] - jp nc, $71b3 + jp nc, .asm_b1b3 .asm_b25e ld a, [wd087] ld [wcea1], a - call $7379 - call $7704 - call $7545 + call Func_b379 + call Func_b704 + call Func_b545 ld a, [wd086] - jp $71b3 + jp .asm_b1b3 .asm_b273 ret -; 0xb274 - INCROM $b274, $ba04 +Unknown_b274: ; b274 (2:7274) + INCROM $b274, $b285 + +Func_b285: ; b285 (2:7285) + INCROM $b285, $b29f + +Func_b29f: ; b29f (2:729f) + INCROM $b29f, $b35b + +Func_b35b: ; b35b (2:735b) + INCROM $b35b, $b379 + +Func_b379: ; b379 (2:7379) + INCROM $b379, $b3fe + +Unknown_b3fe: ; b3fe (2:73fe) + INCROM $b3fe, $b545 + +Func_b545: ; b545 (2:7545) + INCROM $b545, $b592 + +Func_b592: ; b592 (2:7592) + INCROM $b592, $b625 + +Func_b625: ; b625 (2:7625) + INCROM $b625, $b644 + +Func_b644: ; b644 (2:7644) + INCROM $b644, $b653 + +Func_b653: ; b653 (2:7653) + INCROM $b653, $b6ca + +Func_b6ca: ; b6ca (2:76ca) + INCROM $b6ca, $b6fb + +Unknown_b6fb: ; b6fb (2:76fb) + INCROM $b6fb, $b704 + +Func_b704: ; b704 (2:7704) + INCROM $b704, $b7c6 + +Func_b7c6: ; b7c6 (2:77c6) + INCROM $b7c6, $ba04 Func_ba04: ; ba04 (2:7a04) ld a, [wd0a9] - ld hl, $7b83 + ld hl, Data_bb83 sla a ld c, a ld b, $0 @@ -2840,17 +2895,20 @@ Func_ba04: ; ba04 (2:7a04) ld [de], a xor a ld [wcea1], a - call $7b97 + call Func_bb97 ld a, $5 ld [wd0a5], a xor a - ld hl, $7b6e + ; fallthrough + +Func_ba25: ; ba25 (2:7a25) + ld hl, Func_bb6e call InitializeMenuParameters ldtx hl, PleaseSelectDeckText call DrawWideTextBox_PrintText ld a, $5 ld [wNamingScreenKeyboardHeight], a - ld hl, $73fe + ld hl, Unknown_b3fe ld d, h ld a, l ld hl, wcece @@ -2882,7 +2940,7 @@ Func_ba04: ; ba04 (2:7a04) ld b, $0 ld hl, wd00d add hl, bc - call $7653 + call Func_b653 ld a, [hli] ld h, [hl] ld l, a @@ -2893,19 +2951,19 @@ Func_ba04: ; ba04 (2:7a04) ld e, l ld a, [hl] pop hl - call $7644 + call Func_b644 or a jr z, .asm_ba40 ld a, $1 call PlaySFXConfirmOrCancel - call $7653 + call Func_b653 call Func_8e1f - call $7644 + call Func_b644 ld a, [wd087] ld [wcea1], a - call $7b97 + call Func_bb97 ld a, [wd086] - jp $7a25 + jp Func_ba25 .asm_baa3 call DrawCursor2 @@ -2915,21 +2973,22 @@ Func_ba04: ; ba04 (2:7a04) ld [wd086], a ldh a, [hCurMenuItem] cp $ff - jp z, $7b0d + jp z, .asm_bb0d ld [wd088], a call ResetCheckMenuCursorPositionAndBlink xor a ld [wce5e], a call DrawWideTextBox - ld hl, $7b76 + ld hl, Data_bb76 call PlaceTextItems +.asm_bacc call DoFrame - call $46ac - jp nc, $7acc + call HandleCheckMenuInput_YourOrOppPlayArea + jp nc, .asm_bacc cp $ff jr nz, .asm_badf ld a, [wd086] - jp $7a25 + jp Func_ba25 .asm_badf ld a, [wCheckMenuCursorYPosition] @@ -2938,20 +2997,21 @@ Func_ba04: ; ba04 (2:7a04) add [hl] or a jr nz, .asm_bb09 - call $7653 - call $77c6 - call $7644 + call Func_b653 + call Func_b7c6 + call Func_b644 ld a, [wd086] - jp nc, $7a25 + jp nc, Func_ba25 ld a, [wd087] ld [wcea1], a - call $7b97 + call Func_bb97 ld a, [wd086] - jp $7a25 + jp Func_ba25 .asm_bb09 cp $1 jr nz, .asm_bb12 +.asm_bb0d xor a ld [wd0a4], a ret @@ -2979,7 +3039,7 @@ Func_ba04: ; ba04 (2:7a04) ld a, [hl] ld [bc], a pop hl - call $7653 + call Func_b653 ld a, [hli] ld h, [hl] ld l, a @@ -2990,20 +3050,29 @@ Func_ba04: ; ba04 (2:7a04) ld e, l ld a, [hl] pop hl - call $7644 + call Func_b644 or a - jp z, $7a40 + jp z, .asm_ba40 ld a, $1 call PlaySFXConfirmOrCancel - call $7653 + call Func_b653 xor a - call $6dfe - call $7644 + call Func_adfe + call Func_b644 ld a, [wd087] ld [wcea1], a - call $7b97 + call Func_bb97 ld a, [wd086] - jp $7a25 -; 0xbb6e + jp Func_ba25 + +Func_bb6e: ; bb6e (2:7b6e) + INCROM $bb6e, $bb76 + +Data_bb76: ; bb76 (2:7b76) + INCROM $bb76, $bb83 + +Data_bb83: ; bb83 (2:7b83) + INCROM $bb83, $bb97 - INCROM $bb6e, $c000 +Func_bb97: ; bb97 (2:7b97) + INCROM $bb97, $c000 diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index 79a7edf..87c9401 100755..100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -114,8 +114,8 @@ SetScriptData: ; c0f1 (3:40f1) ld a, c ld [wNextScript], a ld a, b - ld [wNextScript+1], a - ld a, $3 + ld [wNextScript + 1], a + ld a, OWMODE_SCRIPT ld [wOverworldMode], a jr EnterScript @@ -190,19 +190,19 @@ Func_c158: ; c158 (3:4158) Func_c17a: ; c17a (3:417a) ld a, [wOverworldMode] - cp $3 + cp OWMODE_SCRIPT ret z call Func_c9b8 ret Func_c184: ; c184 (3:4184) push bc - ld c, $1 + ld c, OWMODE_MOVE ld a, [wCurMap] cp OVERWORLD_MAP - jr nz, .asm_c190 - ld c, $0 -.asm_c190 + jr nz, .not_map + ld c, OWMODE_MAP +.not_map ld a, c ld [wOverworldMode], a ld [wd0c0], a @@ -230,13 +230,13 @@ WhiteOutDMGPals: ; c1a4 (3:41a4) Func_c1b1: ; c1b1 (3:41b1) ld a, $c ld [wd32e], a - ld a, $0 + ld a, OVERWORLD_MAP ld [wTempMap], a ld a, $c ld [wTempPlayerXCoord], a ld a, $c ld [wTempPlayerYCoord], a - ld a, $2 + ld a, SOUTH ld [wTempPlayerDirection], a call Func_c9cb call Func_c9dd @@ -303,13 +303,13 @@ Func_c251: ; c251 (3:4251) ldh a, [hffb0] push af ld a, $1 - jr asm_c25d + jr Func_c258.asm_c25d Func_c258: ; c258 (3:4258) ldh a, [hffb0] push af ld a, $2 -asm_c25d: +.asm_c25d ldh [hffb0], a push hl call Func_c268 @@ -319,25 +319,26 @@ asm_c25d: ret Func_c268: ; c268 (3:4268) - ld hl, Unknown_c27c -.asm_c26b + ld hl, PauseMenuTextList +.loop push hl ld a, [hli] ld h, [hl] ld l, a or h - jr z, .asm_c27a + jr z, .done call ProcessTextFromID pop hl inc hl inc hl - jr .asm_c26b -.asm_c27a + jr .loop +.done pop hl ret -Unknown_c27c: ; c27c (3:427c) - INCROM $c27c, $c280 +PauseMenuTextList: ; c27c (3:427c) + tx PauseMenuOptionsText + dw NULL Func_c280: ; c280 (3:4280) call Func_c228 @@ -466,9 +467,121 @@ Func_c36a: ; c36a (3:436a) ld [wd324], a .asm_c379 ret -; 0xc37a - INCROM $c37a, $c41c +Func_c37a: ; c37a (3:437a) + push hl + push bc + ld hl, wBoosterViableCardList + push hl + ld a, $80 + ld c, $00 +.asm_c384 + ld [hli], a + dec c + jr nz, .asm_c384 + pop hl + call Func_c38f + pop bc + pop hl + ret + +Func_c38f: ; c38f (3:438f) + push hl + push bc + ld a, [wd23a] + ld e, a + ld a, [wd23b] + ld d, a + or e + jr z, .asm_c3c7 + push hl + ld b, $c0 + call Func_08bf + ld a, [wd23d] + ld [wTempPointerBank], a + ld a, [wd130] + inc a + srl a + ld b, a + ld a, [wd12f] + inc a + srl a + ld c, a + pop de +.asm_c3b7 + push bc + ld b, $00 + call Func_3be4 + ld hl, $10 + add hl, de + ld d, h + ld e, l + pop bc + dec b + jr nz, .asm_c3b7 +.asm_c3c7 + pop bc + pop hl + ret + +Func_c3ca: ; c3ca (3:43ca) + push hl + push bc + push de + push bc + push de + pop bc + call GetPermissionByteOfMapPosition + pop bc + srl b + srl c + ld de, $10 +.asm_c3db + push bc + push hl +.asm_c3dd + ld a, [hl] + or $10 + ld [hli], a + dec b + jr nz, .asm_c3dd + pop hl + add hl, de + pop bc + dec c + jr nz, .asm_c3db + pop de + pop bc + pop hl + ret + +Func_c3ee: ; c3ee (3:43ee) + push hl + push bc + ld c, $00 + ld hl, wBoosterViableCardList +.asm_c3f5 + ld a, [hl] + and $ef + ld [hli], a + dec c + jr nz, .asm_c3f5 + pop bc + pop hl + ret + +Func_c3ff: ; c3ff (3:43ff) + ld a, [wd12f] + sub $14 + ld [wd237], a + ld a, [wd130] + sub $12 + ld [wd238], a + call Func_c41c + call Func_c469 + call SetScreenScrollWram + call SetScreenScroll + ret Func_c41c: ; c41c (3:441c) ld a, [wd332] @@ -573,10 +686,10 @@ Func_c4b9: ; c4b9 (3:44b9) farcall LoadPaletteData ld b, $0 ld a, [wConsole] - cp $2 - jr nz, .asm_c4d1 + cp CONSOLE_CGB + jr nz, .not_cgb ld b, $1e -.asm_c4d1 +.not_cgb ld a, b ld [wd337], a @@ -586,13 +699,13 @@ Func_c4b9: ; c4b9 (3:44b9) ld a, [wWhichSprite] ld [wPlayerSpriteIndex], a - ld b, $2 + ld b, SOUTH ld a, [wCurMap] cp OVERWORLD_MAP - jr z, .asm_c4ee + jr z, .ow_map ld a, [wTempPlayerDirection] ld b, a -.asm_c4ee +.ow_map ld a, b ld [wPlayerDirection], a call UpdatePlayerSprite @@ -604,9 +717,9 @@ Func_c4b9: ; c4b9 (3:44b9) ld [wd338], a ld a, [wCurMap] cp OVERWORLD_MAP - jr nz, .asm_c50f + jr nz, .not_ow_map farcall Func_10fde -.asm_c50f +.not_ow_map ret HandlePlayerMoveMode: ; c510 (3:4510) @@ -619,14 +732,15 @@ HandlePlayerMoveMode: ; c510 (3:4510) call z, HandlePlayerMoveModeInput ld a, [wPlayerCurrentlyMoving] or a - jr z, .notMoving + jr z, .not_moving bit 0, a call nz, Func_c66c ld a, [wPlayerCurrentlyMoving] bit 1, a call nz, Func_c6dc ret -.notMoving + +.not_moving ldh a, [hKeysPressed] and START call nz, OpenStartMenu @@ -648,10 +762,11 @@ Func_c554: ; c554 (3:4554) ld [wWhichSprite], a ld a, [wCurMap] cp OVERWORLD_MAP - jr nz, .asm_c566 + jr nz, .not_ow_map farcall Func_10e28 ret -.asm_c566 + +.not_ow_map push hl push bc push de @@ -701,13 +816,13 @@ Func_c58b: ; c58b (3:458b) HandlePlayerMoveModeInput: ; c5ac (3:45ac) ldh a, [hKeysHeld] and D_PAD - jr z, .skipMoving + jr z, .skip_moving call UpdatePlayerDirectionFromDPad call AttemptPlayerMovementFromDirection ld a, [wPlayerCurrentlyMoving] and $1 jr nz, .done -.skipMoving +.skip_moving ldh a, [hKeysPressed] and A_BUTTON jr z, .done @@ -727,13 +842,13 @@ GetDirectionFromDPad: ; c5d5 (3:45d5) push hl ld hl, KeypadDirectionMap or a - jr z, .loadDirectionMapping -.findDirectionMappingLoop + jr z, .get_direction +.loop rlca - jr c, .loadDirectionMapping + jr c, .get_direction inc hl - jr .findDirectionMappingLoop -.loadDirectionMapping + jr .loop +.get_direction ld a, [hl] pop hl ret @@ -813,7 +928,7 @@ FindPlayerMovementWithOffset: ; c656 (3:4656) ld c, a ld b, $0 push hl - ld hl, PlayerMovementOffsetTable + ld hl, PlayerMovementOffsetTable_Tiles add hl, bc ld a, [wPlayerXCoord] add [hl] @@ -859,7 +974,7 @@ Func_c694: ; c694 (3:4694) rlca ld c, a ld b, $0 - ld hl, Unknown_396b + ld hl, PlayerMovementOffsetTable add hl, bc pop bc .asm_c6a0 @@ -915,7 +1030,7 @@ Func_c6dc: ; c6dc (3:46dc) call Func_3997 call Func_c70d ld a, [wOverworldMode] - cp $1 + cp OWMODE_MOVE call z, Func_c9c0 pop hl ret @@ -951,23 +1066,24 @@ FindNPCOrObject: ; c71e (3:471e) call FindPlayerMovementFromDirection call GetPermissionOfMapPosition and $40 - jr z, .noNPC + jr z, .no_npc farcall FindNPCAtLocation - jr c, .noNPC + jr c, .no_npc ld a, [wLoadedNPCTempIndex] ld [wScriptNPC], a ld a, OWMODE_START_SCRIPT - jr .changeStateExit + jr .set_mode -.noNPC +.no_npc call HandleMoveModeAPress jr nc, .exit ld a, OWMODE_SCRIPT - jr .changeStateExit + jr .set_mode .exit or a ret -.changeStateExit + +.set_mode ld [wOverworldMode], a scf ret @@ -976,46 +1092,46 @@ OpenStartMenu: ; c74d (3:474d) push hl push bc push de - call MainMenu_c75a + call StartMenu call CloseAdvancedDialogueBox pop de pop bc pop hl ret -MainMenu_c75a: ; c75a (3:475a) +StartMenu: ; c75a (3:475a) call PauseSong ld a, MUSIC_PAUSE_MENU call PlaySong call Func_c797 -.asm_c765 +.loop ld a, $1 call Func_c29b -.asm_c76a +.wait_input call DoFrameIfLCDEnabled call HandleMenuInput - jr nc, .asm_c76a + jr nc, .wait_input ld a, e ld [wd0b8], a ldh a, [hCurMenuItem] cp e - jr nz, .asm_c793 + jr nz, .exit cp $5 - jr z, .asm_c793 + jr z, .exit call Func_c2a3 ld a, [wd0b8] ld hl, PointerTable_c7a2 call JumpToFunctionInTable ld hl, Func_c797 call Func_c32b - jr .asm_c765 -.asm_c793 + jr .loop +.exit call ResumeSong ret Func_c797: ; c797 (3:4797) ld a, [wd0b8] - ld hl, Unknown_cd98 + ld hl, Unknown_10d98 farcall Func_111e9 ret @@ -1063,7 +1179,7 @@ Func_c7e5: ; c7e5 (3:47e5) farcall Func_103d2 ret -PC_c7ea: ; c7ea (3:47ea) +PCMenu: ; c7ea (3:47ea) ld a, MUSIC_PC_MAIN_MENU call PlaySong call Func_c241 @@ -1071,29 +1187,29 @@ PC_c7ea: ; c7ea (3:47ea) call DoFrameIfLCDEnabled ldtx hl, TurnedPCOnText call PrintScrollableText_NoTextBoxLabel - call $484e -.asm_c801 + call Func_c84e +.loop ld a, $1 call Func_c29b -.asm_c806 +.wait_input call DoFrameIfLCDEnabled call HandleMenuInput - jr nc, .asm_c806 + jr nc, .wait_input ld a, e ld [wd0b9], a ldh a, [hCurMenuItem] cp e - jr nz, .asm_c82f + jr nz, .exit cp $4 - jr z, .asm_c82f + jr z, .exit call Func_c2a3 ld a, [wd0b9] - ld hl, $4846 + ld hl, PointerTable_c846 call JumpToFunctionInTable - ld hl, $484e + ld hl, Func_c84e call Func_c32b - jr .asm_c801 -.asm_c82f + jr .loop +.exit call CloseTextBox call DoFrameIfLCDEnabled ldtx hl, TurnedPCOffText @@ -1103,9 +1219,48 @@ PC_c7ea: ; c7ea (3:47ea) ld [wd112], a call Func_39fc ret -; 0xc846 - INCROM $c846, $c891 +PointerTable_c846: ; c846 (3:4846) + dw Func_c859 + dw Func_c86d + dw Func_c872 + dw Func_c877 + +Func_c84e: ; c84e (3:484e) + ld a, [wd0b9] + ld hl, Unknown_10da9 + farcall Func_111e9 + ret + +Func_c859: ; c859 (3:4859) + xor a + ldh [hSCX], a + ldh [hSCY], a + call Set_OBJ_8x16 + farcall Func_1288c + farcall Func_a913 + call Set_OBJ_8x8 + ret + +Func_c86d: ; c86d (3:486d) + farcall Func_1076d + ret + +Func_c872: ; c872 (3:4872) + farcall Func_1052f + ret + +Func_c877: ; c877 (3:4877) + xor a + ldh [hSCX], a + ldh [hSCY], a + call Set_OBJ_8x16 + farcall Func_1288c + farcall Func_ad51 + call Set_OBJ_8x8 + call WhiteOutDMGPals + call DoFrameIfLCDEnabled + ret Func_c891: ; c891 (3:4891) push hl @@ -1161,7 +1316,7 @@ Func_c8ba: ; c8ba (3:48ba) call Func_c241 call Func_c915 call DoFrameIfLCDEnabled - call $2c62 + call PrintScrollableText_WithTextBoxLabel ret Func_c8ed: ; c8ed (3:48ed) @@ -1198,10 +1353,10 @@ Func_c8ed: ; c8ed (3:48ed) Func_c915: ; c915 (3:4915) push bc push de - ld de, $000c - ld bc, $1406 + lb de, $00, $0c + lb bc, $14, $06 call AdjustCoordinatesForBGScroll - call $43ca + call Func_c3ca pop de pop bc ret @@ -1221,7 +1376,7 @@ SetNextScript: ; c935 (3:4935) ld [hl], c inc hl ld [hl], b - ld a, $3 + ld a, OWMODE_SCRIPT ld [wOverworldMode], a pop hl ret @@ -1233,7 +1388,7 @@ Func_c943: ; c943 (3:4943) ld l, MAP_SCRIPT_NPCS call GetMapScriptPointer jr nc, .quit -.loadNPCLoop +.load_npc_loop ld a, l ld [wTempPointer], a ld a, h @@ -1249,22 +1404,22 @@ Func_c943: ; c943 (3:4943) push hl ld a, [wLoadNPCFunction] ld l, a - ld a, [wLoadNPCFunction+1] + ld a, [wLoadNPCFunction + 1] ld h, a or l - jr z, .noScript + jr z, .no_script call CallHL2 - jr nc, .nextNPC -.noScript + jr nc, .next_npc +.no_script ld a, [wTempNPC] farcall LoadNPCSpriteData call Func_c998 farcall Func_1c485 -.nextNPC +.next_npc pop hl ld bc, NPC_MAP_SIZE add hl, bc - jr .loadNPCLoop + jr .load_npc_loop .quit ld l, MAP_SCRIPT_POST_NPC call CallMapScriptPointerIfExists @@ -1275,17 +1430,17 @@ Func_c943: ; c943 (3:4943) Func_c998: ; c998 (3:4998) ld a, [wTempNPC] - cp $22 + cp NPC_AMY ret nz ld a, [wd3d0] or a ret z ld b, $4 ld a, [wConsole] - cp $2 - jr nz, .asm_c9ae + cp CONSOLE_CGB + jr nz, .not_cgb ld b, $e -.asm_c9ae +.not_cgb ld a, b ld [wd3b1], a ld a, $0 @@ -1316,14 +1471,14 @@ Func_c9cb: ; c9cb (3:49cb) push hl push bc ld hl, wEventFlags - ld bc, $0040 -.asm_c9d3 + ld bc, EVENT_FLAG_BYTES +.loop xor a ld [hli], a dec bc ld a, b or c - jr nz, .asm_c9d3 + jr nz, .loop pop bc pop hl ret @@ -1342,18 +1497,18 @@ DetermineImakuniRoom: ; c9e8 (3:49e8) ld c, $0 get_flag_value EVENT_IMAKUNI_STATE cp IMAKUNI_TALKED - jr c, .finish -.tryLoadImakuniLoop + jr c, .skip +.loop call UpdateRNGSources - and $3 + and %11 ld c, a - ld b, $0 + ld b, 0 ld hl, ImakuniPossibleRooms add hl, bc ld a, [wTempMap] cp [hl] - jr z, .tryLoadImakuniLoop -.finish + jr z, .loop +.skip ld a, c set_flag_value EVENT_IMAKUNI_ROOM ret @@ -1367,32 +1522,33 @@ ImakuniPossibleRooms: ; ca0a (3:4a04) Func_ca0e: ; ca0e (3:4a0e) ld a, [wd32e] cp $b - jr z, .asm_ca68 - get_flag_value EVENT_RECEIVED_LEGENDARY_CARD + jr z, .done + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS or a - jr nz, .asm_ca4a - get_flag_value EVENT_FLAG_40 + jr nz, .challenge_cup_three +; challenge cup two + get_flag_value EVENT_CHALLENGE_CUP_2_STATE cp $7 - jr z, .asm_ca68 + jr z, .done or a - jr z, .asm_ca33 + jr z, .challenge_cup_one cp $2 - jr z, .asm_ca62 + jr z, .close_challenge_cup_one ld c, $1 - set_flag_value EVENT_FLAG_40 - jr .asm_ca62 -.asm_ca33 - get_flag_value EVENT_FLAG_3F + set_flag_value EVENT_CHALLENGE_CUP_2_STATE + jr .close_challenge_cup_one +.challenge_cup_one + get_flag_value EVENT_CHALLENGE_CUP_1_STATE cp $7 - jr z, .asm_ca68 + jr z, .done or a - jr z, .asm_ca68 + jr z, .done cp $2 - jr z, .asm_ca68 + jr z, .done ld c, $1 - set_flag_value EVENT_FLAG_3F - jr .asm_ca68 -.asm_ca4a + set_flag_value EVENT_CHALLENGE_CUP_1_STATE + jr .done +.challenge_cup_three call UpdateRNGSources ld c, $1 and $3 @@ -1400,15 +1556,15 @@ Func_ca0e: ; ca0e (3:4a0e) jr z, .asm_ca56 ld c, $0 .asm_ca56 - set_flag_value EVENT_FLAG_41 - jr .asm_ca5c -.asm_ca5c + set_flag_value EVENT_CHALLENGE_CUP_3_STATE + jr .close_challenge_cup_two +.close_challenge_cup_two ld c, $7 - set_flag_value EVENT_FLAG_40 -.asm_ca62 + set_flag_value EVENT_CHALLENGE_CUP_2_STATE +.close_challenge_cup_one ld c, $7 - set_flag_value EVENT_FLAG_3F -.asm_ca68 + set_flag_value EVENT_CHALLENGE_CUP_1_STATE +.done ret GetStackFlagValue: ; ca69 (3:4a69) @@ -1423,13 +1579,13 @@ GetEventFlagValue: ; ca6c (3:4a6c) call GetEventFlag ld c, [hl] ld a, [wLoadedFlagBits] -.shiftLoop +.loop bit 0, a - jr nz, .lsbReached + jr nz, .done srl a srl c - jr .shiftLoop -.lsbReached + jr .loop +.done and c pop bc pop hl @@ -1457,13 +1613,13 @@ SetEventFlagValue: ; ca92 (3:4a92) push bc call GetEventFlag ld a, [wLoadedFlagBits] -.asm_ca9a +.loop bit 0, a - jr nz, .asm_caa4 + jr nz, .done srl a sla c - jr .asm_ca9a -.asm_caa4 + jr .loop +.done ld a, [wLoadedFlagBits] and c ld c, a @@ -1479,7 +1635,7 @@ SetEventFlagValue: ; ca92 (3:4a92) ; returns in a the byte db'd after the call to a function that calls this GetByteAfterCall: ; cab3 (3:4ab3) push hl - ld hl, sp+$4 + ld hl, sp+4 push bc ld c, [hl] inc hl @@ -1519,196 +1675,199 @@ TryGiveMedalPCPacks: ; cad8 (3:4ad8) push hl push bc ld hl, MedalEventFlags - ld bc, $0008 -.countMedalsLoop + lb bc, 0, 8 +.loop ld a, [hli] call GetEventFlagValue - jr z, .noMedal + jr z, .no_medal inc b -.noMedal +.no_medal dec c - jr nz, .countMedalsLoop + jr nz, .loop ld c, b set_flag_value EVENT_MEDAL_COUNT ld a, c push af - cp $8 - jr nc, .givePacksForEightMedals - cp $7 - jr nc, .givePacksForSevenMedals - cp $3 - jr nc, .givePacksForTwoMedals - jr .finish + cp 8 + jr nc, .give_packs_for_eight_medals + cp 7 + jr nc, .give_packs_for_seven_medals + cp 3 + jr nc, .give_packs_for_three_medals + jr .done -.givePacksForEightMedals +.give_packs_for_eight_medals ld a, $c farcall TryGivePCPack -.givePacksForSevenMedals +.give_packs_for_seven_medals ld a, $b farcall TryGivePCPack -.givePacksForTwoMedals +.give_packs_for_three_medals ld a, $a farcall TryGivePCPack -.finish +.done pop af pop bc pop hl ret MedalEventFlags: ; cb15 (3:4b15) - db EVENT_FLAG_08 - db EVENT_FLAG_09 - db EVENT_FLAG_0A + db EVENT_BEAT_NIKKI + db EVENT_BEAT_RICK + db EVENT_BEAT_KEN db EVENT_BEAT_AMY - db EVENT_FLAG_0C - db EVENT_FLAG_0D - db EVENT_FLAG_0E - db EVENT_FLAG_0F + db EVENT_BEAT_ISAAC + db EVENT_BEAT_MURRAY + db EVENT_BEAT_GENE + db EVENT_BEAT_MITCH ; returns wEventFlags byte in hl, related bits in wLoadedFlagBits GetEventFlag: ; cb1d (3:4b1d) push bc ld c, a - ld b, $0 + ld b, 0 sla c rl b - ld hl, EventFlagMods + ld hl, EventFlagMasks add hl, bc ld a, [hli] ld c, a ld a, [hl] ld [wLoadedFlagBits], a - ld b, $0 + ld b, 0 ld hl, wEventFlags add hl, bc pop bc ret -; offset - bytes to set or reset -EventFlagMods: ; cb37 (3:4b37) - flag_def $3f, %10000000 ; EVENT_FLAG_00 ; 0-7 are reset when game resets - flag_def $3f, %01000000 ; EVENT_FLAG_01 +; location in wEventFlags of each event flag: +; offset - which byte holds the event flag +; mask - which bits in the byte hold the value +; events 0-7 are reset when game resets +EventFlagMasks: ; cb37 (3:4b37) + flag_def $3f, %10000000 ; EVENT_TEMP_TRADED_WITH_ISHIHARA + flag_def $3f, %01000000 ; EVENT_TEMP_GIFTED_TO_MAN1 flag_def $3f, %00100000 ; EVENT_TEMP_TALKED_TO_IMAKUNI - flag_def $3f, %00010000 ; EVENT_TEMP_BATTLED_IMAKUNI - flag_def $3f, %00001000 ; EVENT_FLAG_04 - flag_def $3f, %00000100 ; EVENT_FLAG_05 - flag_def $3f, %00000010 ; EVENT_FLAG_06 - flag_def $3f, %00000001 ; EVENT_FLAG_07 - flag_def $00, %10000000 ; EVENT_FLAG_08 - flag_def $00, %01000000 ; EVENT_FLAG_09 - flag_def $00, %00100000 ; EVENT_FLAG_0A + flag_def $3f, %00010000 ; EVENT_TEMP_DUELED_IMAKUNI + flag_def $3f, %00001000 ; EVENT_TEMP_TRADED_WITH_LASS2 + flag_def $3f, %00000100 ; EVENT_TEMP_05 unused? + flag_def $3f, %00000010 ; EVENT_TEMP_06 unused? + flag_def $3f, %00000001 ; EVENT_TEMP_07 unused? + flag_def $00, %10000000 ; EVENT_BEAT_NIKKI + flag_def $00, %01000000 ; EVENT_BEAT_RICK + flag_def $00, %00100000 ; EVENT_BEAT_KEN flag_def $00, %00010000 ; EVENT_BEAT_AMY - flag_def $00, %00001000 ; EVENT_FLAG_0C - flag_def $00, %00000100 ; EVENT_FLAG_0D - flag_def $00, %00000010 ; EVENT_FLAG_0E - flag_def $00, %00000001 ; EVENT_FLAG_0F - flag_def $00, %11111111 ; EVENT_FLAG_10 - flag_def $01, %11110000 ; EVENT_FLAG_11 - flag_def $01, %00001111 ; EVENT_FLAG_12 + flag_def $00, %00001000 ; EVENT_BEAT_ISAAC + flag_def $00, %00000100 ; EVENT_BEAT_MURRAY + flag_def $00, %00000010 ; EVENT_BEAT_GENE + flag_def $00, %00000001 ; EVENT_BEAT_MITCH + flag_def $00, %11111111 ; EVENT_MEDAL_FLAGS + flag_def $01, %11110000 ; EVENT_PUPIL_MICHAEL_STATE + flag_def $01, %00001111 ; EVENT_GAL1_TRADE_STATE flag_def $02, %11000000 ; EVENT_IMAKUNI_STATE - flag_def $02, %00110000 ; EVENT_FLAG_14 + flag_def $02, %00110000 ; EVENT_LASS1_MENTIONED_IMAKUNI flag_def $02, %00001000 ; EVENT_BEAT_SARA flag_def $02, %00000100 ; EVENT_BEAT_AMANDA - flag_def $03, %11110000 ; EVENT_FLAG_17 - flag_def $03, %00001111 ; EVENT_FLAG_18 - flag_def $04, %11110000 ; EVENT_FLAG_19 - flag_def $04, %00001111 ; EVENT_FLAG_1A - flag_def $05, %10000000 ; EVENT_FLAG_1B - flag_def $05, %01000000 ; EVENT_FLAG_1C - flag_def $05, %00100000 ; EVENT_FLAG_1D - flag_def $05, %00010000 ; EVENT_FLAG_1E - flag_def $05, %00001111 ; EVENT_FLAG_1F - flag_def $06, %11110000 ; EVENT_FLAG_20 - flag_def $06, %00001100 ; EVENT_FLAG_21 - flag_def $06, %00000010 ; EVENT_RECEIVED_LEGENDARY_CARD - flag_def $06, %00000001 ; EVENT_FLAG_23 - flag_def $07, %11000000 ; EVENT_FLAG_24 - flag_def $07, %00100000 ; EVENT_FLAG_25 - flag_def $07, %00010000 ; EVENT_FLAG_26 - flag_def $07, %00001000 ; EVENT_FLAG_27 - flag_def $07, %00000100 ; EVENT_FLAG_28 - flag_def $07, %00000010 ; EVENT_FLAG_29 - flag_def $07, %00000001 ; EVENT_FLAG_2A - flag_def $08, %11111111 ; EVENT_FLAG_2B - flag_def $09, %11100000 ; EVENT_FLAG_2C - flag_def $09, %00011111 ; EVENT_FLAG_2D + flag_def $03, %11110000 ; EVENT_PUPIL_CHRIS_STATE + flag_def $03, %00001111 ; EVENT_MATTHEW_STATE + flag_def $04, %11110000 ; EVENT_CHAP2_TRADE_STATE + flag_def $04, %00001111 ; EVENT_DAVID_STATE + flag_def $05, %10000000 ; EVENT_JOSEPH_STATE + flag_def $05, %01000000 ; EVENT_ISHIHARA_MENTIONED + flag_def $05, %00100000 ; EVENT_ISHIHARA_MET + flag_def $05, %00010000 ; EVENT_ISHIHARAS_HOUSE_MENTIONED + flag_def $05, %00001111 ; EVENT_ISHIHARA_TRADE_STATE + flag_def $06, %11110000 ; EVENT_PUPIL_JESSICA_STATE + flag_def $06, %00001100 ; EVENT_LAD2_STATE + flag_def $06, %00000010 ; EVENT_RECEIVED_LEGENDARY_CARDS + flag_def $06, %00000001 ; EVENT_KEN_HAD_ENOUGH_CARDS + flag_def $07, %11000000 ; EVENT_KEN_TALKED + flag_def $07, %00100000 ; EVENT_BEAT_JENNIFER + flag_def $07, %00010000 ; EVENT_BEAT_NICHOLAS + flag_def $07, %00001000 ; EVENT_BEAT_BRANDON + flag_def $07, %00000100 ; EVENT_ISAAC_TALKED + flag_def $07, %00000010 ; EVENT_MAN1_TALKED + flag_def $07, %00000001 ; EVENT_MAN1_WAITING_FOR_CARD + flag_def $08, %11111111 ; EVENT_MAN1_REQUESTED_CARD_ID + flag_def $09, %11100000 ; EVENT_MAN1_GIFT_SEQUENCE_STATE + flag_def $09, %00011111 ; EVENT_MAN1_GIFTED_CARD_FLAGS flag_def $0a, %11110000 ; EVENT_MEDAL_COUNT - flag_def $0a, %00001000 ; EVENT_FLAG_2F - flag_def $0a, %00000100 ; EVENT_FLAG_30 - flag_def $0a, %00000011 ; EVENT_FLAG_31 - flag_def $0b, %10000000 ; EVENT_FLAG_32 + flag_def $0a, %00001000 ; EVENT_DANIEL_TALKED + flag_def $0a, %00000100 ; EVENT_MURRAY_TALKED + flag_def $0a, %00000011 ; EVENT_PAPPY1_STATE + flag_def $0b, %10000000 ; EVENT_RONALD_PSYCHIC_CLUB_LOBBY_ENCOUNTER flag_def $0b, %01110000 ; EVENT_JOSHUA_STATE flag_def $0b, %00001100 ; EVENT_IMAKUNI_ROOM - flag_def $0b, %00000011 ; EVENT_FLAG_35 + flag_def $0b, %00000011 ; EVENT_NIKKI_STATE flag_def $0c, %11100000 ; EVENT_IMAKUNI_WIN_COUNT - flag_def $0c, %00011100 ; EVENT_FLAG_37 - flag_def $0c, %00000010 ; EVENT_FLAG_38 - flag_def $0c, %00000001 ; EVENT_FLAG_39 - flag_def $0d, %10000000 ; EVENT_FLAG_3A - flag_def $0d, %01000000 ; EVENT_FLAG_3B - flag_def $0d, %00100000 ; FLAG_BEAT_BRITTANY - flag_def $0d, %00010000 ; EVENT_FLAG_3D - flag_def $0d, %00001110 ; EVENT_FLAG_3E - flag_def $0e, %11100000 ; EVENT_FLAG_3F - flag_def $0e, %00011100 ; EVENT_FLAG_40 - flag_def $0f, %11100000 ; EVENT_FLAG_41 - flag_def $10, %10000000 ; EVENT_FLAG_42 - flag_def $10, %01000000 ; EVENT_FLAG_43 - flag_def $10, %00110000 ; EVENT_FLAG_44 - flag_def $10, %00001100 ; EVENT_FLAG_45 - flag_def $10, %00000010 ; EVENT_FLAG_46 - flag_def $10, %00000001 ; EVENT_FLAG_47 - flag_def $11, %11100000 ; EVENT_FLAG_48 - flag_def $11, %00011100 ; EVENT_FLAG_49 - flag_def $12, %11100000 ; EVENT_FLAG_4A - flag_def $13, %10000000 ; EVENT_FLAG_4B - flag_def $13, %01100000 ; EVENT_FLAG_4C - flag_def $13, %00011000 ; EVENT_FLAG_4D - flag_def $13, %00000100 ; EVENT_FLAG_4E - flag_def $13, %00000010 ; EVENT_FLAG_4F - flag_def $14, %10000000 ; EVENT_FLAG_50 - flag_def $14, %01000000 ; EVENT_FLAG_51 - flag_def $14, %00100000 ; EVENT_FLAG_52 - flag_def $14, %00010000 ; EVENT_FLAG_53 - flag_def $14, %00001000 ; EVENT_FLAG_54 - flag_def $14, %00000100 ; EVENT_FLAG_55 - flag_def $14, %00000010 ; EVENT_FLAG_56 - flag_def $14, %00000001 ; EVENT_FLAG_57 - flag_def $15, %11110000 ; EVENT_FLAG_58 - flag_def $15, %00001000 ; EVENT_FLAG_59 - flag_def $16, %10000000 ; EVENT_FLAG_5A - flag_def $16, %01000000 ; EVENT_FLAG_5B - flag_def $16, %00100000 ; EVENT_FLAG_5C - flag_def $16, %00010000 ; EVENT_FLAG_5D - flag_def $16, %00001000 ; EVENT_FLAG_5E - flag_def $16, %00000100 ; EVENT_FLAG_5F - flag_def $16, %00000010 ; EVENT_FLAG_60 - flag_def $16, %00000001 ; EVENT_FLAG_61 - flag_def $16, %11111111 ; EVENT_FLAG_62 - flag_def $17, %10000000 ; EVENT_FLAG_63 - flag_def $17, %01000000 ; EVENT_FLAG_64 - flag_def $17, %00110000 ; EVENT_FLAG_65 - flag_def $17, %00001000 ; EVENT_FLAG_66 - flag_def $17, %00000100 ; EVENT_FLAG_67 - flag_def $18, %11000000 ; EVENT_FLAG_68 - flag_def $18, %00110000 ; EVENT_FLAG_69 - flag_def $18, %00001100 ; EVENT_FLAG_6A - flag_def $18, %00000011 ; EVENT_FLAG_6B - flag_def $19, %11000000 ; EVENT_FLAG_6C - flag_def $19, %00100000 ; EVENT_FLAG_6D - flag_def $19, %00010000 ; EVENT_FLAG_6E - flag_def $19, %00001000 ; EVENT_FLAG_6F - flag_def $19, %00000100 ; EVENT_FLAG_70 - flag_def $19, %00111100 ; EVENT_FLAG_71 - flag_def $1a, %11111100 ; EVENT_FLAG_72 - flag_def $1a, %00000011 ; EVENT_FLAG_73 - flag_def $1b, %11111111 ; EVENT_FLAG_74 - flag_def $1c, %11110000 ; EVENT_FLAG_75 - flag_def $1c, %00001111 ; EVENT_FLAG_76 + flag_def $0c, %00011100 ; EVENT_LASS2_TRADE_STATE + flag_def $0c, %00000010 ; EVENT_ISHIHARA_WANTS_TO_TRADE + flag_def $0c, %00000001 ; EVENT_ISHIHARA_CONGRATULATED_PLAYER + flag_def $0d, %10000000 ; EVENT_BEAT_KRISTIN + flag_def $0d, %01000000 ; EVENT_BEAT_HEATHER + flag_def $0d, %00100000 ; EVENT_BEAT_BRITTANY + flag_def $0d, %00010000 ; EVENT_DRMASON_CONGRATULATED_PLAYER + flag_def $0d, %00001110 ; EVENT_MASON_LAB_STATE + flag_def $0e, %11100000 ; EVENT_CHALLENGE_CUP_1_STATE + flag_def $0e, %00011100 ; EVENT_CHALLENGE_CUP_2_STATE + flag_def $0f, %11100000 ; EVENT_CHALLENGE_CUP_3_STATE + flag_def $10, %10000000 ; EVENT_CHALLENGE_CUP_STARTING + flag_def $10, %01000000 ; EVENT_CHALLENGE_CUP_STAGE_VISITED + flag_def $10, %00110000 ; EVENT_CHALLENGE_CUP_NUMBER + flag_def $10, %00001100 ; EVENT_CHALLENGE_CUP_OPPONENT_NUMBER + flag_def $10, %00000010 ; EVENT_CHALLENGE_CUP_OPPONENT_CHOSEN + flag_def $10, %00000001 ; EVENT_CHALLENGE_CUP_IN_MENU + flag_def $11, %11100000 ; EVENT_CHALLENGE_CUP_1_RESULT + flag_def $11, %00011100 ; EVENT_CHALLENGE_CUP_2_RESULT + flag_def $12, %11100000 ; EVENT_CHALLENGE_CUP_3_RESULT + flag_def $13, %10000000 ; EVENT_RONALD_FIRST_CLUB_ENTRANCE_ENCOUNTER + flag_def $13, %01100000 ; EVENT_RONALD_FIRST_DUEL_STATE + flag_def $13, %00011000 ; EVENT_RONALD_SECOND_DUEL_STATE + flag_def $13, %00000100 ; EVENT_RONALD_TALKED + flag_def $13, %00000010 ; EVENT_RONALD_POKEMON_DOME_ENTRANCE_ENCOUNTER + flag_def $14, %10000000 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_1 + flag_def $14, %01000000 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_2 + flag_def $14, %00100000 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_3 + flag_def $14, %00010000 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_4 + flag_def $14, %00001000 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_5 + flag_def $14, %00000100 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_6 + flag_def $14, %00000010 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_7 + flag_def $14, %00000001 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_8 + flag_def $15, %11110000 ; EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE + flag_def $15, %00001000 ; EVENT_PLAYER_ENTERED_CHALLENGE_CUP + flag_def $16, %10000000 ; EVENT_FIGHTING_DECK_MACHINE_ACTIVE + flag_def $16, %01000000 ; EVENT_ROCK_DECK_MACHINE_ACTIVE + flag_def $16, %00100000 ; EVENT_WATER_DECK_MACHINE_ACTIVE + flag_def $16, %00010000 ; EVENT_LIGHTNING_DECK_MACHINE_ACTIVE + flag_def $16, %00001000 ; EVENT_GRASS_DECK_MACHINE_ACTIVE + flag_def $16, %00000100 ; EVENT_PSYCHIC_DECK_MACHINE_ACTIVE + flag_def $16, %00000010 ; EVENT_SCIENCE_DECK_MACHINE_ACTIVE + flag_def $16, %00000001 ; EVENT_FIRE_DECK_MACHINE_ACTIVE + flag_def $16, %11111111 ; EVENT_ALL_DECK_MACHINE_FLAGS + flag_def $17, %10000000 ; EVENT_HALL_OF_HONOR_DOORS_OPEN + flag_def $17, %01000000 ; EVENT_CHALLENGED_GRAND_MASTERS + flag_def $17, %00110000 ; EVENT_POKEMON_DOME_STATE + flag_def $17, %00001000 ; EVENT_POKEMON_DOME_IN_MENU + flag_def $17, %00000100 ; EVENT_CHALLENGED_RONALD + flag_def $18, %11000000 ; EVENT_COURTNEY_STATE + flag_def $18, %00110000 ; EVENT_STEVE_STATE + flag_def $18, %00001100 ; EVENT_JACK_STATE + flag_def $18, %00000011 ; EVENT_ROD_STATE + flag_def $19, %11000000 ; EVENT_RONALD_POKEMON_DOME_STATE + flag_def $19, %00100000 ; EVENT_RECEIVED_ZAPDOS + flag_def $19, %00010000 ; EVENT_RECEIVED_MOLTRES + flag_def $19, %00001000 ; EVENT_RECEIVED_ARTICUNO + flag_def $19, %00000100 ; EVENT_RECEIVED_DRAGONITE + flag_def $19, %00111100 ; EVENT_LEGENDARY_CARDS_RECEIVED_FLAGS + flag_def $1a, %11111100 ; EVENT_GIFT_CENTER_MENU_CHOICE + flag_def $1a, %00000011 ; EVENT_AARON_BOOSTER_REWARD + flag_def $1b, %11111111 ; EVENT_CONSOLE + flag_def $1c, %11110000 ; EVENT_SAM_TUTORIAL_MENU_CHOICE + flag_def $1c, %00001111 ; EVENT_AARON_DECK_MENU_CHOICE ; Used for basic level objects that just print text and quit PrintInteractableObjectText: ; cc25 (3:4c25) @@ -1753,14 +1912,14 @@ RST20: ; cc42 (3:4c42) ld a, l ld [wScriptPointer], a ld a, h - ld [wScriptPointer+1], a + ld [wScriptPointer + 1], a xor a ld [wBreakScriptLoop], a -.continueScriptLoop +.loop call RunOverworldScript ld a, [wBreakScriptLoop] ; if you break out, it jumps or a - jr z, .continueScriptLoop + jr z, .loop ld hl, wScriptPointer ld a, [hli] ld c, a @@ -1770,32 +1929,37 @@ RST20: ; cc42 (3:4c42) IncreaseScriptPointerBy1: ; cc60 (3:4c60) ld a, 1 jr IncreaseScriptPointer + IncreaseScriptPointerBy2: ; cc64 (3:4c64) ld a, 2 jr IncreaseScriptPointer + IncreaseScriptPointerBy4: ; cc68 (3:4c68) ld a, 4 jr IncreaseScriptPointer + IncreaseScriptPointerBy5: ; cc6c (3:4c6c) ld a, 5 jr IncreaseScriptPointer + IncreaseScriptPointerBy6: ; cc70 (3:4c70) ld a, 6 jr IncreaseScriptPointer + IncreaseScriptPointerBy7: ; cc74 (3:4c74) ld a, 7 jr IncreaseScriptPointer + IncreaseScriptPointerBy3: ; cc78 (3:4c78) ld a, 3 - IncreaseScriptPointer: ; cc7a (3:4c7a) ld c, a ld a, [wScriptPointer] add c ld [wScriptPointer], a - ld a, [wScriptPointer+1] + ld a, [wScriptPointer + 1] adc 0 - ld [wScriptPointer+1], a + ld [wScriptPointer + 1], a ret SetScriptPointer: ; cc8b (3:4c8b) @@ -1804,28 +1968,29 @@ SetScriptPointer: ; cc8b (3:4c8b) inc hl ld [hl], b ret -; 0xcc92 - INCROM $cc92, $cc96 +GetScriptArgs5AfterPointer: ; cc92 (3:4c92) + ld a, 5 + jr GetScriptArgsAfterPointer GetScriptArgs1AfterPointer: ; cc96 (3:4c96) - ld a, $1 + ld a, 1 jr GetScriptArgsAfterPointer GetScriptArgs2AfterPointer: ; cc9a (3:4c9a) - ld a, $2 + ld a, 2 jr GetScriptArgsAfterPointer -GetScriptArgs3AfterPointer: ; cc9e (3:4c9e) - ld a, $3 +GetScriptArgs3AfterPointer: ; cc9e (3:4c9e) + ld a, 3 GetScriptArgsAfterPointer: ; cca0 (3:4ca0) push hl ld l, a ld a, [wScriptPointer] add l ld l, a - ld a, [wScriptPointer+1] - adc $0 + ld a, [wScriptPointer + 1] + adc 0 ld h, a ld a, [hli] ld c, a @@ -1845,17 +2010,8 @@ SetScriptControlByteFail: ; ccb9 (3:4cb9) ret ; Exits Script mode and runs the next instruction like normal -ScriptCommand_EndScriptLoop1: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop2: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop3: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop4: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop5: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop6: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop7: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop8: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop9: ; ccbe (3:4cbe) -ScriptCommand_EndScriptLoop10: ; ccbe (3:4cbe) - ld a, $01 +ScriptCommand_EndScript: ; ccbe (3:4cbe) + ld a, TRUE ld [wBreakScriptLoop], a jp IncreaseScriptPointerBy1 @@ -1865,25 +2021,25 @@ ScriptCommand_CloseAdvancedTextBox: ; ccc6 (3:4cc6) ScriptCommand_QuitScriptFully: ; cccc (3:4ccc) call ScriptCommand_CloseAdvancedTextBox - call ScriptCommand_EndScriptLoop1 + call ScriptCommand_EndScript pop hl ret ; args: 2-Text String Index -ScriptCommand_PrintTextString: ; ccd4 (3:4cd4) +ScriptCommand_PrintNPCText: ; ccd4 (3:4cd4) ld l, c ld h, b call Func_cc32 jp IncreaseScriptPointerBy3 -Func_ccdc: ; ccdc (3:4cdc) +ScriptCommand_PrintText: ; ccdc (3:4cdc) ld l, c ld h, b call Func_c891 jp IncreaseScriptPointerBy3 ScriptCommand_AskQuestionJumpDefaultYes: ; cce4 (3:4ce4) - ld a, $1 + ld a, TRUE ld [wDefaultYesOrNo], a ; fallthrough @@ -1895,17 +2051,17 @@ ScriptCommand_AskQuestionJump: ; cce9 (3:4ce9) call Func_c8ed ld a, [hCurMenuItem] ld [wScriptControlByte], a - jr c, .asm_ccfe + jr c, .no_jump call GetScriptArgs3AfterPointer - jr z, .asm_ccfe + jr z, .no_jump jp SetScriptPointer -.asm_ccfe +.no_jump jp IncreaseScriptPointerBy5 ; args - prize cards, deck id, duel theme index -; sets a battle up, doesn't start until we break out of the script system. -ScriptCommand_StartBattle: ; cd01 (3:4d01) +; sets a duel up, doesn't start until we break out of the script system. +ScriptCommand_StartDuel: ; cd01 (3:4d01) call Func_cd66 ld a, [wScriptNPC] ld l, LOADED_NPC_ID @@ -1914,20 +2070,20 @@ ScriptCommand_StartBattle: ; cd01 (3:4d01) farcall Func_118d3 ld a, [wcc19] cp $ff - jr nz, .asm_cd26 + jr nz, .not_aaron_duel ld a, [wd695] ld c, a - ld b, $0 + ld b, 0 ld hl, AaronDeckIDs add hl, bc ld a, [hl] ld [wcc19], a -.asm_cd26 +.not_aaron_duel ld a, [wScriptNPC] ld l, LOADED_NPC_ID call GetItemInLoadedNPCIndex ld a, [hl] -asm_cd2f: +.start_duel ld [wd0c4], a ld [wcc14], a push af @@ -1941,14 +2097,14 @@ asm_cd2f: set 6, [hl] jp IncreaseScriptPointerBy4 -Func_cd4f: ; cd4f (3:4d4f) +ScriptCommand_StartChallengeHallDuel: ; cd4f (3:4d4f) call Func_cd66 ld a, [wd696] farcall Func_118bf - ld a, $16 + ld a, MUSIC_MATCH_START_2 ld [wMatchStartTheme], a ld a, [wd696] - jr asm_cd2f + jr ScriptCommand_StartDuel.start_duel AaronDeckIDs: ; cd63 (3:4d63) db LIGHTNING_AND_FIRE_DECK_ID @@ -1965,7 +2121,7 @@ Func_cd66: ; cd66 (3:4d66) ld [wDuelTheme], a ret -Func_cd76: ; cd76 (3:4d76) +ScriptCommand_BattleCenter: ; cd76 (3:4d76) ld a, GAME_EVENT_BATTLE_CENTER ld [wGameEvent], a ld hl, wd0b4 @@ -1973,22 +2129,21 @@ Func_cd76: ; cd76 (3:4d76) jp IncreaseScriptPointerBy1 ; prints text arg 1 or arg 2 depending on wScriptControlByte. -ScriptCommand_PrintVariableText: ; cd83 (3:4d83) +ScriptCommand_PrintVariableNPCText: ; cd83 (3:4d83) ld a, [wScriptControlByte] or a - jr nz, .printText + jr nz, .print_text call GetScriptArgs3AfterPointer -.printText +.print_text ld l, c ld h, b call Func_cc32 jp IncreaseScriptPointerBy5 -Func_cd94: ; cd94 (3:4d94) - get_flag_value EVENT_FLAG_44 -Unknown_cd98: +ScriptCommand_PrintTextForChallengeCup: ; cd94 (3:4d94) + get_flag_value EVENT_CHALLENGE_CUP_NUMBER dec a - and $3 + and %11 add a inc a call GetScriptArgsAfterPointer @@ -1997,12 +2152,12 @@ Unknown_cd98: call Func_cc32 jp IncreaseScriptPointerBy7 -Func_cda8: ; cda8 (3:4da8) +ScriptCommand_PrintVariableText: ; cda8 (3:4da8) ld a, [wScriptControlByte] or a - jr nz, .asm_cdb1 + jr nz, .print_text call GetScriptArgs3AfterPointer -.asm_cdb1 +.print_text ld l, c ld h, b call Func_c891 @@ -2014,20 +2169,20 @@ ScriptCommand_PrintTextQuitFully: ; cdb9 (3:4db9) ld h, b call Func_cc32 call CloseAdvancedDialogueBox - ld a, $1 + ld a, TRUE ld [wBreakScriptLoop], a call IncreaseScriptPointerBy3 pop hl ret -Func_cdcb: ; cdcb (3:4dcb) +ScriptCommand_UnloadActiveNPC: ; cdcb (3:4dcb) ld a, [wScriptNPC] ld [wLoadedNPCTempIndex], a Func_cdd1: ; cdd1 (3:4dd1) farcall Func_1c50a jp IncreaseScriptPointerBy1 -Func_cdd8: ; cdd8 (3:4dd8) +ScriptCommand_UnloadChallengeHallNPC: ; cdd8 (3:4dd8) ld a, [wLoadedNPCTempIndex] push af ld a, [wTempNPC] @@ -2042,7 +2197,7 @@ Func_cdd8: ; cdd8 (3:4dd8) ld [wLoadedNPCTempIndex], a ret -Func_cdf5: ; cdf5 (3:4df5) +ScriptCommand_SetChallengeHallNPCCoords: ; cdf5 (3:4df5) ld a, [wLoadedNPCTempIndex] push af ld a, [wTempNPC] @@ -2053,7 +2208,7 @@ Func_cdf5: ; cdf5 (3:4df5) ld [wLoadNPCXPos], a ld a, b ld [wLoadNPCYPos], a - ld a, $2 + ld a, SOUTH ld [wLoadNPCDirection], a ld a, [wTempNPC] farcall LoadNPCSpriteData @@ -2074,7 +2229,7 @@ ScriptCommand_MoveActiveNPCByDirection: ; ce26 (3:4e26) add c ld l, a ld a, b - adc $0 + adc 0 ld h, a ld c, [hl] inc hl @@ -2085,10 +2240,10 @@ ScriptCommand_MoveActiveNPCByDirection: ; ce26 (3:4e26) ; set bit 7 to only rotate the NPC ExecuteNPCMovement: ; ce3a (3:4e3a) farcall Func_1c78d -.asm_ce3e +.loop call DoFrameIfLCDEnabled farcall Func_1c7de - jr nz, .asm_ce3e + jr nz, .loop jp IncreaseScriptPointerBy3 ; Begin a series of NPC movements on the currently talking NPC @@ -2098,9 +2253,9 @@ ScriptCommand_MoveActiveNPC: ; ce4a (3:4e4a) ld [wLoadedNPCTempIndex], a jr ExecuteNPCMovement -; Begin a series of NPC movements on an arbitrary NPC +; Begin a series of NPC movements on the Challenge Hall opponent NPC ; based on the series of directions pointed to by bc -ScriptCommand_MoveWramNPC: ; ce52 (3:4e52) +ScriptCommand_MoveChallengeHallNPC: ; ce52 (3:4e52) ld a, [wLoadedNPCTempIndex] push af ld a, [wTempNPC] @@ -2153,14 +2308,14 @@ ScriptCommand_GiveBoosterPacks: ; ce8a (3:4e8a) pop bc ld a, b cp NO_BOOSTER - jr z, .asm_ceb4 + jr z, .done farcall BoosterPack_1031b call GetScriptArgs3AfterPointer ld a, c cp NO_BOOSTER - jr z, .asm_ceb4 + jr z, .done farcall BoosterPack_1031b -.asm_ceb4 +.done call Func_c2d4 jp IncreaseScriptPointerBy4 @@ -2169,7 +2324,7 @@ ScriptCommand_GiveOneOfEachTrainerBooster: ; ceba (3:4eba) ld [wd117], a call Func_c2a3 ld hl, .booster_type_table -.giveBoosterLoop +.loop ld a, [hl] cp NO_BOOSTER jr z, .done @@ -2179,7 +2334,7 @@ ScriptCommand_GiveOneOfEachTrainerBooster: ; ceba (3:4eba) ld [wd117], a pop hl inc hl - jr .giveBoosterLoop + jr .loop .done call Func_c2d4 jp IncreaseScriptPointerBy1 @@ -2192,17 +2347,17 @@ ScriptCommand_GiveOneOfEachTrainerBooster: ; ceba (3:4eba) db NO_BOOSTER ; $ff ; Shows the card received screen for a given promotional card -; arg can either be the card, $00 for a wram card, or $ff for the 4 legends +; arg can either be the card, $00 for a wram card, or $ff for the 4 legendary cards ScriptCommand_ShowCardReceivedScreen: ; cee2 (3:4ee2) call Func_c2a3 ld a, c cp $ff - jr z, .asm_cf09 + jr z, .legendary_card or a - jr nz, .asm_cef0 + jr nz, .show_card ld a, [wd697] -.asm_cef0 +.show_card push af farcall Func_10000 farcall Func_10031 @@ -2213,34 +2368,34 @@ ScriptCommand_ShowCardReceivedScreen: ; cee2 (3:4ee2) call Func_c2d4 jp IncreaseScriptPointerBy2 -.asm_cf09 +.legendary_card xor a - jr .asm_cef0 + jr .show_card ScriptCommand_JumpIfCardOwned: ; cf0c (3:4f0c) ld a, c call GetCardCountInCollectionAndDecks - jr asm_cf16 + jr ScriptCommand_JumpIfCardInCollection.count_check ScriptCommand_JumpIfCardInCollection: ; cf12 (3:4f12) ld a, c call GetCardCountInCollection -asm_cf16: +.count_check or a - jr nz, asm_cf1f + jr nz, .pass_try_jump -asm_cf19: +.fail call SetScriptControlByteFail jp IncreaseScriptPointerBy4 -asm_cf1f: +.pass_try_jump call SetScriptControlBytePass call GetScriptArgs2AfterPointer - jr z, asm_cf2a + jr z, .no_jump jp SetScriptPointer -asm_cf2a: +.no_jump jp IncreaseScriptPointerBy4 ScriptCommand_JumpIfEnoughCardsOwned: ; cf2d (3:4f2d) @@ -2250,22 +2405,22 @@ ScriptCommand_JumpIfEnoughCardsOwned: ; cf2d (3:4f2d) call GetAmountOfCardsOwned ld a, h cp b - jr nz, .asm_cf3b + jr nz, .high_byte_not_equal ld a, l cp c -.asm_cf3b - jr nc, asm_cf1f - jr asm_cf19 +.high_byte_not_equal + jr nc, ScriptCommand_JumpIfCardInCollection.pass_try_jump + jr ScriptCommand_JumpIfCardInCollection.fail ; Gives the first arg as a card. If that's 0 pulls from wd697 ScriptCommand_GiveCard: ; cf3f (3:4f3f) ld a, c or a - jr nz, .giveCard + jr nz, .give_card ld a, [wd697] -.giveCard +.give_card call AddCardToCollection jp IncreaseScriptPointerBy2 @@ -2274,140 +2429,143 @@ ScriptCommand_TakeCard: ; cf4c (3:4f4c) call RemoveCardFromCollection jp IncreaseScriptPointerBy2 -Func_cf53: ; cf53 (3:4f53) - ld c, $1 - ld b, $0 -.asm_cf57 +ScriptCommand_JumpIfAnyEnergyCardsInCollection: ; cf53 (3:4f53) + ld c, GRASS_ENERGY + ld b, 0 +.loop ld a, c call GetCardCountInCollection add b ld b, a inc c ld a, c - cp $8 - jr c, .asm_cf57 + cp DOUBLE_COLORLESS_ENERGY + 1 + jr c, .loop ld a, b or a - jr nz, Func_cf6d -Func_cf67: ; cf67 (3:4f67) + jr nz, .pass_try_jump + +.fail call SetScriptControlByteFail jp IncreaseScriptPointerBy3 -Func_cf6d: ; cf6d (3:4f6d) +.pass_try_jump call SetScriptControlBytePass call GetScriptArgs1AfterPointer - jr z, .asm_cf78 + jr z, .no_jump jp SetScriptPointer -.asm_cf78 +.no_jump jp IncreaseScriptPointerBy3 -Func_cf7b: ; cf7b (3:4f7b) - ld c, $1 -.asm_cf7d +ScriptCommand_RemoveAllEnergyCardsFromCollection: ; cf7b (3:4f7b) + ld c, GRASS_ENERGY +.next_energy push bc ld a, c call GetCardCountInCollection - jr c, .asm_cf8c + jr c, .no_energy ld b, a -.asm_cf85 +.remove_loop ld a, c call RemoveCardFromCollection dec b - jr nz, .asm_cf85 + jr nz, .remove_loop -.asm_cf8c +.no_energy pop bc inc c ld a, c - cp $8 - jr c, .asm_cf7d + cp DOUBLE_COLORLESS_ENERGY + 1 + jr c, .next_energy jp IncreaseScriptPointerBy1 ScriptCommand_JumpBasedOnFightingClubPupilStatus: ; cf96 (3:4f96) - ld c, $0 - get_flag_value EVENT_FLAG_11 + ld c, 0 + get_flag_value EVENT_PUPIL_MICHAEL_STATE or a - jr z, Func_cfc0 - cp a, $08 - jr c, .asm_cfa4 + jr z, .first_interaction + cp 8 + jr c, .pupil1_not_defeated inc c - -.asm_cfa4 - get_flag_value EVENT_FLAG_17 - cp $8 - jr c, .asm_cfad +.pupil1_not_defeated + get_flag_value EVENT_PUPIL_CHRIS_STATE + cp 8 + jr c, .pupil2_not_defeated inc c - -.asm_cfad - get_flag_value EVENT_FLAG_20 - cp a, $08 - jr c, .asm_cfb6 +.pupil2_not_defeated + get_flag_value EVENT_PUPIL_JESSICA_STATE + cp 8 + jr c, .pupil3_not_defeated inc c -.asm_cfb6 +.pupil3_not_defeated ld a, c rlca - add $3 + add 3 call GetScriptArgsAfterPointer jp SetScriptPointer -Func_cfc0: ; cfc0 (3:4fc0) +.first_interaction call GetScriptArgs1AfterPointer jp SetScriptPointer -Func_cfc6: ; cfc6 (3:4fc6) +ScriptCommand_SetActiveNPCDirection: ; cfc6 (3:4fc6) ld a, [wScriptNPC] ld [wLoadedNPCTempIndex], a ld a, c farcall Func_1c52e jp IncreaseScriptPointerBy2 -Func_cfd4: ; cfd4 (3:4fd4) - get_flag_value EVENT_FLAG_2D +ScriptCommand_PickNextMan1RequestedCard: ; cfd4 (3:4fd4) + get_flag_value EVENT_MAN1_GIFTED_CARD_FLAGS ld b, a -.asm_cfd9 - ld a, $5 +.choose_again + ld a, Man1RequestedCardsList.end - Man1RequestedCardsList call Random - ld e, $1 + ld e, 1 ld c, a push bc or a - jr z, .asm_cfea -.asm_cfe5 + jr z, .skip_shift +.shift_loop sla e dec c - jr nz, .asm_cfe5 - -.asm_cfea + jr nz, .shift_loop +.skip_shift ld a, e - and b + and b ; has this card already been chosed before? pop bc - jr nz, .asm_cfd9 + jr nz, .choose_again ld a, e or b push bc ld c, a - set_flag_value EVENT_FLAG_2D + set_flag_value EVENT_MAN1_GIFTED_CARD_FLAGS pop bc - ld b, $0 - ld hl, Data_d006 + ld b, 0 + ld hl, Man1RequestedCardsList add hl, bc ld c, [hl] - set_flag_value EVENT_FLAG_2B + set_flag_value EVENT_MAN1_REQUESTED_CARD_ID jp IncreaseScriptPointerBy1 -Data_d006: ; d006 (3:5006) - INCROM $d006, $d00b +Man1RequestedCardsList: ; d006 (3:5006) + db GRAVELER + db OMASTAR + db PARASECT + db RAPIDASH + db WEEZING +.end -Func_d00b: ; d00b (3:500b) +ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot: ; d00b (3:500b) sla c - ld b, $0 + ld b, 0 ld hl, wTxRam2 add hl, bc push hl - get_flag_value EVENT_FLAG_2B + get_flag_value EVENT_MAN1_REQUESTED_CARD_ID ld e, a - ld d, $0 + ld d, 0 call GetCardName pop hl ld [hl], e @@ -2415,20 +2573,20 @@ Func_d00b: ; d00b (3:500b) ld [hl], d jp IncreaseScriptPointerBy2 -Func_d025: ; d025 (3:5025) - get_flag_value EVENT_FLAG_2B +ScriptCommand_JumpIfMan1RequestedCardOwned: ; d025 (3:5025) + get_flag_value EVENT_MAN1_REQUESTED_CARD_ID call GetCardCountInCollectionAndDecks - jp c, Func_cf67 - jp Func_cf6d + jp c, ScriptCommand_JumpIfAnyEnergyCardsInCollection.fail + jp ScriptCommand_JumpIfAnyEnergyCardsInCollection.pass_try_jump -Func_d032: ; d032 (3:5032) - get_flag_value EVENT_FLAG_2B +ScriptCommand_JumpIfMan1RequestedCardInCollection: ; d032 (3:5032) + get_flag_value EVENT_MAN1_REQUESTED_CARD_ID call GetCardCountInCollection - jp c, Func_cf67 - jp Func_cf6d + jp c, ScriptCommand_JumpIfAnyEnergyCardsInCollection.fail + jp ScriptCommand_JumpIfAnyEnergyCardsInCollection.pass_try_jump -Func_d03f: ; d03f (3:503f) - get_flag_value EVENT_FLAG_2B +ScriptCommand_RemoveMan1RequestedCardFromCollection: ; d03f (3:503f) + get_flag_value EVENT_MAN1_REQUESTED_CARD_ID call RemoveCardFromCollection jp IncreaseScriptPointerBy1 @@ -2445,7 +2603,7 @@ ScriptCommand_SetPlayerDirection: ; d055 (3:5055) call UpdatePlayerDirection jp IncreaseScriptPointerBy2 -; arg1 - Direction (index in PlayerMovementOffsetTable) +; arg1 - Direction (index in PlayerMovementOffsetTable_Tiles) ; arg2 - Tiles Moves (Speed) ScriptCommand_MovePlayer: ; 505c (3:505c) ld a, c @@ -2453,13 +2611,13 @@ ScriptCommand_MovePlayer: ; 505c (3:505c) ld a, b ld [wd33a], a call StartScriptedMovement -.asm_d067 +.wait call DoFrameIfLCDEnabled call SetScreenScroll call Func_c53d ld a, [wPlayerCurrentlyMoving] and $03 - jr nz, .asm_d067 + jr nz, .wait call DoFrameIfLCDEnabled call SetScreenScroll jp IncreaseScriptPointerBy3 @@ -2476,7 +2634,7 @@ ScriptCommand_SetNextNPCAndScript: ; d088 (3:5088) call SetNextNPCAndScript jp IncreaseScriptPointerBy4 -Func_d095: ; d095 (3:5095) +ScriptCommand_SetSpriteAttributes: ; d095 (3:5095) ld a, [wScriptNPC] ld [wLoadedNPCTempIndex], a push bc @@ -2491,16 +2649,15 @@ Func_d095: ; d095 (3:5095) pop bc ld e, c ld a, [wConsole] - cp $2 - jr nz, .asm_d0b6 + cp CONSOLE_CGB + jr nz, .not_cgb ld e, b - -.asm_d0b6 +.not_cgb ld a, e farcall Func_1c57b jp IncreaseScriptPointerBy4 -Func_d0be: ; d0be (3:50be) +ScriptCommand_SetActiveNPCCoords: ; d0be (3:50be) ld a, [wScriptNPC] ld [wLoadedNPCTempIndex], a ld a, c @@ -2517,7 +2674,7 @@ ScriptCommand_DoFrames: ; d0ce (3:50ce) jr nz, ScriptCommand_DoFrames jp IncreaseScriptPointerBy2 -Func_d0d9: ; d0d9 (3:50d9) +ScriptCommand_JumpIfActiveNPCCoordsMatch: ; d0d9 (3:50d9) ld a, [wScriptNPC] ld [wLoadedNPCTempIndex], a ld d, c @@ -2525,22 +2682,22 @@ Func_d0d9: ; d0d9 (3:50d9) farcall Func_1c477 ld a, e cp c - jp nz, ScriptEventFailedNoJump + jp nz, ScriptCommand_JumpIfFlagEqual.fail ld a, d cp b - jp nz, ScriptEventFailedNoJump - jp ScriptEventPassedTryJump + jp nz, ScriptCommand_JumpIfFlagEqual.fail + jp ScriptCommand_JumpIfFlagEqual.pass_try_jump ScriptCommand_JumpIfPlayerCoordsMatch: ; d0f2 (3:50f2) ld a, [wPlayerXCoord] cp c - jp nz, ScriptEventFailedNoJump + jp nz, ScriptCommand_JumpIfFlagEqual.fail ld a, [wPlayerYCoord] cp b - jp nz, ScriptEventFailedNoJump - jp ScriptEventPassedTryJump + jp nz, ScriptCommand_JumpIfFlagEqual.fail + jp ScriptCommand_JumpIfFlagEqual.pass_try_jump -Func_d103: ; d103 (3:5103) +ScriptCommand_JumpIfNPCLoaded: ; d103 (3:5103) ld a, [wLoadedNPCTempIndex] push af ld a, [wTempNPC] @@ -2548,21 +2705,21 @@ Func_d103: ; d103 (3:5103) ld a, c ld [wTempNPC], a call FindLoadedNPC - jr c, .asm_d119 - call $54d1 - jr .asm_d11c + jr c, .not_loaded + call ScriptCommand_JumpIfFlagNonzero2.pass_try_jump + jr .done -.asm_d119 - call $54e6 +.not_loaded + call ScriptCommand_JumpIfFlagZero2.fail -.asm_d11c +.done pop af ld [wTempNPC], a pop af ld [wLoadedNPCTempIndex], a ret -Func_d125: ; d125 (3:5125) +ScriptCommand_ShowMedalReceivedScreen: ; d125 (3:5125) ld a, c push af call Func_c2a3 @@ -2571,17 +2728,17 @@ Func_d125: ; d125 (3:5125) call Func_c2d4 jp IncreaseScriptPointerBy2 -Func_d135: ; d135 (3:5135) +ScriptCommand_LoadCurrentMapNameIntoTxRamSlot: ; d135 (3:5135) sla c - ld b, $0 + ld b, 0 ld hl, wTxRam2 add hl, bc push hl ld a, [wd32e] rlca ld c, a - ld b, $0 - ld hl, $5151 + ld b, 0 + ld hl, MapNames - 2 add hl, bc ld e, [hl] inc hl @@ -2592,16 +2749,28 @@ Func_d135: ; d135 (3:5135) ld [hl], d jp IncreaseScriptPointerBy2 - INCROM $d153, $d16b - -Func_d16b: ; d16b (3:516b) +MapNames: ; d153 (3:5153) + tx MasonLaboratoryMapNameText + tx MrIshiharasHouseMapNameText + tx FightingClubMapNameText + tx RockClubMapNameText + tx WaterClubMapNameText + tx LightningClubMapNameText + tx GrassClubMapNameText + tx PsychicClubMapNameText + tx ScienceClubMapNameText + tx FireClubMapNameText + tx ChallengeHallMapNameText + tx PokemonDomeMapNameText + +ScriptCommand_LoadChallengeHallNPCIntoTxRamSlot: ; d16b (3:516b) ld hl, wCurrentNPCNameTx ld e, [hl] inc hl ld d, [hl] push de sla c - ld b, $0 + ld b, 0 ld hl, wTxRam2 add hl, bc push hl @@ -2610,7 +2779,7 @@ Func_d16b: ; d16b (3:516b) pop hl ld a, [wCurrentNPCNameTx] ld [hli], a - ld a, [wCurrentNPCNameTx+1] + ld a, [wCurrentNPCNameTx + 1] ld [hl], a pop de ld hl, wCurrentNPCNameTx @@ -2619,40 +2788,38 @@ Func_d16b: ; d16b (3:516b) ld [hl], d jp IncreaseScriptPointerBy2 -Func_d195: ; d195 (3:5195) +ScriptCommand_PickChallengeHallOpponent: ; d195 (3:5195) ld a, [wTempNPC] push af - get_flag_value EVENT_FLAG_45 + get_flag_value EVENT_CHALLENGE_CUP_OPPONENT_NUMBER inc a ld c, a - set_flag_value EVENT_FLAG_45 + set_flag_value EVENT_CHALLENGE_CUP_OPPONENT_NUMBER call Func_f580 pop af ld [wTempNPC], a jp IncreaseScriptPointerBy1 -Func_d1ad: ; d1ad (3:51ad) - call MainMenu_c75a +ScriptCommand_OpenMenu: ; d1ad (3:51ad) + call StartMenu jp IncreaseScriptPointerBy1 -Func_d1b3: ; d1b3 (3:51b3) - get_flag_value EVENT_FLAG_44 +ScriptCommand_PickChallengeCupPrizeCard: ; d1b3 (3:51b3) + get_flag_value EVENT_CHALLENGE_CUP_NUMBER dec a - cp $2 - jr c, .asm_d1c3 - ld a, $d + cp 2 + jr c, .first_or_second_cup + ld a, (ChallengeCupPrizeCards.end - ChallengeCupPrizeCards) / 3 - 2 call Random - add $2 -; fallthrough - -.asm_d1c3 - ld hl, $51dc -asm_d1c6: + add 2 +.first_or_second_cup + ld hl, ChallengeCupPrizeCards +.get_card_from_list ld e, a add a add e ld e, a - ld d, $0 + ld d, 0 add hl, de ld a, [hli] ld [wd697], a @@ -2662,55 +2829,102 @@ asm_d1c6: ld [wTxRam2 + 1], a jp IncreaseScriptPointerBy1 - INCROM $d1dc, $d209 +ChallengeCupPrizeCards: ; d1dc (3:51dc) + db MEWTWO2 + tx MewtwoTradeCardName + + db MEW1 + tx MewTradeCardName + + db ARCANINE1 + tx ArcanineTradeCardName + + db PIKACHU3 + tx PikachuTradeCardName + + db PIKACHU4 + tx PikachuTradeCardName + + db SURFING_PIKACHU1 + tx SurfingPikachuTradeCardName + + db SURFING_PIKACHU2 + tx SurfingPikachuTradeCardName + + db ELECTABUZZ1 + tx ElectabuzzTradeCardName + + db SLOWPOKE1 + tx SlowpokeTradeCardName + + db MEWTWO3 + tx MewtwoTradeCardName + + db MEWTWO2 + tx MewtwoTradeCardName -Func_d209: ; d209 (3:5209) - get_flag_value EVENT_FLAG_71 + db MEW1 + tx MewTradeCardName + + db JIGGLYPUFF1 + tx JigglypuffTradeCardName + + db SUPER_ENERGY_RETRIEVAL + tx SuperEnergyRetrievalTradeCardName + + db FLYING_PIKACHU + tx FlyingPikachuTradeCardName +.end + +ScriptCommand_PickLegendaryCard: ; d209 (3:5209) + get_flag_value EVENT_LEGENDARY_CARDS_RECEIVED_FLAGS ld e, a -.asm_d20e +.new_random call UpdateRNGSources - ld d, $8 - and $3 + ld d, %00001000 + and %11 ld c, a ld b, a -.asm_d217 - jr z, .asm_d21e +.loop + jr z, .done srl d dec b - jr .asm_d217 - -.asm_d21e + jr .loop +.done ld a, d - and e - jr nz, .asm_d20e + and e ; has this legendary been given already? + jr nz, .new_random push bc - ld b, $0 + ld b, 0 ld hl, Flags_d240 add hl, bc ld a, [hl] - call MaxOutEventFlag + call MaxOutEventFlag ; also modifies EVENT_LEGENDARY_CARDS_RECEIVED_FLAGS pop bc ld hl, LegendaryCards ld a, c - jr asm_d1c6 + jr ScriptCommand_PickChallengeCupPrizeCard.get_card_from_list LegendaryCards: ; d234 (3:5234) db ZAPDOS3 - tx Text03f0 + tx ZapdosLegendaryCardName + db MOLTRES2 - tx Text03f1 + tx MoltresLegendaryCardName + db ARTICUNO2 - tx Text03f2 + tx ArticunoLegendaryCardName + db DRAGONITE1 - tx Text03f3 + tx DragoniteLegendaryCardName Flags_d240: ; d240 (3:5240) - db EVENT_FLAG_6D - db EVENT_FLAG_6E - db EVENT_FLAG_6F - db EVENT_FLAG_70 + db EVENT_RECEIVED_ZAPDOS + db EVENT_RECEIVED_MOLTRES + db EVENT_RECEIVED_ARTICUNO + db EVENT_RECEIVED_DRAGONITE -Func_d244: ; d244 (3:5244) +ScriptCommand_ReplaceMapBlocks: ; d244 (3:5244) ld a, c farcall Func_80ba4 jp IncreaseScriptPointerBy2 @@ -2721,44 +2935,42 @@ ScriptCommand_ChooseDeckToDuelAgainstMultichoice: ; d24c (3:524c) call ShowMultichoiceTextbox ld a, [wMultichoiceTextboxResult_ChooseDeckToDuelAgainst] ld c, a - set_flag_value EVENT_FLAG_76 + set_flag_value EVENT_AARON_DECK_MENU_CHOICE jp IncreaseScriptPointerBy1 .multichoice_menu_args ; d25e dw NULL ; NPC title for textbox under menu - tx Text03f9 ; text for textbox under menu + tx SelectDeckToDuelText ; text for textbox under menu dw MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst ; location of table configuration in bank 4 db $03 ; the value to return when b is pressed dw wMultichoiceTextboxResult_ChooseDeckToDuelAgainst ; ram location to return result into dw .text_entries ; location of table containing text entries .text_entries ; d269 - tx Text03f6 - tx Text03f7 - tx Text03f8 + tx LightningAndFireDeckChoiceText + tx WaterAndFightingDeckChoiceText + tx GrassAndPsychicDeckChoiceText - INCROM $d26f, $d271 + dw NULL ScriptCommand_ChooseStarterDeckMultichoice: ; d271 (3:5271) ld hl, .multichoice_menu_args xor a call ShowMultichoiceTextbox jp IncreaseScriptPointerBy1 -; 0xd27b .multichoice_menu_args ; d27b dw NULL ; NPC title for textbox under menu - tx Text03fd ; text for textbox under menu + tx SelectDeckToTakeText ; text for textbox under menu dw MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck ; location of table configuration in bank 4 db $00 ; the value to return when b is pressed - dw $d693 ; ram location to return result into + dw wd693 ; ram location to return result into dw .text_entries ; location of table containing text entries .text_entries - tx Text03fa - tx Text03fb - tx Text03fc - + tx CharmanderAndFriendsDeckChoiceText + tx SquirtleAndFriendsDeckChoiceText + tx BulbasaurAndFriendsDeckChoiceText ; displays a textbox with multiple choices and a cursor. ; takes as an argument in h1 a pointer to a table @@ -2785,10 +2997,9 @@ ShowMultichoiceTextbox: ; d28c (3:528c) ld h, [hl] ld l, a or h - jr z, .asm_d2a8 + jr z, .no_text call Func_c8ba - -.asm_d2a8 +.no_text ld a, $1 call Func_c29b pop hl @@ -2805,27 +3016,27 @@ ShowMultichoiceTextbox: ; d28c (3:528c) ld [wd417], a push hl -.asm_d2c1 +.wait_input call DoFrameIfLCDEnabled call HandleMenuInput - jr nc, .asm_d2c1 + jr nc, .wait_input ld a, [hCurMenuItem] cp e - jr z, .asm_d2d9 + jr z, .got_result ld a, [wd417] or a - jr z, .asm_d2c1 + jr z, .wait_input ld e, a ld [hCurMenuItem], a -.asm_d2d9 +.got_result pop hl ld a, [hli] push hl ld h, [hl] ld l, a ld a, e - ld [hl], a + ld [hl], a ; store result add a ld c, a ld b, $0 @@ -2835,14 +3046,13 @@ ShowMultichoiceTextbox: ; d28c (3:528c) ld h, [hl] ld l, a or h - jr z, .asm_d2f5 + jr z, .no_text_2 add hl, bc ld a, [hli] ld [wTxRam2], a ld a, [hl] ld [wTxRam2 + 1], a - -.asm_d2f5 +.no_text_2 ret ScriptCommand_ShowSamNormalMultichoice: ; d2f6 (3:52f6) @@ -2851,15 +3061,14 @@ ScriptCommand_ShowSamNormalMultichoice: ; d2f6 (3:52f6) call ShowMultichoiceTextbox ld a, [wMultichoiceTextboxResult_Sam] ld c, a - set_flag_value EVENT_FLAG_75 + set_flag_value EVENT_SAM_TUTORIAL_MENU_CHOICE xor a ld [wMultichoiceTextboxResult_Sam], a jp IncreaseScriptPointerBy1 -; 0xd30c .multichoice_menu_args ; d30c tx SamNPCName ; NPC title for textbox under menu - tx Text03fe ; text for textbox under menu + tx HowCanIHelpText ; text for textbox under menu dw SamNormalMultichoice_ConfigurationTable ; location of table configuration in bank 4 db $03 ; the value to return when b is pressed dw wMultichoiceTextboxResult_Sam ; ram location to return result into @@ -2871,7 +3080,7 @@ ScriptCommand_ShowSamTutorialMultichoice: ; d317 (3:5317) call ShowMultichoiceTextbox ld a, [wMultichoiceTextboxResult_Sam] ld c, a - set_flag_value EVENT_FLAG_75 + set_flag_value EVENT_SAM_TUTORIAL_MENU_CHOICE jp IncreaseScriptPointerBy1 .multichoice_menu_args ; d32b (3:532b) @@ -2913,7 +3122,7 @@ ScriptCommand_OpenDeckMachine: ; d336 (3:5336) ScriptCommand_EnterMap: ; d36d (3:536d) ld a, [wScriptPointer] ld l, a - ld a, [wScriptPointer+1] + ld a, [wScriptPointer + 1] ld h, a inc hl ld a, [hli] @@ -2929,33 +3138,33 @@ ScriptCommand_EnterMap: ; d36d (3:536d) set 4, [hl] jp IncreaseScriptPointerBy6 -Func_d38f: ; d38f (3:538f) +ScriptCommand_FlashScreen: ; d38f (3:538f) farcall Func_10c96 jp IncreaseScriptPointerBy2 -Func_d396: ; d396 (3:5396) +ScriptCommand_SaveGame: ; d396 (3:5396) farcall Func_1157c jp IncreaseScriptPointerBy2 -Func_d39d: ; d39d (3:539d) +ScriptCommand_GiftCenter: ; d39d (3:539d) ld a, c or a - jr nz, .asm_d3ac + jr nz, .load_gift_center + ; show menu farcall Func_10dba ld c, a - set_flag_value EVENT_FLAG_72 - jr .asm_d3b6 + set_flag_value EVENT_GIFT_CENTER_MENU_CHOICE + jr .done -.asm_d3ac +.load_gift_center ld a, GAME_EVENT_GIFT_CENTER ld [wGameEvent], a ld hl, wd0b4 set 6, [hl] - -.asm_d3b6 +.done jp IncreaseScriptPointerBy2 -Func_d3b9: ; d3b9 (3:53b9) +ScriptCommand_PlayCredits: ; d3b9 (3:53b9) call Func_3917 ld a, GAME_EVENT_CREDITS ld [wGameEvent], a @@ -2971,14 +3180,15 @@ ScriptCommand_TryGivePCPack: ; d3c9 (3:53c9) ScriptCommand_nop: ; d3d1 (3:53d1) jp IncreaseScriptPointerBy1 -Func_d3d4: ; d3d4 (3:53d4) +ScriptCommand_GiveStarterDeck: ; d3d4 (3:53d4) ld a, [wd693] bank1call Func_7576 jp IncreaseScriptPointerBy1 - INCROM $d3dd, $d3e0 +Unknown_d3dd: ; d3dd (3:53dd) + db $03, $05, $07 -Func_d3e0: ; d3e0 (3:53e0) +ScriptCommand_WalkPlayerToMasonLaboratory: ; d3e0 (3:53e0) ld a, $1 ld [wd32e], a farcall Func_11024 @@ -2991,20 +3201,20 @@ Func_d3e0: ; d3e0 (3:53e0) farcall Func_10f2e jp IncreaseScriptPointerBy1 -Func_d3fe: ; d3fe (3:53fe) +ScriptCommand_OverrideSong: ; d3fe (3:53fe) ld a, c ld [wd112], a call PlaySong jp IncreaseScriptPointerBy2 -Func_d408: ; d408 (3:5408) +ScriptCommand_SetDefaultSong: ; d408 (3:5408) ld a, c ld [wd111], a jp IncreaseScriptPointerBy2 -Func_d40f: ; d40f (3:540f) +ScriptCommand_PlaySong: ; d40f (3:540f) ld a, c - call CallPlaySong + call ScriptPlaySong jp IncreaseScriptPointerBy2 ScriptCommand_PlaySFX: ; d416 (3:5416) @@ -3012,7 +3222,7 @@ ScriptCommand_PlaySFX: ; d416 (3:5416) call PlaySFX jp IncreaseScriptPointerBy2 -Func_d41d: ; d41d (3:541d) +ScriptCommand_PlayDefaultSong: ; d41d (3:541d) call Func_39fc jp IncreaseScriptPointerBy1 @@ -3028,12 +3238,12 @@ ScriptCommand_WaitForSongToFinish: ; d42f (3:542f) call WaitForSongToFinish jp IncreaseScriptPointerBy1 -Func_d435: ; d435 (3:5435) +ScriptCommand_RecordMasterWin: ; d435 (3:5435) ld a, c farcall Func_1c83d jp IncreaseScriptPointerBy2 -Func_d43d: ; d43d (3:543d) +ScriptCommand_ChallengeMachine: ; d43d (3:543d) ld a, GAME_EVENT_CHALLENGE_MACHINE ld [wGameEvent], a ld hl, wd0b4 @@ -3061,64 +3271,64 @@ ScriptCommand_JumpIfFlagZero1: ; d460 (3:5460) ld a, c call GetEventFlagValue or a - jr z, ScriptCommand_JumpIfFlagZero1.passTryJump + jr z, .pass_try_jump .fail call SetScriptControlByteFail jp IncreaseScriptPointerBy4 -.passTryJump +.pass_try_jump call SetScriptControlBytePass call GetScriptArgs2AfterPointer - jr z, .noJumpTarget + jr z, .no_jump jp SetScriptPointer -.noJumpTarget +.no_jump jp IncreaseScriptPointerBy4 ScriptCommand_JumpIfFlagNonzero1: ; d47b (3:547b) ld a, c call GetEventFlagValue or a - jr nz, ScriptCommand_JumpIfFlagZero1.passTryJump + jr nz, ScriptCommand_JumpIfFlagZero1.pass_try_jump jr ScriptCommand_JumpIfFlagZero1.fail ; args - event flag, value, jump address ScriptCommand_JumpIfFlagEqual: ; d484 (3:5484) call GetEventFlagValueBC cp c - jr z, ScriptEventPassedTryJump + jr z, .pass_try_jump -ScriptEventFailedNoJump: ; d48a (3:548a) +.fail call SetScriptControlByteFail jp IncreaseScriptPointerBy5 -ScriptEventPassedTryJump: ; d490 (3:5490) +.pass_try_jump call SetScriptControlBytePass call GetScriptArgs3AfterPointer - jr z, .noJumpAddress + jr z, .no_jump jp SetScriptPointer -.noJumpAddress +.no_jump jp IncreaseScriptPointerBy5 ScriptCommand_JumpIfFlagNotEqual: ; d49e (3:549e) call GetEventFlagValueBC cp c - jr nz, ScriptEventPassedTryJump - jr ScriptEventFailedNoJump + jr nz, ScriptCommand_JumpIfFlagEqual.pass_try_jump + jr ScriptCommand_JumpIfFlagEqual.fail ScriptCommand_JumpIfFlagNotLessThan: ; d4a6 (3:54a6) call GetEventFlagValueBC cp c - jr nc, ScriptEventPassedTryJump - jr ScriptEventFailedNoJump + jr nc, ScriptCommand_JumpIfFlagEqual.pass_try_jump + jr ScriptCommand_JumpIfFlagEqual.fail ScriptCommand_JumpIfFlagLessThan: ; d4ae (3:54ae) call GetEventFlagValueBC cp c - jr c, ScriptEventPassedTryJump - jr ScriptEventFailedNoJump + jr c, ScriptCommand_JumpIfFlagEqual.pass_try_jump + jr ScriptCommand_JumpIfFlagEqual.fail ; Gets event flag at c (Script defaults) ; c takes on the value of b as a side effect @@ -3144,19 +3354,20 @@ ScriptCommand_JumpIfFlagNonzero2: ; d4ca (3:54ca) or a jr z, ScriptCommand_JumpIfFlagZero2.fail -.passTryJump: +.pass_try_jump call SetScriptControlBytePass call GetScriptArgs2AfterPointer - jr z, .noJumpArgs + jr z, .no_jump jp SetScriptPointer -.noJumpArgs + +.no_jump jp IncreaseScriptPointerBy4 ScriptCommand_JumpIfFlagZero2: ; d4df (3:54df) ld a, c call GetEventFlagValue or a - jr z, ScriptCommand_JumpIfFlagNonzero2.passTryJump + jr z, ScriptCommand_JumpIfFlagNonzero2.pass_try_jump .fail call SetScriptControlByteFail @@ -3164,58 +3375,59 @@ ScriptCommand_JumpIfFlagZero2: ; d4df (3:54df) LoadOverworld: ; d4ec (3:54ec) call Func_d4fb - get_flag_value EVENT_FLAG_3E + get_flag_value EVENT_MASON_LAB_STATE or a ret nz ld bc, Script_BeginGame jp SetNextScript Func_d4fb: ; d4fb (3:54fb) - zero_flag_value EVENT_FLAG_59 + zero_flag_value EVENT_PLAYER_ENTERED_CHALLENGE_CUP call Func_f602 - get_flag_value EVENT_FLAG_3F + get_flag_value EVENT_CHALLENGE_CUP_1_STATE cp $02 jr z, .asm_d527 - get_flag_value EVENT_FLAG_40 + get_flag_value EVENT_CHALLENGE_CUP_2_STATE cp $02 jr z, .asm_d521 - get_flag_value EVENT_FLAG_41 + get_flag_value EVENT_CHALLENGE_CUP_3_STATE cp $02 jr z, .asm_d51b ret + .asm_d51b ld c, $07 - set_flag_value EVENT_FLAG_41 + set_flag_value EVENT_CHALLENGE_CUP_3_STATE .asm_d521 ld c, $07 - set_flag_value EVENT_FLAG_40 + set_flag_value EVENT_CHALLENGE_CUP_2_STATE .asm_d527 ld c, $07 - set_flag_value EVENT_FLAG_3F + set_flag_value EVENT_CHALLENGE_CUP_1_STATE ret Script_BeginGame: ; d52e (3:552e) start_script do_frames 60 - run_command Func_d3e0 + walk_player_to_mason_lab do_frames 120 enter_map $02, MASON_LABORATORY, 14, 26, NORTH quit_script_fully MasonLaboratoryAfterDuel: ; d53b (3:553b) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret .after_duel_table db NPC_SAM db NPC_SAM - dw $568a - dw $569f + dw Script_BeatSam + dw Script_LostToSam db $00 MasonLabLoadMap: ; d549 (3:5549) - get_flag_value EVENT_FLAG_3E + get_flag_value EVENT_MASON_LAB_STATE cp $03 ret nc ld a, NPC_DRMASON @@ -3231,7 +3443,7 @@ MasonLabCloseTextBox: ; d55e (3:555e) ; Lets you access the Challenge Machine if available MasonLabPressedA: ; d565 (3:5565) - get_flag_value EVENT_RECEIVED_LEGENDARY_CARD + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS or a ret z ld hl, ChallengeMachineObjectTable @@ -3247,31 +3459,264 @@ ChallengeMachineObjectTable: ; d572 (3:5572) Script_ChallengeMachine: ; d57d (3:557d) start_script - run_command Func_ccdc - tx Text05bd - run_command Func_d43d + print_text ItsTheChallengeMachineText + challenge_machine quit_script_fully Script_Tech1: ; d583 (3:5583) - INCROM $d583, $d5ca + lb bc, 0, EnergyCardList.end - EnergyCardList + ld hl, EnergyCardList +.count_loop + ld a, [hli] + call GetCardCountInCollection + add b + ld b, a + dec c + jr nz, .count_loop + ld a, b + cp 10 + jr c, .low_on_energies + + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Tech1MasterMedalExplanationText, Tech1AutoDeckMachineExplanationText + quit_script_fully + +.low_on_energies + ld c, EnergyCardList.end - EnergyCardList + ld hl, EnergyCardList +.next_energy_card + ld b, 10 + ld a, [hli] +.add_loop + push af + call AddCardToCollection + pop af + dec b + jr nz, .add_loop + dec c + jr nz, .next_energy_card + + start_script + print_npc_text Tech1FewEnergyCardsText + pause_song + play_song MUSIC_BOOSTER_PACK + print_npc_text Tech1ReceivedEnergyCardsText + wait_for_song_to_finish + resume_song + print_text_quit_fully Tech1GoodbyeText + +EnergyCardList: ; d5c4 (3:55c4) + db GRASS_ENERGY + db FIRE_ENERGY + db WATER_ENERGY + db LIGHTNING_ENERGY + db FIGHTING_ENERGY + db PSYCHIC_ENERGY +.end Script_Tech2: ; d5ca (3:55ca) - INCROM $d5ca, $d5d5 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Tech2LegendaryCardsExplanationText, Tech2LegendaryCardsCongratsText + quit_script_fully Script_Tech3: ; d5d5 (3:55d5) - INCROM $d5d5, $d5e0 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Tech3BoosterPackExplanationText, Tech3LegendaryCardsCongratsText + quit_script_fully Script_Tech4: ; d5e0 (3:55e0) - INCROM $d5e0, $d5f9 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Tech4ClubsExplanationText, Tech4DefeatedTheGrandMastersText + quit_script_fully + +Preload_Tech5: ; d5eb (3:55eb) + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + or a + jr z, .skip + ld hl, wLoadNPCXPos + inc [hl] + inc [hl] +.skip + scf + ret Script_Tech5: ; d5f9 (3:55f9) - INCROM $d5f9, $d61d + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Tech5DiaryAndEmailExplanationText, Tech5ChallengeMachineExplanationText + quit_script_fully + +Preload_Sam: ; d604 (3:5604) + get_flag_value EVENT_MASON_LAB_STATE + cp $01 + jr nc, .skip + ld a, $0a + ld [wLoadNPCXPos], a + ld a, $08 + ld [wLoadNPCYPos], a + ld a, SOUTH + ld [wLoadNPCDirection], a +.skip + scf + ret Script_Sam: ; d61d (3:561d) - INCROM $d61d, $d727 + start_script + show_sam_normal_multichoice + close_text_box + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $00, .ows_d63b + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $02, Script_LostToSam.ows_d6b0 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $03, .ows_d637 + print_npc_text Text05cb + ask_question_jump Text05cc, .ows_d647 +.ows_d637 + print_npc_text Text05cd + quit_script_fully + +.ows_d63b + print_npc_text Text05ce + ask_question_jump Text05cf, .ows_d647 + print_npc_text Text05d0 + quit_script_fully + +.ows_d647 + close_text_box + jump_if_player_coords_match 4, 12, .ows_above_sam + jump_if_player_coords_match 2, 14, .ows_left_of_sam +; ows_below_sam + set_player_direction WEST + move_player WEST, 1 + set_player_direction NORTH + move_player NORTH, 1 +.ows_left_of_sam + set_player_direction NORTH + move_player NORTH, 1 + set_player_direction EAST + move_player EAST, 1 +.ows_above_sam + set_player_direction EAST + move_player EAST, 1 + move_player EAST, 1 + move_player EAST, 1 + set_player_direction SOUTH + move_player SOUTH, 1 + set_player_direction WEST + move_active_npc NPCMovement_d889 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $00, .ows_d685 + start_duel PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +.ows_d685 + start_duel PRIZES_2, SAMS_NORMAL_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatSam: ; d68a (3:568a) + start_script + jump_if_flag_equal EVENT_MASON_LAB_STATE, $01, Script_EnterLabFirstTime.ows_d82d + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $01, Script_LostToSam.ows_d6ad + print_npc_text Text05d1 + give_booster_packs BOOSTER_ENERGY_RANDOM, NO_BOOSTER, NO_BOOSTER + print_text_quit_fully Text05d2 + +Script_LostToSam: ; d69f (3:569f) + start_script + jump_if_flag_equal EVENT_MASON_LAB_STATE, $01, Script_EnterLabFirstTime.ows_d82d + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $01, .ows_d6ad + print_text_quit_fully Text05d3 + +.ows_d6ad + print_text_quit_fully Text05d4 + +.ows_d6b0 + print_npc_text Text05d5 +.ows_d6b3 + close_text_box + show_sam_tutorial_multichoice + close_text_box + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $07, Script_Sam.ows_d637 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $01, .ows_d6df + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $02, .ows_d6e5 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $03, .ows_d6eb + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $04, .ows_d6f1 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $05, .ows_d6f7 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $06, .ows_d6fd + print_npc_text Text05d6 + script_jump .ows_d6b3 + +.ows_d6df + print_npc_text Text05d7 + script_jump .ows_d6b3 + +.ows_d6e5 + print_npc_text Text05d8 + script_jump .ows_d6b3 + +.ows_d6eb + print_npc_text Text05d9 + script_jump .ows_d6b3 + +.ows_d6f1 + print_npc_text Text05da + script_jump .ows_d6b3 + +.ows_d6f7 + print_npc_text Text05db + script_jump .ows_d6b3 + +.ows_d6fd + print_npc_text Text05dc + script_jump .ows_d6b3 + +Func_d703: ; d703 (3:5703) + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + or a + ret z + ld a, $0a + farcall Func_80ba4 + ret + +Preload_DrMason: ; d710 (3:5710) + call Func_d703 + get_flag_value EVENT_MASON_LAB_STATE + cp $01 + jr nz, .asm_d725 + ld a, $06 + ld [wLoadNPCXPos], a + ld a, $0c + ld [wLoadNPCYPos], a +.asm_d725 + scf + ret Script_DrMason: ; d727 (3:5727) - INCROM $d727, $d753 + start_script + jump_if_flag_nonzero_2 EVENT_RONALD_FIRST_CLUB_ENTRANCE_ENCOUNTER, .ows_d72f + print_text_quit_fully Text05dd + +.ows_d72f + try_give_medal_pc_packs + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $02, .ows_d738 + print_text_quit_fully Text05de + +.ows_d738 + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $07, .ows_d740 + print_text_quit_fully Text05df + +.ows_d740 + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_d747 + print_text_quit_fully Text05e0 + +.ows_d747 + jump_if_flag_nonzero_2 EVENT_DRMASON_CONGRATULATED_PLAYER, .ows_d750 + max_out_flag_value EVENT_DRMASON_CONGRATULATED_PLAYER + print_text_quit_fully Text05e1 + +.ows_d750 + print_text_quit_fully Text05e2 Script_EnterLabFirstTime: ; d753 (3:5753) start_script @@ -3284,33 +3729,32 @@ Script_EnterLabFirstTime: ; d753 (3:5753) move_player NORTH, 2 move_player NORTH, 2 move_player NORTH, 2 - print_text_string Text05e3 + print_npc_text Text05e3 close_advanced_text_box - set_next_npc_and_script NPC_SAM, Script_d779 - end_script_loop + set_next_npc_and_script NPC_SAM, .ows_d779 + end_script ret -Script_d779: ; d779 (03:5779) +.ows_d779 start_script move_active_npc NPCMovement_d880 - print_text_string Text05e4 + print_npc_text Text05e4 set_dialog_npc NPC_DRMASON - print_text_string Text05e5 + print_npc_text Text05e5 close_text_box move_active_npc NPCMovement_d882 - run_command Func_cfc6 - db $01 + set_active_npc_direction EAST set_player_direction WEST close_advanced_text_box - set_next_npc_and_script NPC_DRMASON, Script_d794 - end_script_loop + set_next_npc_and_script NPC_DRMASON, .ows_d794 + end_script ret -Script_d794: ; d794 (3:5794) +.ows_d794 start_script move_active_npc NPCMovement_d88b do_frames 40 - print_text_string Text05e6 + print_npc_text Text05e6 close_text_box move_player WEST, 1 move_player WEST, 1 @@ -3320,75 +3764,77 @@ Script_d794: ; d794 (3:5794) move_player SOUTH, 1 set_player_direction WEST move_active_npc NPCMovement_d894 - print_text_string Text05e7 - set_dialog_npc $07 - print_text_string Text05e8 - + print_npc_text Text05e7 + set_dialog_npc NPC_SAM + print_npc_text Text05e8 .ows_d7bc close_text_box show_sam_tutorial_multichoice close_text_box - jump_if_flag_equal EVENT_FLAG_75, $07, .ows_d80c - jump_if_flag_equal EVENT_FLAG_75, $01, .ows_d7e8 - jump_if_flag_equal EVENT_FLAG_75, $02, .ows_d7ee - jump_if_flag_equal EVENT_FLAG_75, $03, .ows_d7f4 - jump_if_flag_equal EVENT_FLAG_75, $04, .ows_d7fa - jump_if_flag_equal EVENT_FLAG_75, $05, .ows_d800 - jump_if_flag_equal EVENT_FLAG_75, $06, .ows_d806 - print_text_string Text05d6 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $07, .ows_d80c + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $01, .ows_d7e8 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $02, .ows_d7ee + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $03, .ows_d7f4 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $04, .ows_d7fa + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $05, .ows_d800 + jump_if_flag_equal EVENT_SAM_TUTORIAL_MENU_CHOICE, $06, .ows_d806 + print_npc_text Text05d6 script_jump .ows_d7bc .ows_d7e8 - print_text_string Text05d7 + print_npc_text Text05d7 script_jump .ows_d7bc .ows_d7ee - print_text_string Text05d8 + print_npc_text Text05d8 script_jump .ows_d7bc .ows_d7f4 - print_text_string Text05d9 + print_npc_text Text05d9 script_jump .ows_d7bc .ows_d7fa - print_text_string Text05da + print_npc_text Text05da script_jump .ows_d7bc .ows_d800 - print_text_string Text05db + print_npc_text Text05db script_jump .ows_d7bc .ows_d806 - print_text_string Text05dc + print_npc_text Text05dc script_jump .ows_d7bc .ows_d80c - print_text_string Text05e9 + print_npc_text Text05e9 ask_question_jump_default_yes NULL, .ows_d817 script_jump .ows_d7bc .ows_d817 - set_dialog_npc $01 - print_text_string Text05ea + set_dialog_npc NPC_DRMASON + print_npc_text Text05ea script_nop - script_set_flag_value EVENT_FLAG_3E, $01 + script_set_flag_value EVENT_MASON_LAB_STATE, $01 close_advanced_text_box - set_next_npc_and_script NPC_SAM, Script_d827 - end_script_loop + set_next_npc_and_script NPC_SAM, .ows_d827 + end_script ret -Script_d827: ; d827 (3:5827) +.ows_d827 start_script - start_battle PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1 + start_duel PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1 quit_script_fully -; 0xd82d - INCROM $d82d, $d834 +.ows_d82d + close_advanced_text_box + set_next_npc_and_script NPC_DRMASON, Script_AfterPracticeDuel + end_script + ret -AfterTutorialBattleScript: ; d834 (3:5834) +Script_AfterPracticeDuel: ; d834 (3:5834) start_script - print_text_string Text05eb - print_text_string Text05ef + print_npc_text Text05eb + print_npc_text Text05ef close_text_box move_active_npc NPCMovement_d896 set_player_direction NORTH @@ -3399,33 +3845,30 @@ AfterTutorialBattleScript: ; d834 (3:5834) move_player EAST, 1 move_player EAST, 1 set_player_direction NORTH - print_text_string Text05f0 + print_npc_text Text05f0 close_text_box - run_command Func_ccdc - tx Text05f1 + print_text Text05f1 close_text_box - print_text_string Text05f2 + print_npc_text Text05f2 .ows_d85f - choose_starter_deck_multichoice + choose_starter_deck close_text_box ask_question_jump Text05f3, .ows_d869 script_jump .ows_d85f + .ows_d869 - print_text_string Text05f4 + print_npc_text Text05f4 close_text_box pause_song - run_command Func_d40f - try_give_medal_pc_packs - run_command Func_ccdc - tx Text05f5 + play_song MUSIC_BOOSTER_PACK + print_text Text05f5 wait_for_song_to_finish resume_song close_text_box - script_set_flag_value EVENT_FLAG_3E, $03 - run_command Func_d3d4 - print_text_string Text05f6 - run_command Func_d396 - db $00 + script_set_flag_value EVENT_MASON_LAB_STATE, $03 + give_stater_deck + print_npc_text Text05f6 + save_game $00 quit_script_fully NPCMovement_d880: ; d880 (3:5880) @@ -3440,6 +3883,7 @@ NPCMovement_d882: ; d882 (3:5882) db WEST db WEST db SOUTH +NPCMovement_d889: ; d889 (3:5889) db EAST | NO_MOVE db $ff @@ -3454,7 +3898,7 @@ NPCMovement_d88b: ; d88b (3:588b) db EAST | NO_MOVE db $ff -NPCMovement_d894: ; d894 (4:5894) +NPCMovement_d894: ; d894 (3:5894) db SOUTH | NO_MOVE db $ff @@ -3468,78 +3912,470 @@ NPCMovement_d896: ; d896 (3:5896) db EAST db SOUTH | NO_MOVE db $ff -; 0xd89f - INCROM $d89f, $d8bb +DeckMachineRoomAfterDuel: ; d89f (3:589f) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_AARON + db NPC_AARON + dw Script_BeatAaron + dw Script_LostToAaron + db $00 + +DeckMachineRoomCloseTextBox: ; d8ad (3:58ad) + ld a, $02 +.asm_d8af + push af + farcall Func_80b89 + pop af + inc a + cp $0a + jr c, .asm_d8af + ret Script_Tech6: ; d8bb (3:58bb) - INCROM $d8bb, $d8c6 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text05f7, Text05f8 + quit_script_fully Script_Tech7: ; d8c6 (3:58c6) - INCROM $d8c6, $d8d1 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text05f9, Text05fa + quit_script_fully Script_Tech8: ; d8d1 (3:58d1) - INCROM $d8d1, $d8dd + start_script + jump_if_flag_not_equal EVENT_ALL_DECK_MACHINE_FLAGS, $ff, NULL + print_variable_npc_text Text05fb, Text05fc + quit_script_fully Script_Aaron: ; d8dd (3:58dd) - INCROM $d8dd, $d932 + start_script + print_npc_text Text05fd + ask_question_jump Text05fe, .ows_d8e9 +.ows_d8e6 + print_text_quit_fully Text05ff + +.ows_d8e9 + print_npc_text Text0600 + choose_deck_to_duel_against + close_text_box + jump_if_flag_equal EVENT_AARON_DECK_MENU_CHOICE, $03, .ows_d8e6 + ask_question_jump Text0601, .ows_d8fb + script_jump .ows_d8e6 + +.ows_d8fb + print_npc_text Text0602 + start_duel PRIZES_4, $ff, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatAaron: ; d903 (3:5903) + ld a, [wMultichoiceTextboxResult_ChooseDeckToDuelAgainst] + ld c, a + set_flag_value EVENT_AARON_BOOSTER_REWARD + + start_script + print_npc_text Text0603 + jump_if_flag_equal EVENT_AARON_BOOSTER_REWARD, $01, .ows_d920 + jump_if_flag_equal EVENT_AARON_BOOSTER_REWARD, $02, .ows_d927 + give_booster_packs BOOSTER_ENERGY_RANDOM, NO_BOOSTER, NO_BOOSTER + script_jump Script_LostToAaron.ows_d92f + +.ows_d920 + give_booster_packs BOOSTER_ENERGY_RANDOM, NO_BOOSTER, NO_BOOSTER + script_jump Script_LostToAaron.ows_d92f + +.ows_d927 + give_booster_packs BOOSTER_ENERGY_RANDOM, NO_BOOSTER, NO_BOOSTER + script_jump Script_LostToAaron.ows_d92f + +Script_LostToAaron: ; d92e (3:592e) + start_script +.ows_d92f + print_text_quit_fully Text0604 Script_d932: ; d932 (3:5932) start_script - run_command Func_ccdc - tx Text0605 + print_text Text0605 ask_question_jump_default_yes Text0606, .ows_d93c quit_script_fully .ows_d93c open_deck_machine $09 quit_script_fully -; 0xd93f - INCROM $d93f, $dadd +Script_d93f: ; d93f (3:593f) + ld a, $02 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_FIGHTING_DECK_MACHINE_ACTIVE, .ows_d963 + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_MITCH, .ows_d954 + quit_script_fully + +.ows_d954 + ask_question_jump_default_yes Text0609, .ows_d95a + quit_script_fully + +.ows_d95a + play_sfx SFX_5A + max_out_flag_value EVENT_FIGHTING_DECK_MACHINE_ACTIVE + replace_map_blocks $02 + print_text Text060a +.ows_d963 + ask_question_jump_default_yes Text060b, .ows_d969 + quit_script_fully + +.ows_d969 + open_deck_machine $01 + quit_script_fully + +Func_d96c: ; d96c (3:596c) + sub $02 + add a + ld c, a + ld b, $00 + ld hl, ClubMapNames + add hl, bc + ld a, [hli] + ld [wTxRam2], a + ld [wTxRam2_b], a + ld a, [hl] + ld [wTxRam2 + 1], a + ld [wTxRam2_b + 1], a + ret + +ClubMapNames: ; d985 (3:5985) + tx FightingClubMapNameText + tx RockClubMapNameText + tx WaterClubMapNameText + tx LightningClubMapNameText + tx GrassClubMapNameText + tx PsychicClubMapNameText + tx ScienceClubMapNameText + tx FireClubMapNameText + +Script_d995: ; d995 (3:5995) + ld a, $03 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_ROCK_DECK_MACHINE_ACTIVE, .ows_d9b9 + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_GENE, .ows_d9aa + quit_script_fully + +.ows_d9aa + ask_question_jump_default_yes Text0609, .ows_d9b0 + quit_script_fully + +.ows_d9b0 + play_sfx SFX_5A + max_out_flag_value EVENT_ROCK_DECK_MACHINE_ACTIVE + replace_map_blocks $03 + print_text Text060a +.ows_d9b9 + ask_question_jump_default_yes Text060b, .ows_d9bf + quit_script_fully + +.ows_d9bf + open_deck_machine $02 + quit_script_fully + +Script_d9c2: ; d9c2 (3:59c2) + ld a, $04 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_WATER_DECK_MACHINE_ACTIVE, .ows_d9e6 + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_AMY, .ows_d9d7 + quit_script_fully + +.ows_d9d7 + ask_question_jump_default_yes Text0609, .ows_d9dd + quit_script_fully + +.ows_d9dd + play_sfx SFX_5A + max_out_flag_value EVENT_WATER_DECK_MACHINE_ACTIVE + replace_map_blocks $04 + print_text Text060a +.ows_d9e6 + ask_question_jump_default_yes Text060b, .ows_d9ec + quit_script_fully + +.ows_d9ec + open_deck_machine $03 + quit_script_fully + +Script_d9ef: ; d9ef (3:59ef) + ld a, $05 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_LIGHTNING_DECK_MACHINE_ACTIVE, .ows_da13 + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_ISAAC, .ows_da04 + quit_script_fully + +.ows_da04 + ask_question_jump_default_yes Text0609, .ows_da0a + quit_script_fully + +.ows_da0a + play_sfx SFX_5A + max_out_flag_value EVENT_LIGHTNING_DECK_MACHINE_ACTIVE + replace_map_blocks $05 + print_text Text060a +.ows_da13 + ask_question_jump_default_yes Text060b, .ows_da19 + quit_script_fully + +.ows_da19 + open_deck_machine $04 + quit_script_fully + +Script_da1c: ; da1c (3:5a1c) + ld a, $06 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_GRASS_DECK_MACHINE_ACTIVE, .ows_da40 + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_NIKKI, .ows_da31 + quit_script_fully + +.ows_da31 + ask_question_jump_default_yes Text0609, .ows_da37 + quit_script_fully + +.ows_da37 + play_sfx SFX_5A + max_out_flag_value EVENT_GRASS_DECK_MACHINE_ACTIVE + replace_map_blocks $06 + print_text Text060a +.ows_da40 + ask_question_jump_default_yes Text060b, .ows_da46 + quit_script_fully + +.ows_da46 + open_deck_machine $05 + quit_script_fully + +Script_da49: ; da49 (3:5a49) + ld a, $07 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_PSYCHIC_DECK_MACHINE_ACTIVE, .ows_da6d + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_MURRAY, .ows_da5e + quit_script_fully + +.ows_da5e + ask_question_jump_default_yes Text0609, .ows_da64 + quit_script_fully + +.ows_da64 + play_sfx SFX_5A + max_out_flag_value EVENT_PSYCHIC_DECK_MACHINE_ACTIVE + replace_map_blocks $07 + print_text Text060a +.ows_da6d + ask_question_jump_default_yes Text060b, .ows_da73 + quit_script_fully + +.ows_da73 + open_deck_machine $06 + quit_script_fully + +Script_da76: ; da76 (3:5a76) + ld a, $08 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_SCIENCE_DECK_MACHINE_ACTIVE, .ows_da9a + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_RICK, .ows_da8b + quit_script_fully + +.ows_da8b + ask_question_jump_default_yes Text0609, .ows_da91 + quit_script_fully + +.ows_da91 + play_sfx SFX_5A + max_out_flag_value EVENT_SCIENCE_DECK_MACHINE_ACTIVE + replace_map_blocks $08 + print_text Text060a +.ows_da9a + ask_question_jump_default_yes Text060b, .ows_daa0 + quit_script_fully + +.ows_daa0 + open_deck_machine $07 + quit_script_fully + +Script_daa3: ; daa3 (3:5aa3) + ld a, $09 + call Func_d96c + + start_script + print_text Text0607 + jump_if_flag_nonzero_2 EVENT_FIRE_DECK_MACHINE_ACTIVE, .ows_dac7 + print_text Text0608 + jump_if_flag_nonzero_2 EVENT_BEAT_KEN, .ows_dab8 + quit_script_fully + +.ows_dab8 + ask_question_jump_default_yes Text0609, .ows_dabe + quit_script_fully + +.ows_dabe + play_sfx SFX_5A + max_out_flag_value EVENT_FIRE_DECK_MACHINE_ACTIVE + replace_map_blocks $09 + print_text Text060a +.ows_dac7 + ask_question_jump_default_yes Text060b, .ows_dacd + quit_script_fully + +.ows_dacd + open_deck_machine $08 + quit_script_fully + +Script_dad0: ; dad0 (3:5ad0) + start_script + print_text Text060c + ask_question_jump_default_yes Text060d, .ows_dada + quit_script_fully + +.ows_dada + open_deck_machine $00 + quit_script_fully Preload_NikkiInIshiharasHouse: ; dadd (3:5add) - get_flag_value EVENT_FLAG_35 + get_flag_value EVENT_NIKKI_STATE cp $01 - jr nz, .dontLoadNikki + jr nz, .dont_load scf ret -.dontLoadNikki +.dont_load or a ret -; 0xdae9 - INCROM $dae9, $db3d +Script_dae9: ; dae9 (3:5ae9) + start_script + print_npc_text Text0723 + script_set_flag_value EVENT_NIKKI_STATE, $02 + close_text_box + jump_if_npc_loaded NPC_ISHIHARA, .ows_dafb + move_active_npc_by_direction NPCMovementTable_db24 + script_jump .ows_db0f + +.ows_dafb + move_active_npc_by_direction NPCMovementTable_db11 + print_npc_text Text0724 + set_dialog_npc NPC_ISHIHARA + print_npc_text Text0725 + set_dialog_npc NPC_NIKKI + print_npc_text Text0726 + close_text_box + move_active_npc NPCMovement_db31 +.ows_db0f + unload_active_npc + quit_script_fully + +NPCMovementTable_db11: ; db11 (3:5b11) + dw NPCMovement_db19 + dw NPCMovement_db20 + dw NPCMovement_db19 + dw NPCMovement_db19 + +NPCMovement_db19: ; db19 (3:5b19) + db EAST + db SOUTH + db SOUTH + db SOUTH + db EAST + db NORTH | NO_MOVE + db $ff + +NPCMovement_db20: ; db20 (3:5b20) + db SOUTH + db EAST + db $fe, -8 + +NPCMovementTable_db24: ; db24 (3:5b24) + dw NPCMovement_db2c + dw NPCMovement_db39 + dw NPCMovement_db2c + dw NPCMovement_db2c + +NPCMovement_db2c: ; db2c (3:5b2c) + db EAST + db SOUTH + db SOUTH + db SOUTH + db EAST +NPCMovement_db31: ; db31 (3:5b31) + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db $ff + +NPCMovement_db39: ; db39 (3:5b39) + db SOUTH + db EAST + db $fe, -14 Preload_IshiharaInIshiharasHouse: ; db3d (3:5b3d) - get_flag_value EVENT_FLAG_1C + get_flag_value EVENT_ISHIHARA_MENTIONED or a ret z - get_flag_value EVENT_FLAG_1F + get_flag_value EVENT_ISHIHARA_TRADE_STATE cp $08 ret Script_Ishihara: ; db4a (3:5b4a) start_script - max_out_flag_value EVENT_FLAG_1D - jump_if_flag_equal EVENT_FLAG_1F, $00, .ows_db80 - jump_if_flag_nonzero_2 EVENT_FLAG_39, .ows_db5a - jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARD, .ows_dc3e + max_out_flag_value EVENT_ISHIHARA_MET + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $00, .ows_db80 + jump_if_flag_nonzero_2 EVENT_ISHIHARA_CONGRATULATED_PLAYER, .ows_db5a + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_dc3e .ows_db5a - jump_if_flag_nonzero_2 EVENT_FLAG_00, .ows_db90 - jump_if_flag_zero_2 EVENT_FLAG_38, .ows_db90 - jump_if_flag_equal EVENT_FLAG_1F, $01, .ows_db93 - jump_if_flag_equal EVENT_FLAG_1F, $02, .ows_db93 - jump_if_flag_equal EVENT_FLAG_1F, $03, .ows_dbcc - jump_if_flag_equal EVENT_FLAG_1F, $04, .ows_dbcc - jump_if_flag_equal EVENT_FLAG_1F, $05, .ows_dc05 - jump_if_flag_equal EVENT_FLAG_1F, $06, .ows_dc05 + jump_if_flag_nonzero_2 EVENT_TEMP_TRADED_WITH_ISHIHARA, .ows_db90 + jump_if_flag_zero_2 EVENT_ISHIHARA_WANTS_TO_TRADE, .ows_db90 + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $01, .ows_db93 + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $02, .ows_db93 + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $03, .ows_dbcc + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $04, .ows_dbcc + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $05, .ows_dc05 + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $06, .ows_dc05 .ows_db80 - max_out_flag_value EVENT_FLAG_00 - script_set_flag_value EVENT_FLAG_1F, $01 - zero_out_flag_value EVENT_FLAG_38 - jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, .ows_db8d - max_out_flag_value EVENT_FLAG_39 + max_out_flag_value EVENT_TEMP_TRADED_WITH_ISHIHARA + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $01 + zero_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_db8d + max_out_flag_value EVENT_ISHIHARA_CONGRATULATED_PLAYER .ows_db8d print_text_quit_fully Text0727 @@ -3547,104 +4383,101 @@ Script_Ishihara: ; db4a (3:5b4a) print_text_quit_fully Text0728 .ows_db93 - jump_if_flag_equal EVENT_FLAG_1F, $01, NULL - print_variable_text Text0729, Text072a - script_set_flag_value EVENT_FLAG_1F, $02 - ask_question_jump Text072b, .check_ifhave_clefable_incollectionordecks + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $01, NULL + print_variable_npc_text Text0729, Text072a + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $02 + ask_question_jump Text072b, .check_if_clefable_owned print_text_quit_fully Text072c -.check_ifhave_clefable_incollectionordecks - jump_if_card_owned CLEFABLE, .check_ifhave_clefable_incollectiononly +.check_if_clefable_owned + jump_if_card_owned CLEFABLE, .check_if_clefable_in_collection print_text_quit_fully Text072d -.check_ifhave_clefable_incollectiononly +.check_if_clefable_in_collection jump_if_card_in_collection CLEFABLE, .do_clefable_trade print_text_quit_fully Text072e .do_clefable_trade - max_out_flag_value EVENT_FLAG_00 - script_set_flag_value EVENT_FLAG_1F, $03 - zero_out_flag_value EVENT_FLAG_38 - print_text_string Text072f - run_command Func_ccdc - tx Text0730 + max_out_flag_value EVENT_TEMP_TRADED_WITH_ISHIHARA + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $03 + zero_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_npc_text Text072f + print_text Text0730 take_card CLEFABLE give_card SURFING_PIKACHU1 show_card_received_screen SURFING_PIKACHU1 print_text_quit_fully Text0731 .ows_dbcc - jump_if_flag_equal EVENT_FLAG_1F, $03, NULL - print_variable_text Text0732, Text0733 - script_set_flag_value EVENT_FLAG_1F, $04 - ask_question_jump Text072b, .check_ifhave_ditto_incollectionordecks + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $03, NULL + print_variable_npc_text Text0732, Text0733 + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $04 + ask_question_jump Text072b, .check_if_ditto_owned print_text_quit_fully Text072c -.check_ifhave_ditto_incollectionordecks - jump_if_card_owned DITTO, .check_ifhave_ditto_incollectiononly +.check_if_ditto_owned + jump_if_card_owned DITTO, .check_if_ditto_in_collection print_text_quit_fully Text0734 -.check_ifhave_ditto_incollectiononly +.check_if_ditto_in_collection jump_if_card_in_collection DITTO, .do_ditto_trade print_text_quit_fully Text0735 .do_ditto_trade - max_out_flag_value EVENT_FLAG_00 - script_set_flag_value EVENT_FLAG_1F, $05 - zero_out_flag_value EVENT_FLAG_38 - print_text_string Text072f - run_command Func_ccdc - tx Text0736 + max_out_flag_value EVENT_TEMP_TRADED_WITH_ISHIHARA + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $05 + zero_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_npc_text Text072f + print_text Text0736 take_card DITTO give_card FLYING_PIKACHU show_card_received_screen FLYING_PIKACHU print_text_quit_fully Text0737 .ows_dc05 - jump_if_flag_equal EVENT_FLAG_1F, $05, NULL - print_variable_text Text0738, Text0739 - script_set_flag_value EVENT_FLAG_1F, $06 - ask_question_jump Text072b, .check_ifhave_chansey_incollectionordecks + jump_if_flag_equal EVENT_ISHIHARA_TRADE_STATE, $05, NULL + print_variable_npc_text Text0738, Text0739 + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $06 + ask_question_jump Text072b, .check_if_chansey_owned print_text_quit_fully Text072c -.check_ifhave_chansey_incollectionordecks - jump_if_card_owned CHANSEY, .check_ifhave_chansey_incollectiononly +.check_if_chansey_owned + jump_if_card_owned CHANSEY, .check_if_chansey_in_collection print_text_quit_fully Text073a -.check_ifhave_chansey_incollectiononly +.check_if_chansey_in_collection jump_if_card_in_collection CHANSEY, .do_chansey_trade print_text_quit_fully Text073b .do_chansey_trade - max_out_flag_value EVENT_FLAG_00 - script_set_flag_value EVENT_FLAG_1F, $07 - zero_out_flag_value EVENT_FLAG_38 - print_text_string Text072f - run_command Func_ccdc - tx Text073c + max_out_flag_value EVENT_TEMP_TRADED_WITH_ISHIHARA + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $07 + zero_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_npc_text Text072f + print_text Text073c take_card CHANSEY give_card SURFING_PIKACHU2 show_card_received_screen SURFING_PIKACHU2 print_text_quit_fully Text073d .ows_dc3e - max_out_flag_value EVENT_FLAG_39 + max_out_flag_value EVENT_ISHIHARA_CONGRATULATED_PLAYER print_text_quit_fully Text073e Preload_Ronald1InIshiharasHouse: ; dc43 (3:5c43) - get_flag_value EVENT_RECEIVED_LEGENDARY_CARD + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS cp $01 ccf ret Script_Ronald: ; dc4b (3:5c4b) start_script - jump_if_flag_nonzero_2 EVENT_FLAG_4E, .ows_dc55 - max_out_flag_value EVENT_FLAG_4E + jump_if_flag_nonzero_2 EVENT_RONALD_TALKED, .ows_dc55 + max_out_flag_value EVENT_RONALD_TALKED print_text_quit_fully Text073f .ows_dc55 - print_text_string Text0740 + print_npc_text Text0740 ask_question_jump Text0741, .ows_dc60 print_text_quit_fully Text0742 @@ -3661,7 +4494,7 @@ Script_Clerk1: ; dc64 (3:5c64) FightingClubLobbyAfterDuel: ; dc68 (3:5c68) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret .after_duel_table @@ -3672,53 +4505,135 @@ FightingClubLobbyAfterDuel: ; dc68 (3:5c68) db $00 Script_Man1: ; dc76 (3:5c76) - INCROM $dc76, $dd0d + start_script + jump_if_flag_equal EVENT_MAN1_GIFT_SEQUENCE_STATE, $06, .ows_dce8 + jump_if_flag_nonzero_2 EVENT_TEMP_GIFTED_TO_MAN1, .ows_dce5 + jump_if_flag_nonzero_2 EVENT_MAN1_TALKED, .ows_dc91 + max_out_flag_value EVENT_MAN1_TALKED + pick_next_man1_requested_card + load_man1_requested_card_into_txram_slot $00 + print_npc_text Text045b + max_out_flag_value EVENT_MAN1_WAITING_FOR_CARD + script_jump .ows_dca5 + +.ows_dc91 + jump_if_flag_zero_2 EVENT_MAN1_WAITING_FOR_CARD, .ows_dc9d + load_man1_requested_card_into_txram_slot $00 + print_npc_text Text045c + script_jump .ows_dca5 + +.ows_dc9d + pick_next_man1_requested_card + load_man1_requested_card_into_txram_slot $00 + print_npc_text Text045d + max_out_flag_value EVENT_MAN1_WAITING_FOR_CARD +.ows_dca5 + load_man1_requested_card_into_txram_slot $00 + ask_question_jump Text045e, .ows_dcaf + print_text_quit_fully Text045f + +.ows_dcaf + jump_if_man1_requested_card_owned .ows_dcb9 + load_man1_requested_card_into_txram_slot $00 + load_man1_requested_card_into_txram_slot $01 + print_text_quit_fully Text0460 + +.ows_dcb9 + jump_if_man1_requested_card_in_collection .ows_dcc3 + load_man1_requested_card_into_txram_slot $00 + load_man1_requested_card_into_txram_slot $01 + print_text_quit_fully Text0461 + +.ows_dcc3 + load_man1_requested_card_into_txram_slot $00 + load_man1_requested_card_into_txram_slot $01 + print_npc_text Text0462 + remove_man1_requested_card_from_collection + max_out_flag_value EVENT_TEMP_GIFTED_TO_MAN1 + zero_out_flag_value EVENT_MAN1_WAITING_FOR_CARD + increment_flag_value EVENT_MAN1_GIFT_SEQUENCE_STATE + jump_if_flag_equal EVENT_MAN1_GIFT_SEQUENCE_STATE, $05, .ows_dcd7 + quit_script_fully + +.ows_dcd7 + print_npc_text Text0463 + give_card PIKACHU4 + show_card_received_screen PIKACHU4 + print_npc_text Text0464 + script_set_flag_value EVENT_MAN1_GIFT_SEQUENCE_STATE, $06 + quit_script_fully + +.ows_dce5 + print_text_quit_fully Text0465 + +.ows_dce8 + print_text_quit_fully Text0466 + +Preload_ImakuniInFightingClubLobby: ; dceb (3:5ceb) + get_flag_value EVENT_IMAKUNI_STATE + cp IMAKUNI_MENTIONED + jr z, .asm_dd06 + or a + jr z, .asm_dd04 + get_flag_value EVENT_TEMP_DUELED_IMAKUNI + jr nz, .asm_dd04 + get_flag_value EVENT_IMAKUNI_ROOM + cp IMAKUNI_FIGHTING_CLUB + jr z, .asm_dd06 +.asm_dd04 + or a + ret + +.asm_dd06 + ld a, MUSIC_IMAKUNI + ld [wd111], a + scf + ret Script_Imakuni: ; dd0d (3:5d0d) start_script script_set_flag_value EVENT_IMAKUNI_STATE, IMAKUNI_TALKED jump_if_flag_zero_2 EVENT_TEMP_TALKED_TO_IMAKUNI, NULL - print_variable_text Text0467, Text0468 + print_variable_npc_text Text0467, Text0468 max_out_flag_value EVENT_TEMP_TALKED_TO_IMAKUNI - ask_question_jump Text0469, .acceptDuel - print_text_string Text046a + ask_question_jump Text0469, .start_duel + print_npc_text Text046a quit_script_fully -.acceptDuel - print_text_string Text046b - start_battle PRIZES_6, IMAKUNI_DECK_ID, MUSIC_IMAKUNI +.start_duel + print_npc_text Text046b + start_duel PRIZES_6, IMAKUNI_DECK_ID, MUSIC_IMAKUNI quit_script_fully Script_BeatImakuni: ; dd2d (3:5d2d) start_script - jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $07, .giveBoosters - script_increment_flag_value EVENT_IMAKUNI_WIN_COUNT - jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $03, .threeWins - jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $06, .sixWins -.giveBoosters - print_text_string Text046c + jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $07, .give_boosters + increment_flag_value EVENT_IMAKUNI_WIN_COUNT + jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $03, .three_wins + jump_if_flag_equal EVENT_IMAKUNI_WIN_COUNT, $06, .six_wins +.give_boosters + print_npc_text Text046c give_one_of_each_trainer_booster script_jump .done -.threeWins - print_text_string Text046d - script_jump .giveImakuniCard +.three_wins + print_npc_text Text046d + script_jump .give_imakuni_card -.sixWins - print_text_string Text046e -.giveImakuniCard - print_text_string Text046f +.six_wins + print_npc_text Text046e +.give_imakuni_card + print_npc_text Text046f give_card IMAKUNI_CARD show_card_received_screen IMAKUNI_CARD .done - print_text_string Text0470 - script_jump ScriptJump_ImakuniCommon + print_npc_text Text0470 + script_jump Script_LostToImakuni.imakuni_common Script_LostToImakuni: ; dd5c (3:5d5c) start_script - print_text_string Text0471 - -ScriptJump_ImakuniCommon: ; dd60 (3:5d60) + print_npc_text Text0471 +.imakuni_common close_text_box jump_if_player_coords_match 18, 4, .ows_dd69 script_jump .ows_dd6e @@ -3726,14 +4641,12 @@ ScriptJump_ImakuniCommon: ; dd60 (3:5d60) .ows_dd69 set_player_direction EAST move_player WEST, 1 - .ows_dd6e move_active_npc NPCMovement_dd78 - run_command Func_cdcb - max_out_flag_value EVENT_TEMP_BATTLED_IMAKUNI - run_command Func_d408 - db $09 - run_command Func_d41d + unload_active_npc + max_out_flag_value EVENT_TEMP_DUELED_IMAKUNI + set_default_song MUSIC_OVERWORLD + play_default_song quit_script_fully NPCMovement_dd78: ; dd78 (3:5d78) @@ -3749,183 +4662,502 @@ NPCMovement_dd78: ; dd78 (3:5d78) db $ff Script_Specs1: ; dd82 (3:5d82) - INCROM $dd82, $dd8d + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0472, Text0473 + quit_script_fully Script_Butch: ; dd8d (3:5d8d) - INCROM $dd8d, $dd9f + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0474, Text0475 + quit_script_fully -Script_Granny1: ; dd9f (3:5d9f) - INCROM $dd9f, $dda3 +Preload_Granny1: ; dd98 (3:5d98) + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + cp $01 + ret +Script_Granny1: ; dd9f (3:5d9f) + start_script + print_text_quit_fully Text0476 FightingClubAfterDuel: ; dda3 (3:5da3) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xddaa .after_duel_table db NPC_CHRIS db NPC_CHRIS - dw $5e69 - dw $5e75 + dw Script_BeatChrisInFightingClub + dw Script_LostToChrisInFightingClub db NPC_MICHAEL db NPC_MICHAEL - dw $5e95 - dw $5ea1 + dw Script_BeatMichaelInFightingClub + dw Script_LostToMichaelInFightingClub db NPC_JESSICA db NPC_JESSICA - dw $5ec1 - dw $5ecd + dw Script_BeatJessicaInFightingClub + dw Script_LostToJessicaInFightingClub db NPC_MITCH db NPC_MITCH dw Script_BeatMitch - dw Script_LoseToMitch - + dw Script_LostToMitch db $00 -; ddc3 Script_Mitch: ; ddc3 (3:5dc3) start_script try_give_pc_pack $02 - jump_if_flag_nonzero_2 EVENT_FLAG_0F, Script_Mitch_AlreadyHaveMedal + jump_if_flag_nonzero_2 EVENT_BEAT_MITCH, Script_Mitch_AlreadyHaveMedal fight_club_pupil_jump .first_interaction, .three_pupils_remaining, \ .two_pupils_remaining, .one_pupil_remaining, .all_pupils_defeated .first_interaction - print_text_string Text0477 - script_set_flag_value EVENT_FLAG_11, $01 - script_set_flag_value EVENT_FLAG_17, $01 - script_set_flag_value EVENT_FLAG_20, $01 + print_npc_text Text0477 + script_set_flag_value EVENT_PUPIL_MICHAEL_STATE, 1 + script_set_flag_value EVENT_PUPIL_CHRIS_STATE, 1 + script_set_flag_value EVENT_PUPIL_JESSICA_STATE, 1 quit_script_fully -; 0xdde2 + .three_pupils_remaining print_text_quit_fully Text0478 -; 0xdde5 + .two_pupils_remaining print_text_quit_fully Text0479 -; 0xdde8 + .one_pupil_remaining print_text_quit_fully Text047a -; 0xddeb + .all_pupils_defeated - print_text_string Text047b - ask_question_jump Text047c, .do_battle - print_text_string Text047d + print_npc_text Text047b + ask_question_jump Text047c, .start_duel + print_npc_text Text047d quit_script_fully -; 0xddf7 -.do_battle - print_text_string Text047e - start_battle PRIZES_6, FIRST_STRIKE_DECK_ID, MUSIC_DUEL_THEME_2 + +.start_duel + print_npc_text Text047e + start_duel PRIZES_6, FIRST_STRIKE_DECK_ID, MUSIC_DUEL_THEME_2 quit_script_fully -; 0xddff Script_BeatMitch: ; ddff (3:5dff) start_script - jump_if_flag_nonzero_2 EVENT_FLAG_0F, Script_Mitch_GiveBoosters - print_text_string Text047f - max_out_flag_value EVENT_FLAG_0F + jump_if_flag_nonzero_2 EVENT_BEAT_MITCH, Script_Mitch_GiveBoosters + print_npc_text Text047f + max_out_flag_value EVENT_BEAT_MITCH try_give_medal_pc_packs - run_command Func_d125 - db $0f - run_command Func_d435 - db $01 - print_text_string Text0480 + show_medal_received_screen EVENT_BEAT_MITCH + record_master_win $01 + print_npc_text Text0480 give_booster_packs BOOSTER_LABORATORY_NEUTRAL, BOOSTER_LABORATORY_NEUTRAL, NO_BOOSTER - print_text_string Text0481 + print_npc_text Text0481 quit_script_fully -; 0xde19 -Script_LoseToMitch: ; de19 (3:5e19) +Script_LostToMitch: ; de19 (3:5e19) start_script - jump_if_flag_nonzero_2 EVENT_FLAG_0F, Script_Mitch_PrintTrainHarderText + jump_if_flag_nonzero_2 EVENT_BEAT_MITCH, Script_Mitch_PrintTrainHarderText print_text_quit_fully Text0482 -; 0xde21 -Script_Mitch_AlreadyHaveMedal: ; 0xde21 - print_text_string Text0483 - ask_question_jump Text047c, .do_battle - print_text_string Text0484 +Script_Mitch_AlreadyHaveMedal: ; de21 (3:5e21) + print_npc_text Text0483 + ask_question_jump Text047c, .start_duel + print_npc_text Text0484 quit_script_fully -; 0xde2d -.do_battle - print_text_string Text0485 - start_battle PRIZES_6, FIRST_STRIKE_DECK_ID, MUSIC_DUEL_THEME_2 + +.start_duel + print_npc_text Text0485 + start_duel PRIZES_6, FIRST_STRIKE_DECK_ID, MUSIC_DUEL_THEME_2 quit_script_fully -; 0xde35 -Script_Mitch_GiveBoosters: - print_text_string Text0486 +Script_Mitch_GiveBoosters: ; de35 (3:5e35) + print_npc_text Text0486 give_booster_packs BOOSTER_LABORATORY_NEUTRAL, BOOSTER_LABORATORY_NEUTRAL, NO_BOOSTER - print_text_string Text0487 + print_npc_text Text0487 quit_script_fully -; 0xde40 -Script_Mitch_PrintTrainHarderText: +Script_Mitch_PrintTrainHarderText: ; de40 (3:5e40) print_text_quit_fully Text0488 -; 0xde43 - INCROM $de43, $ded1 +Preload_ChrisInFightingClub: ; de43 (3:5e43) + get_flag_value EVENT_PUPIL_CHRIS_STATE + cp 8 + ccf + ret + +Script_de4b: ; de4b (3:5e4b) + jump_if_flag_equal EVENT_PUPIL_CHRIS_STATE, 8, NULL + print_variable_npc_text Text0489, Text048a + script_set_flag_value EVENT_PUPIL_CHRIS_STATE, 9 + ask_question_jump Text048b, .ows_de61 + print_npc_text Text048c + quit_script_fully + +.ows_de61 + print_npc_text Text048d + start_duel PRIZES_4, MUSCLES_FOR_BRAINS_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatChrisInFightingClub: ; de69 (3:5e69) + start_script + print_npc_text Text048e + give_booster_packs BOOSTER_EVOLUTION_FIGHTING, BOOSTER_EVOLUTION_FIGHTING, NO_BOOSTER + print_npc_text Text048f + quit_script_fully + +Script_LostToChrisInFightingClub: ; de75 (3:5e75) + start_script + print_text_quit_fully Text0490 + +Preload_MichaelInFightingClub: ; de79 (3:5e79) + get_flag_value EVENT_PUPIL_MICHAEL_STATE + cp 8 + ccf + ret + +Script_MichaelRematch: ; de81 (3:5e81) + print_npc_text Text0491 + ask_question_jump Text0492, .ows_de8d + print_npc_text Text0493 + quit_script_fully + +.ows_de8d + print_npc_text Text0494 + start_duel PRIZES_4, HEATED_BATTLE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatMichaelInFightingClub: ; de95 (3:5e95) + start_script + print_npc_text Text0495 + give_booster_packs BOOSTER_COLOSSEUM_FIGHTING, BOOSTER_COLOSSEUM_FIGHTING, NO_BOOSTER + print_npc_text Text0496 + quit_script_fully + +Script_LostToMichaelInFightingClub: ; dea1 (3:5ea1) + start_script + print_text_quit_fully Text0497 + +Preload_JessicaInFightingClub: ; dea5 (3:5ea5) + get_flag_value EVENT_PUPIL_JESSICA_STATE + cp 8 + ccf + ret + +Script_dead: ; dead (3:5ead) + print_npc_text Text0498 + ask_question_jump Text0499, .ows_deb9 + print_npc_text Text049a + quit_script_fully + +.ows_deb9 + print_npc_text Text049b + start_duel PRIZES_4, LOVE_TO_BATTLE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatJessicaInFightingClub: ; dec1 (3:5ec1) + start_script + print_npc_text Text049c + give_booster_packs BOOSTER_COLOSSEUM_FIGHTING, BOOSTER_COLOSSEUM_FIGHTING, NO_BOOSTER + print_npc_text Text049d + quit_script_fully + +Script_LostToJessicaInFightingClub: ; decd (3:5ecd) + start_script + print_text_quit_fully Text049e Script_Clerk2: ; ded1 (3:5ed1) - INCROM $ded1, $ded5 + start_script + print_text_quit_fully Text0779 RockClubLobbyAfterDuel: ; ded5 (3:5ed5) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xdedc .after_duel_table db NPC_CHRIS db NPC_CHRIS - dw $5f0c - dw $5f20 + dw Script_BeatChrisInRockClubLobby + dw Script_LostToChrisInRockClubLobby db NPC_MATTHEW db NPC_MATTHEW - dw $5f63 - dw $5f78 + dw Script_BeatMatthew + dw Script_LostToMatthew db $00 -; 0xdee9 - INCROM $dee9, $def2 +Preload_ChrisInRockClubLobby: ; dee9 (3:5ee9) + get_flag_value EVENT_PUPIL_CHRIS_STATE + or a + ret z + cp 8 + ret Script_Chris: ; def2 (3:5ef2) - INCROM $def2, $df39 + start_script + jump_if_flag_not_less_than EVENT_PUPIL_CHRIS_STATE, 8, Script_de4b + print_npc_text Text077a + ask_question_jump Text077b, .ows_df04 + print_npc_text Text077c + quit_script_fully + +.ows_df04 + print_npc_text Text077d + start_duel PRIZES_4, MUSCLES_FOR_BRAINS_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatChrisInRockClubLobby: ; df0c (3:5f0c) + start_script + script_set_flag_value EVENT_PUPIL_CHRIS_STATE, 8 + print_npc_text Text077e + give_booster_packs BOOSTER_EVOLUTION_FIGHTING, BOOSTER_EVOLUTION_FIGHTING, NO_BOOSTER + print_npc_text Text077f + close_text_box + move_active_npc_by_direction NPCMovementTable_df24 + unload_active_npc + quit_script_fully + +Script_LostToChrisInRockClubLobby: ; df20 (3:5f20) + start_script + print_text_quit_fully Text0780 + +NPCMovementTable_df24: ; df24 (3:5f24) + dw NPCMovement_df2c + dw NPCMovement_df2c + dw NPCMovement_df34 + dw NPCMovement_df2c + +NPCMovement_df2c: ; df2c (3:5f2c) + db SOUTH + db SOUTH + db EAST + db EAST + db EAST + db EAST + db EAST + db $ff + +NPCMovement_df34: ; df34 (3:5f34) + db EAST + db SOUTH + db SOUTH + db $fe, -9 Script_Matthew: ; df39 (3:5f39) - INCROM $df39, $df83 + start_script + try_give_pc_pack $03 + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_df4c + jump_if_flag_zero_1 EVENT_MATTHEW_STATE, NULL + print_variable_npc_text Text0781, Text0782 + script_jump .ows_df4f + +.ows_df4c + print_npc_text Text0783 +.ows_df4f + script_set_flag_value EVENT_MATTHEW_STATE, $01 + ask_question_jump Text0784, .ows_df5b + print_npc_text Text0785 + quit_script_fully + +.ows_df5b + print_npc_text Text0786 + start_duel PRIZES_4, HARD_POKEMON_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatMatthew: ; df63 (3:5f63) + start_script + script_set_flag_value EVENT_MATTHEW_STATE, $02 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0787, Text0788 + give_booster_packs BOOSTER_MYSTERY_FIGHTING_COLORLESS, BOOSTER_MYSTERY_FIGHTING_COLORLESS, NO_BOOSTER + print_npc_text Text0789 + quit_script_fully + +Script_LostToMatthew: ; df78 (3:5f78) + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text078a, Text078b + quit_script_fully Script_Woman1: ; df83 (3:5f83) - INCROM $df83, $dfc0 + start_script + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $07, .ows_dfba + jump_if_flag_nonzero_2 EVENT_ISHIHARA_MET, .ows_df96 + max_out_flag_value EVENT_ISHIHARA_MENTIONED + max_out_flag_value EVENT_ISHIHARAS_HOUSE_MENTIONED + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text078c + +.ows_df96 + jump_if_flag_nonzero_2 EVENT_TEMP_TRADED_WITH_ISHIHARA, .ows_dfb7 + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $05, .ows_dfae + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $03, .ows_dfa9 + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text078d + +.ows_dfa9 + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text078e + +.ows_dfae + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_dfb7 + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text078f + +.ows_dfb7 + print_text_quit_fully Text0790 + +.ows_dfba + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $08 + print_text_quit_fully Text0791 Script_Chap1: ; dfc0 (3:5fc0) - INCROM $dfc0, $dfd2 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0792, Text0793 + quit_script_fully + +Preload_Lass3: ; dfcb (3:5fcb) + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + cp $01 + ret Script_Lass3: ; dfd2 (3:5fd2) - INCROM $dfd2, $dff0 + start_script + print_text_quit_fully Text0794 + +RockClubAfterDuel: ; dfd6 (3:5fd6) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_RYAN + db NPC_RYAN + dw Script_BeatRyan + dw Script_LostToRyan + + db NPC_ANDREW + db NPC_ANDREW + dw Script_BeatAndrew + dw Script_LostToAndrew + + db NPC_GENE + db NPC_GENE + dw Script_BeatGene + dw Script_LostToGene + db $00 Script_Ryan: ; dff0 (3:5ff0) - INCROM $dff0, $e017 + start_script + try_give_pc_pack $03 + print_npc_text Text0795 + ask_question_jump Text0796, .ows_dfff + print_npc_text Text0797 + quit_script_fully + +.ows_dfff + print_npc_text Text0798 + start_duel PRIZES_3, EXCAVATION_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatRyan: ; e007 (3:6007) + start_script + print_npc_text Text0799 + give_booster_packs BOOSTER_EVOLUTION_FIGHTING, BOOSTER_EVOLUTION_FIGHTING, NO_BOOSTER + print_npc_text Text079a + quit_script_fully + +Script_LostToRyan: ; e013 (3:6013) + start_script + print_text_quit_fully Text079b Script_Andrew: ; e017 (3:6017) - INCROM $e017, $e03e + start_script + try_give_pc_pack $03 + print_npc_text Text079c + ask_question_jump Text079d, .ows_e026 + print_npc_text Text079e + quit_script_fully + +.ows_e026 + print_npc_text Text079f + start_duel PRIZES_4, BLISTERING_POKEMON_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatAndrew: ; e02e (3:602e) + start_script + print_npc_text Text07a0 + give_booster_packs BOOSTER_COLOSSEUM_FIGHTING, BOOSTER_COLOSSEUM_FIGHTING, NO_BOOSTER + print_npc_text Text07a1 + quit_script_fully + +Script_LostToAndrew: ; e03a (3:603a) + start_script + print_text_quit_fully Text07a2 Script_Gene: ; e03e (3:603e) - INCROM $e03e, $e09e + start_script + try_give_pc_pack $03 + jump_if_flag_nonzero_2 EVENT_BEAT_GENE, Script_LostToGene.ows_e07b + print_npc_text Text07a3 + ask_question_jump Text07a4, .ows_e051 + print_npc_text Text07a5 + quit_script_fully -Script_Clerk3: ; e09e (3:609e) - INCROM $e09e, $e0a2 +.ows_e051 + print_npc_text Text07a6 + start_duel PRIZES_6, ROCK_CRUSHER_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +Script_BeatGene: ; e059 (3:6059) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_GENE, Script_LostToGene.ows_e08f + print_npc_text Text07a7 + max_out_flag_value EVENT_BEAT_GENE + try_give_medal_pc_packs + show_medal_received_screen EVENT_BEAT_GENE + record_master_win $02 + print_npc_text Text07a8 + give_booster_packs BOOSTER_MYSTERY_FIGHTING_COLORLESS, BOOSTER_MYSTERY_FIGHTING_COLORLESS, NO_BOOSTER + print_npc_text Text07a9 + quit_script_fully + +Script_LostToGene: ; e073 (3:6073) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_GENE, .ows_e09a + print_text_quit_fully Text07aa + +.ows_e07b + print_npc_text Text07ab + ask_question_jump Text07a4, .ows_e087 + print_npc_text Text07ac + quit_script_fully + +.ows_e087 + print_npc_text Text07ad + start_duel PRIZES_6, ROCK_CRUSHER_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +.ows_e08f + print_npc_text Text07ae + give_booster_packs BOOSTER_MYSTERY_FIGHTING_COLORLESS, BOOSTER_MYSTERY_FIGHTING_COLORLESS, NO_BOOSTER + print_npc_text Text07af + quit_script_fully +.ows_e09a + print_text_quit_fully Text07b0 + ret + +Script_Clerk3: ; e09e (3:609e) + start_script + print_text_quit_fully Text041c WaterClubLobbyAfterDuel: ; e0a2 (3:60a2) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xe0a9 .after_duel_table db NPC_IMAKUNI @@ -3933,13 +5165,12 @@ WaterClubLobbyAfterDuel: ; e0a2 (3:60a2) dw Script_BeatImakuni dw Script_LostToImakuni db $00 -; 0xe0b0 Preload_ImakuniInWaterClubLobby: ; e0b0 (3:60b0) get_flag_value EVENT_IMAKUNI_STATE cp IMAKUNI_TALKED jr c, .asm_e0c6 - get_flag_value EVENT_TEMP_BATTLED_IMAKUNI + get_flag_value EVENT_TEMP_DUELED_IMAKUNI jr nz, .asm_e0c6 get_flag_value EVENT_IMAKUNI_ROOM cp IMAKUNI_WATER_CLUB @@ -3947,63 +5178,63 @@ Preload_ImakuniInWaterClubLobby: ; e0b0 (3:60b0) .asm_e0c6 or a ret + .asm_e0c8 - ld a, $10 + ld a, MUSIC_IMAKUNI ld [wd111], a scf ret Script_Gal1: ; e0cf (3:60cf) start_script - jump_if_flag_equal EVENT_FLAG_12, $02, .ows_e10e - jump_if_flag_equal EVENT_FLAG_12, $00, NULL - print_variable_text Text041d, Text041e - script_set_flag_value EVENT_FLAG_12, $01 - ask_question_jump Text041f, .ows_e0eb - print_text_string Text0420 + jump_if_flag_equal EVENT_GAL1_TRADE_STATE, $02, .ows_e10e + jump_if_flag_equal EVENT_GAL1_TRADE_STATE, $00, NULL + print_variable_npc_text Gal1WantToTrade1Text, Gal1WantToTrade2Text + script_set_flag_value EVENT_GAL1_TRADE_STATE, $01 + ask_question_jump Gal1WouldYouLikeToTradeText, .ows_e0eb + print_npc_text Gal1DeclinedTradeText quit_script_fully .ows_e0eb jump_if_card_owned LAPRAS, .ows_e0f3 - print_text_string Text0421 + print_npc_text Gal1DontOwnCardText quit_script_fully .ows_e0f3 jump_if_card_in_collection LAPRAS, .ows_e0fb - print_text_string Text0422 + print_npc_text Gal1CardInDeckText quit_script_fully .ows_e0fb - script_set_flag_value EVENT_FLAG_12, $02 - print_text_string Text0423 - run_command Func_ccdc - tx Text0424 + script_set_flag_value EVENT_GAL1_TRADE_STATE, $02 + print_npc_text Gal1LetsTradeText + print_text Gal1TradeCompleteText take_card LAPRAS give_card ARCANINE1 show_card_received_screen ARCANINE1 - print_text_string Text0425 + print_npc_text Gal1ThanksText quit_script_fully .ows_e10e - print_text_quit_fully Text0426 + print_text_quit_fully Gal1AfterTradeText Script_Lass1: ; e111 (3:6111) start_script - jump_if_flag_equal EVENT_FLAG_14, $01, .ows_e121 - print_text_string Text0427 - script_set_flag_value EVENT_FLAG_14, $01 + jump_if_flag_equal EVENT_LASS1_MENTIONED_IMAKUNI, $01, .ows_e121 + print_npc_text Text0427 + script_set_flag_value EVENT_LASS1_MENTIONED_IMAKUNI, $01 script_set_flag_value EVENT_IMAKUNI_STATE, IMAKUNI_MENTIONED quit_script_fully .ows_e121 jump_if_flag_not_equal EVENT_IMAKUNI_ROOM, IMAKUNI_WATER_CLUB, .ows_e12d - jump_if_flag_nonzero_2 EVENT_TEMP_BATTLED_IMAKUNI, .ows_e12d + jump_if_flag_nonzero_2 EVENT_TEMP_DUELED_IMAKUNI, .ows_e12d print_text_quit_fully Text0428 .ows_e12d print_text_quit_fully Text0429 -Preload_Man2InWaterClubLobby: ; e130 (3:6130) +Preload_Man2: ; e130 (3:6130) get_flag_value EVENT_JOSHUA_STATE cp JOSHUA_BEATEN ret @@ -4028,9 +5259,9 @@ WaterClubMovePlayer: ; e13f (3:613f) ld bc, Script_NotReadyToSeeAmy jp SetNextNPCAndScript -WaterClubAfterDuel: ;e157 (3:6157) +WaterClubAfterDuel: ; e157 (3:6157) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret .after_duel_table @@ -4057,73 +5288,78 @@ WaterClubAfterDuel: ;e157 (3:6157) Script_Sara: ; e177 (3:6177) start_script - print_text_string Text042c - ask_question_jump Text042d, .yes_duel - print_text_string Text042e + print_npc_text Text042c + ask_question_jump Text042d, .start_duel + print_npc_text Text042e quit_script_fully -.yes_duel - print_text_string Text042f - start_battle PRIZES_2, WATERFRONT_POKEMON_DECK_ID, MUSIC_DUEL_THEME_1 + +.start_duel + print_npc_text Text042f + start_duel PRIZES_2, WATERFRONT_POKEMON_DECK_ID, MUSIC_DUEL_THEME_1 quit_script_fully Script_BeatSara: ; e18c (3:618c) start_script max_out_flag_value EVENT_BEAT_SARA - print_text_string Text0430 + print_npc_text Text0430 give_booster_packs BOOSTER_COLOSSEUM_WATER, BOOSTER_COLOSSEUM_WATER, NO_BOOSTER - print_text_string Text0431 + print_npc_text Text0431 quit_script_fully -Script_LostToSara: ; e19a (03:619a) +Script_LostToSara: ; e19a (3:619a) start_script print_text_quit_fully Text0432 -Script_Amanda: ; e19e (03:619e) +Script_Amanda: ; e19e (3:619e) start_script - print_text_string Text0433 - ask_question_jump Text0434, .yes_duel - print_text_string Text0435 + print_npc_text Text0433 + ask_question_jump Text0434, .start_duel + print_npc_text Text0435 quit_script_fully -.yes_duel - print_text_string Text0436 - start_battle PRIZES_3, LONELY_FRIENDS_DECK_ID, MUSIC_DUEL_THEME_1 + +.start_duel + print_npc_text Text0436 + start_duel PRIZES_3, LONELY_FRIENDS_DECK_ID, MUSIC_DUEL_THEME_1 quit_script_fully -Script_BeatAmanda: ; e1b3 (03:61b3) +Script_BeatAmanda: ; e1b3 (3:61b3) start_script max_out_flag_value EVENT_BEAT_AMANDA - print_text_string Text0437 + print_npc_text Text0437 give_booster_packs BOOSTER_MYSTERY_LIGHTNING_COLORLESS, BOOSTER_MYSTERY_LIGHTNING_COLORLESS, NO_BOOSTER - print_text_string Text0438 + print_npc_text Text0438 quit_script_fully -Script_LostToAmanda: ; e1c1 (03:61c1) +Script_LostToAmanda: ; e1c1 (3:61c1) start_script print_text_quit_fully Text0439 -Script_NotReadyToSeeAmy: ; e1c5 (03:61c5) +Script_NotReadyToSeeAmy: ; e1c5 (3:61c5) start_script - jump_if_player_coords_match $12, $08, .ows_e1ec - jump_if_player_coords_match $14, $08, .ows_e1f2 - jump_if_player_coords_match $18, $08, .ows_e1f8 + jump_if_player_coords_match 18, 8, .ows_e1ec + jump_if_player_coords_match 20, 8, .ows_e1f2 + jump_if_player_coords_match 24, 8, .ows_e1f8 .ows_e1d5 move_player SOUTH, 4 move_active_npc NPCMovement_e213 - print_text_string Text043a - jump_if_player_coords_match $12, $0a, .ows_e1fe - jump_if_player_coords_match $14, $0a, .ows_e202 + print_npc_text Text043a + jump_if_player_coords_match 18, 10, .ows_e1fe + jump_if_player_coords_match 20, 10, .ows_e202 move_active_npc NPCMovement_e215 quit_script_fully .ows_e1ec move_active_npc NPCMovement_e206 script_jump .ows_e1d5 + .ows_e1f2 move_active_npc NPCMovement_e20b script_jump .ows_e1d5 + .ows_e1f8 move_active_npc NPCMovement_e20f script_jump .ows_e1d5 + .ows_e1fe move_active_npc NPCMovement_e218 quit_script_fully @@ -4162,8 +5398,6 @@ NPCMovement_e215: ; e215 (3:6215) NPCMovement_e218: ; e218 (3:6218) db EAST -; fallthrough - NPCMovement_e219: ; e219 (3:6219) db EAST db SOUTH | NO_MOVE @@ -4174,57 +5408,57 @@ Script_Joshua: ; e21c (3:621c) jump_if_flag_zero_2 EVENT_BEAT_AMANDA, .sara_and_amanda_not_beaten jump_if_flag_zero_2 EVENT_BEAT_SARA, .sara_and_amanda_not_beaten script_jump .beat_sara_and_amanda + .sara_and_amanda_not_beaten script_set_flag_value EVENT_JOSHUA_STATE, JOSHUA_TALKED - print_text_string Text043b + print_npc_text Text043b quit_script_fully .beat_sara_and_amanda jump_if_flag_nonzero_1 EVENT_JOSHUA_STATE, .already_talked script_set_flag_value EVENT_JOSHUA_STATE, JOSHUA_TALKED - print_text_string Text043b - print_text_string Text043c + print_npc_text Text043b + print_npc_text Text043c .already_talked jump_if_flag_equal EVENT_JOSHUA_STATE, JOSHUA_TALKED, NULL - print_variable_text Text043d, Text043e - ask_question_jump Text043f, .startDuel + print_variable_npc_text Text043d, Text043e + ask_question_jump Text043f, .start_duel jump_if_flag_equal EVENT_JOSHUA_STATE, JOSHUA_TALKED, NULL - print_variable_text Text0440, Text0441 + print_variable_npc_text Text0440, Text0441 quit_script_fully -.startDuel: - print_text_string Text0442 +.start_duel + print_npc_text Text0442 try_give_pc_pack $04 - start_battle PRIZES_4, SOUND_OF_THE_WAVES_DECK_ID, MUSIC_DUEL_THEME_1 + start_duel PRIZES_4, SOUND_OF_THE_WAVES_DECK_ID, MUSIC_DUEL_THEME_1 quit_script_fully Script_LostToJoshua: ; e260 (3:6260) start_script jump_if_flag_equal EVENT_JOSHUA_STATE, JOSHUA_TALKED, NULL - print_variable_text Text0443, Text0444 + print_variable_npc_text Text0443, Text0444 quit_script_fully Script_BeatJoshua: ; e26c (3:626c) start_script jump_if_flag_equal EVENT_JOSHUA_STATE, JOSHUA_TALKED, NULL - print_variable_text Text0445, Text0446 + print_variable_npc_text Text0445, Text0446 give_booster_packs BOOSTER_MYSTERY_WATER_COLORLESS, BOOSTER_MYSTERY_WATER_COLORLESS, NO_BOOSTER jump_if_flag_equal EVENT_JOSHUA_STATE, JOSHUA_TALKED, NULL - print_variable_text Text0447, Text0448 - jump_if_flag_not_equal EVENT_JOSHUA_STATE, JOSHUA_BEATEN, .firstJoshuaWin + print_variable_npc_text Text0447, Text0448 + jump_if_flag_not_equal EVENT_JOSHUA_STATE, JOSHUA_BEATEN, .first_joshua_win quit_script_fully -.firstJoshuaWin: +.first_joshua_win script_set_flag_value EVENT_JOSHUA_STATE, JOSHUA_BEATEN - print_text_string Text0449 + print_npc_text Text0449 close_text_box move_active_npc_by_direction NPCMovementTable_e2a1 - print_text_string Text044a - run_command Func_cfc6 - db $00 + print_npc_text Text044a + set_active_npc_direction NORTH close_advanced_text_box set_next_npc_and_script NPC_AMY, Script_MeetAmy - end_script_loop + end_script ret NPCMovementTable_e2a1: ; e2a1 (3:62a1) @@ -4263,112 +5497,86 @@ Preload_Amy: ; e2ad (3:62ad) Script_MeetAmy: ; e2d1 (3:62d1) start_script - print_text_string Text044b + print_npc_text Text044b set_dialog_npc NPC_JOSHUA - print_text_string Text044c + print_npc_text Text044c set_dialog_npc NPC_AMY - print_text_string Text044d + print_npc_text Text044d close_text_box - run_command Func_d095 - db $09 - db $2f - db $10 - do_frames $20 - run_command Func_d095 - db $04 - db $0e - db $00 - run_command Func_d0be - db $14 - db $04 + set_sprite_attributes $09, $2f, $10 + do_frames 32 + set_sprite_attributes $04, $0e, $00 + set_active_npc_coords 20, 4 set_player_direction WEST move_player WEST, 1 set_player_direction NORTH move_player NORTH, 1 move_player NORTH, 1 - move_arbitrary_npc NPC_JOSHUA, NPCMovement_e2ab - print_text_string Text044e - script_jump Script_Amy.askConfirmDuel + move_npc NPC_JOSHUA, NPCMovement_e2ab + print_npc_text Text044e + script_jump Script_Amy.ask_for_duel Script_Amy: ; e304 (3:6304) start_script - jump_if_flag_nonzero_2 EVENT_BEAT_AMY, ScriptJump_TalkToAmyAgain - print_text_string Text044f -.askConfirmDuel - ask_question_jump Text0450, .startDuel - -.denyDuel - print_text_string Text0451 - run_command Func_d0d9 - db $14 - db $04 - dw Script_LostToAmy.ows_e34e + jump_if_flag_nonzero_2 EVENT_BEAT_AMY, Script_Amy_AlreadyHaveMedal + print_npc_text Text044f +.ask_for_duel + ask_question_jump Text0450, .start_duel +.deny_duel + print_npc_text Text0451 + jump_if_active_npc_coords_match 20, 4, Script_LostToAmy.ows_e34e quit_script_fully -.startDuel - print_text_string Text0452 - start_battle PRIZES_6, GO_GO_RAIN_DANCE_DECK_ID, MUSIC_DUEL_THEME_2 +.start_duel + print_npc_text Text0452 + start_duel PRIZES_6, GO_GO_RAIN_DANCE_DECK_ID, MUSIC_DUEL_THEME_2 quit_script_fully Script_BeatAmy: ; e322 (3:6322) start_script - print_text_string Text0453 - jump_if_flag_nonzero_2 EVENT_BEAT_AMY, .beatAmyCommon - print_text_string Text0454 + print_npc_text Text0453 + jump_if_flag_nonzero_2 EVENT_BEAT_AMY, .give_booster_packs + print_npc_text Text0454 max_out_flag_value EVENT_BEAT_AMY try_give_medal_pc_packs - run_command Func_d125 - db EVENT_BEAT_AMY - run_command Func_d435 - db $03 - print_text_string Text0455 -.beatAmyCommon + show_medal_received_screen EVENT_BEAT_AMY + record_master_win $03 + print_npc_text Text0455 +.give_booster_packs give_booster_packs BOOSTER_LABORATORY_WATER, BOOSTER_LABORATORY_WATER, NO_BOOSTER - print_text_string Text0456 - run_command Func_d0d9 - db $14 - db $04 - dw Script_LostToAmy.ows_e34e + print_npc_text Text0456 + jump_if_active_npc_coords_match 20, 4, Script_LostToAmy.ows_e34e quit_script_fully Script_LostToAmy: ; e344 (3:6344) start_script - print_text_string Text0457 - run_command Func_d0d9 - db $14 - db $04 - dw .ows_e34e + print_npc_text Text0457 + jump_if_active_npc_coords_match 20, 4, .ows_e34e quit_script_fully .ows_e34e - run_command Func_d095 - db $08 - db $2e - db $10 - run_command Func_d0be - db $16 - db $04 + set_sprite_attributes $08, $2e, $10 + set_active_npc_coords 22, 4 quit_script_fully -ScriptJump_TalkToAmyAgain: ; e356 (3:6356) - print_text_string Text0458 - ask_question_jump Text0450, .startDuel - script_jump Script_Amy.denyDuel +Script_Amy_AlreadyHaveMedal: ; e356 (3:6356) + print_npc_text Text0458 + ask_question_jump Text0450, .start_duel + script_jump Script_Amy.deny_duel -.startDuel - print_text_string Text0459 - start_battle PRIZES_6, GO_GO_RAIN_DANCE_DECK_ID, MUSIC_DUEL_THEME_2 +.start_duel + print_npc_text Text0459 + start_duel PRIZES_6, GO_GO_RAIN_DANCE_DECK_ID, MUSIC_DUEL_THEME_2 quit_script_fully -; 0xe369 Script_Clerk4: ; e369 (3:6369) - INCROM $e369, $e36d + start_script + print_text_quit_fully Text060e LightningClubLobbyAfterDuel: ; e36d (3:636d) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xe374 .after_duel_table db NPC_IMAKUNI @@ -4376,37 +5584,259 @@ LightningClubLobbyAfterDuel: ; e36d (3:636d) dw Script_BeatImakuni dw Script_LostToImakuni db $00 -; 0xe37B - INCROM $e37B, $e39a +Preload_ImakuniInLightningClubLobby: ; e37b (3:637b) + get_flag_value EVENT_IMAKUNI_STATE + cp IMAKUNI_TALKED + jr c, .asm_e391 + get_flag_value EVENT_TEMP_DUELED_IMAKUNI + jr nz, .asm_e391 + get_flag_value EVENT_IMAKUNI_ROOM + cp IMAKUNI_LIGHTNING_CLUB + jr z, .asm_e393 +.asm_e391 + or a + ret + +.asm_e393 + ld a, MUSIC_IMAKUNI + ld [wd111], a + scf + ret Script_Chap2: ; e39a (3:639a) - INCROM $e39a, $e3d9 + start_script + jump_if_flag_equal EVENT_CHAP2_TRADE_STATE, $02, .ows_e3d6 + jump_if_flag_equal EVENT_CHAP2_TRADE_STATE, $00, NULL + print_variable_npc_text Text060f, Text0610 + script_set_flag_value EVENT_CHAP2_TRADE_STATE, $01 + ask_question_jump Text0611, .ows_e3b6 + print_npc_text Text0612 + quit_script_fully + +.ows_e3b6 + jump_if_card_owned ELECTABUZZ2, .ows_e3be + print_npc_text Text0613 + quit_script_fully + +.ows_e3be + jump_if_card_in_collection ELECTABUZZ2, .ows_e3c6 + print_npc_text Text0614 + quit_script_fully + +.ows_e3c6 + script_set_flag_value EVENT_CHAP2_TRADE_STATE, $02 + print_npc_text Text0615 + take_card ELECTABUZZ2 + give_card ELECTABUZZ1 + show_card_received_screen ELECTABUZZ1 + print_npc_text Text0616 + quit_script_fully + +.ows_e3d6 + print_text_quit_fully Text0617 Script_Lass4: ; e3d9 (3:63d9) - INCROM $e3d9, $e3dd + start_script + print_text_quit_fully Text0618 Script_Hood1: ; e3dd (3:63dd) - INCROM $e3dd, $e408 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0619, Text061a + quit_script_fully + +LightningClubAfterDuel: ; e3e8 (3:63e8) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_JENNIFER + db NPC_JENNIFER + dw Script_BeatJennifer + dw Script_LostToJennifer + + db NPC_NICHOLAS + db NPC_NICHOLAS + dw Script_BeatNicholas + dw Script_LostToNicholas + + db NPC_BRANDON + db NPC_BRANDON + dw Script_BeatBrandon + dw Script_LostToBrandon + + db NPC_ISAAC + db NPC_ISAAC + dw Script_BeatIsaac + dw Script_LostToIsaac + db $00 Script_Jennifer: ; e408 (3:6408) - INCROM $e408, $e42f + start_script + print_npc_text Text061b + ask_question_jump Text061c, .ows_e415 + print_npc_text Text061d + quit_script_fully + +.ows_e415 + print_npc_text Text061e + start_duel PRIZES_4, PIKACHU_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatJennifer: ; e41d (3:641d) + start_script + max_out_flag_value EVENT_BEAT_JENNIFER + print_npc_text Text061f + give_booster_packs BOOSTER_MYSTERY_LIGHTNING_COLORLESS, BOOSTER_MYSTERY_LIGHTNING_COLORLESS, NO_BOOSTER + print_npc_text Text0620 + quit_script_fully + +Script_LostToJennifer: ; e42b (3:642b) + start_script + print_text_quit_fully Text0621 Script_Nicholas: ; e42f (3:642f) - INCROM $e42f, $e456 + start_script + print_npc_text Text0622 + ask_question_jump Text0623, .ows_e43c + print_npc_text Text0624 + quit_script_fully + +.ows_e43c + print_npc_text Text0625 + start_duel PRIZES_4, BOOM_BOOM_SELFDESTRUCT_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatNicholas: ; e444 (3:6444) + start_script + max_out_flag_value EVENT_BEAT_NICHOLAS + print_npc_text Text0626 + give_booster_packs BOOSTER_COLOSSEUM_LIGHTNING, BOOSTER_COLOSSEUM_LIGHTNING, NO_BOOSTER + print_npc_text Text0627 + quit_script_fully + +Script_LostToNicholas: ; e452 (3:6452) + start_script + print_text_quit_fully Text0628 Script_Brandon: ; e456 (3:6456) - INCROM $e456, $e4ad + start_script + jump_if_flag_zero_2 EVENT_BEAT_JENNIFER, .ows_e469 + jump_if_flag_zero_2 EVENT_BEAT_NICHOLAS, .ows_e469 + jump_if_flag_zero_2 EVENT_BEAT_BRANDON, .ows_e469 + print_npc_text Text0629 + script_jump .ows_e46c + +.ows_e469 + print_npc_text Text062a +.ows_e46c + print_npc_text Text062b + ask_question_jump Text062c, .ows_e478 + print_npc_text Text062d + quit_script_fully + +.ows_e478 + print_npc_text Text062e + start_duel PRIZES_4, POWER_GENERATOR_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatBrandon: ; e480 (3:6480) + start_script + try_give_pc_pack $05 + max_out_flag_value EVENT_BEAT_BRANDON + print_npc_text Text062f + give_booster_packs BOOSTER_COLOSSEUM_LIGHTNING, BOOSTER_COLOSSEUM_LIGHTNING, NO_BOOSTER + print_npc_text Text0630 + quit_script_fully + +Script_LostToBrandon: ; e490 (3:6490) + start_script + print_text_quit_fully Text0631 + +Preload_Isaac: ; e494 (3:6494) + get_flag_value EVENT_BEAT_JENNIFER + jr z, .asm_e4ab + get_flag_value EVENT_BEAT_NICHOLAS + jr z, .asm_e4ab + get_flag_value EVENT_BEAT_BRANDON + jr z, .asm_e4ab + ld a, SOUTH + ld [wLoadNPCDirection], a +.asm_e4ab + scf + ret Script_Isaac: ; e4ad (3:64ad) - INCROM $e4ad, $e525 + start_script + jump_if_flag_zero_2 EVENT_BEAT_JENNIFER, .ows_e4bd + jump_if_flag_zero_2 EVENT_BEAT_NICHOLAS, .ows_e4bd + jump_if_flag_zero_2 EVENT_BEAT_BRANDON, .ows_e4bd + script_jump .ows_e4c1 + +.ows_e4bd + print_npc_text Text0632 + quit_script_fully + +.ows_e4c1 + jump_if_flag_nonzero_2 EVENT_BEAT_ISAAC, Script_LostToIsaac.ows_e503 + jump_if_flag_zero_2 EVENT_ISAAC_TALKED, NULL + print_variable_npc_text Text0633, Text0634 + max_out_flag_value EVENT_ISAAC_TALKED + ask_question_jump Text0635, .ows_e4d9 + print_npc_text Text0636 + quit_script_fully + +.ows_e4d9 + print_npc_text Text0637 + start_duel PRIZES_6, ZAPPING_SELFDESTRUCT_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +Script_BeatIsaac: ; e4e1 (3:64e1) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_ISAAC, Script_LostToIsaac.ows_e517 + print_npc_text Text0638 + max_out_flag_value EVENT_BEAT_ISAAC + try_give_medal_pc_packs + show_medal_received_screen EVENT_BEAT_ISAAC + record_master_win $04 + print_npc_text Text0639 + give_booster_packs BOOSTER_MYSTERY_LIGHTNING_COLORLESS, BOOSTER_MYSTERY_LIGHTNING_COLORLESS, NO_BOOSTER + print_npc_text Text063a + quit_script_fully + +Script_LostToIsaac: ; e4fb (3:64fb) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_ISAAC, .ows_e522 + print_text_quit_fully Text063b + +.ows_e503 + print_npc_text Text063c + ask_question_jump Text0635, .ows_e50f + print_npc_text Text063d + quit_script_fully + +.ows_e50f + print_npc_text Text063e + start_duel PRIZES_6, ZAPPING_SELFDESTRUCT_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +.ows_e517 + print_npc_text Text063f + give_booster_packs BOOSTER_MYSTERY_LIGHTNING_COLORLESS, BOOSTER_MYSTERY_LIGHTNING_COLORLESS, NO_BOOSTER + print_npc_text Text0640 + quit_script_fully + +.ows_e522 + print_text_quit_fully Text0641 GrassClubEntranceAfterDuel: ; e525 (3:6525) ld hl, GrassClubEntranceAfterDuelTable - call FindEndOfBattleScript + call FindEndOfDuelScript ret -FindEndOfBattleScript: ; e52c (3:652c) +FindEndOfDuelScript: ; e52c (3:652c) ld c, $0 ld a, [wDuelResult] or a ; cp DUEL_WIN @@ -4439,8 +5869,8 @@ FindEndOfBattleScript: ; e52c (3:652c) GrassClubEntranceAfterDuelTable: ; e553 (3:6553) db NPC_MICHAEL db NPC_MICHAEL - dw $6597 - dw $65ab + dw Script_BeatMichaelInGrassClubEntrance + dw Script_LostToMichaelInGrassClubEntrance db NPC_RONALD2 db NPC_RONALD2 @@ -4454,14 +5884,71 @@ GrassClubEntranceAfterDuelTable: ; e553 (3:6553) db $00 Script_Clerk5: ; e566 (3:6566) - INCROM $e566, $e573 + start_script + print_text_quit_fully Text06d7 + +Preload_MichaelInGrassClubEntrance: ; e56a (3:656a) + get_flag_value EVENT_PUPIL_MICHAEL_STATE + or a + ret z + cp 8 + ret Script_Michael: ; e573 (3:6573) - INCROM $e573, $e5c4 + start_script + jump_if_flag_not_less_than EVENT_PUPIL_MICHAEL_STATE, 8, Script_MichaelRematch + jump_if_flag_equal EVENT_PUPIL_MICHAEL_STATE, 1, NULL + print_variable_npc_text Text06d8, Text06d9 + script_set_flag_value EVENT_PUPIL_MICHAEL_STATE, 2 + ask_question_jump Text06da, .ows_e58f + print_npc_text Text06db + quit_script_fully + +.ows_e58f + print_npc_text Text06dc + start_duel PRIZES_4, HEATED_BATTLE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatMichaelInGrassClubEntrance: ; e597 (3:6597) + start_script + script_set_flag_value EVENT_PUPIL_MICHAEL_STATE, 8 + print_npc_text Text06dd + give_booster_packs BOOSTER_COLOSSEUM_FIGHTING, BOOSTER_COLOSSEUM_FIGHTING, NO_BOOSTER + print_npc_text Text06de + close_text_box + move_active_npc_by_direction NPCMovementTable_e5af + unload_active_npc + quit_script_fully + +Script_LostToMichaelInGrassClubEntrance: ; e5ab (3:65ab) + start_script + print_text_quit_fully Text06df + +NPCMovementTable_e5af: ; e5af (3:65af) + dw NPCMovement_e5b7 + dw NPCMovement_e5b7 + dw NPCMovement_e5b7 + dw NPCMovement_e5bf + +NPCMovement_e5b7: ; e5b7 (3:65b7) + db WEST + db WEST + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db $ff + +NPCMovement_e5bf: ; e5bf (3:65bf) + db SOUTH + db WEST + db WEST + db $fe, -9 GrassClubLobbyAfterDuel: ; e5c4 (3:65c4) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret .after_duel_table @@ -4473,31 +5960,31 @@ GrassClubLobbyAfterDuel: ; e5c4 (3:65c4) Script_Brittany: ; e5d2 (3:65d2) start_script - jump_if_flag_less_than EVENT_FLAG_35, $01, NULL - print_variable_text Text06e0, Text06e1 - ask_question_jump Text06e2, .wantToDuel - print_text_string Text06e3 + jump_if_flag_less_than EVENT_NIKKI_STATE, $01, NULL + print_variable_npc_text Text06e0, Text06e1 + ask_question_jump Text06e2, .start_duel + print_npc_text Text06e3 quit_script_fully -.wantToDuel - print_text_string Text06e4 - start_battle PRIZES_4, ETCETERA_DECK_ID, MUSIC_DUEL_THEME_1 +.start_duel + print_npc_text Text06e4 + start_duel PRIZES_4, ETCETERA_DECK_ID, MUSIC_DUEL_THEME_1 quit_script_fully Script_BeatBrittany: ; e5ee (3:65ee) start_script - print_text_string Text06e5 + print_npc_text Text06e5 give_booster_packs BOOSTER_MYSTERY_GRASS_COLORLESS, BOOSTER_MYSTERY_GRASS_COLORLESS, NO_BOOSTER - jump_if_flag_less_than EVENT_FLAG_35, $02, NULL - print_variable_text Text06e6, Text06e7 - max_out_flag_value FLAG_BEAT_BRITTANY - jump_if_flag_not_less_than EVENT_FLAG_35, $02, .finishScript - jump_if_flag_zero_2 EVENT_FLAG_3A, .finishScript - jump_if_flag_zero_2 EVENT_FLAG_3B, .finishScript - script_set_flag_value EVENT_FLAG_35, $01 - max_out_flag_value EVENT_FLAG_1E - print_text_string Text06e8 -.finishScript + jump_if_flag_less_than EVENT_NIKKI_STATE, $02, NULL + print_variable_npc_text Text06e6, Text06e7 + max_out_flag_value EVENT_BEAT_BRITTANY + jump_if_flag_not_less_than EVENT_NIKKI_STATE, $02, .quit + jump_if_flag_zero_2 EVENT_BEAT_KRISTIN, .quit + jump_if_flag_zero_2 EVENT_BEAT_HEATHER, .quit + script_set_flag_value EVENT_NIKKI_STATE, $01 + max_out_flag_value EVENT_ISHIHARAS_HOUSE_MENTIONED + print_npc_text Text06e8 +.quit quit_script_fully Script_LostToBrittany: ; e618 (3:6618) @@ -4509,65 +5996,63 @@ Script_e61c: ; e61c (3:661c) Script_Lass2: ; e61f (3:661f) start_script - jump_if_flag_nonzero_2 EVENT_FLAG_04, Script_e61c - jump_if_flag_not_less_than EVENT_FLAG_37, $06, Script_e61c - jump_if_flag_not_less_than EVENT_FLAG_37, $04, .ows_e6a1 - jump_if_flag_not_less_than EVENT_FLAG_37, $02, .ows_e66a - jump_if_flag_equal EVENT_FLAG_37, $00, NULL - print_variable_text Text06eb, Text06ec - script_set_flag_value EVENT_FLAG_37, $01 + jump_if_flag_nonzero_2 EVENT_TEMP_TRADED_WITH_LASS2, Script_e61c + jump_if_flag_not_less_than EVENT_LASS2_TRADE_STATE, $06, Script_e61c + jump_if_flag_not_less_than EVENT_LASS2_TRADE_STATE, $04, .ows_e6a1 + jump_if_flag_not_less_than EVENT_LASS2_TRADE_STATE, $02, .ows_e66a + jump_if_flag_equal EVENT_LASS2_TRADE_STATE, $00, NULL + print_variable_npc_text Text06eb, Text06ec + script_set_flag_value EVENT_LASS2_TRADE_STATE, $01 ask_question_jump Text06ed, .ows_e648 print_text_quit_fully Text06ee .ows_e648 - jump_if_card_owned $1c, .ows_e64f + jump_if_card_owned ODDISH, .ows_e64f print_text_quit_fully Text06ef .ows_e64f - jump_if_card_in_collection $1c, .ows_e656 + jump_if_card_in_collection ODDISH, .ows_e656 print_text_quit_fully Text06f0 .ows_e656 - max_out_flag_value EVENT_FLAG_04 - script_set_flag_value EVENT_FLAG_37, $02 - print_text_string Text06f1 - run_command Func_ccdc - tx Text06f2 + max_out_flag_value EVENT_TEMP_TRADED_WITH_LASS2 + script_set_flag_value EVENT_LASS2_TRADE_STATE, $02 + print_npc_text Text06f1 + print_text Text06f2 take_card ODDISH give_card VILEPLUME show_card_received_screen VILEPLUME print_text_quit_fully Text06f3 .ows_e66a - jump_if_flag_equal EVENT_FLAG_37, $02, NULL - print_variable_text Text06f4, Text06f5 - script_set_flag_value EVENT_FLAG_37, $03 + jump_if_flag_equal EVENT_LASS2_TRADE_STATE, $02, NULL + print_variable_npc_text Text06f4, Text06f5 + script_set_flag_value EVENT_LASS2_TRADE_STATE, $03 ask_question_jump Text06ed, .ows_e67f print_text_quit_fully Text06f6 .ows_e67f - jump_if_card_owned $ab, .ows_e686 + jump_if_card_owned CLEFAIRY, .ows_e686 print_text_quit_fully Text06f7 .ows_e686 - jump_if_card_in_collection $ab, .ows_e68d + jump_if_card_in_collection CLEFAIRY, .ows_e68d print_text_quit_fully Text06f8 .ows_e68d - max_out_flag_value EVENT_FLAG_04 - script_set_flag_value EVENT_FLAG_37, $04 - print_text_string Text06f9 - run_command Func_ccdc - tx Text06fa + max_out_flag_value EVENT_TEMP_TRADED_WITH_LASS2 + script_set_flag_value EVENT_LASS2_TRADE_STATE, $04 + print_npc_text Text06f9 + print_text Text06fa take_card CLEFAIRY give_card PIKACHU3 show_card_received_screen PIKACHU3 print_text_quit_fully Text06f3 .ows_e6a1 - jump_if_flag_equal EVENT_FLAG_37, $04, NULL - print_variable_text Text06fb, Text06fc - script_set_flag_value EVENT_FLAG_37, $05 + jump_if_flag_equal EVENT_LASS2_TRADE_STATE, $04, NULL + print_variable_npc_text Text06fb, Text06fc + script_set_flag_value EVENT_LASS2_TRADE_STATE, $05 ask_question_jump Text06ed, .ows_e6b6 print_text_quit_fully Text06fd @@ -4580,35 +6065,168 @@ Script_Lass2: ; e61f (3:661f) print_text_quit_fully Text06ff .ows_e6c4 - max_out_flag_value EVENT_FLAG_04 - script_set_flag_value EVENT_FLAG_37, $06 - print_text_string Text0700 - run_command Func_ccdc - tx Text0701 + max_out_flag_value EVENT_TEMP_TRADED_WITH_LASS2 + script_set_flag_value EVENT_LASS2_TRADE_STATE, $06 + print_npc_text Text0700 + print_text Text0701 take_card CHARIZARD give_card BLASTOISE show_card_received_screen BLASTOISE print_text_quit_fully Text06f3 -; 0xe6d8 Script_Granny2: ; e6d8 (3:66d8) - INCROM $e6d8, $e6e3 + start_script + print_text_quit_fully Text0702 + +Preload_Gal2: ; e6dc (3:66dc) + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + cp $01 + ret Script_Gal2: ; e6e3 (3:66e3) - INCROM $e6e3, $e701 + start_script + print_text_quit_fully Text0703 + +GrassClubAfterDuel: ; e6e7 (3:66e7) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_KRISTIN + db NPC_KRISTIN + dw Script_BeatKristin + dw Script_LostToKristin + + db NPC_HEATHER + db NPC_HEATHER + dw Script_BeatHeather + dw Script_LostToHeather + + db NPC_NIKKI + db NPC_NIKKI + dw Script_BeatNikki + dw Script_LostToNikki + db $00 Script_Kristin: ; e701 (3:6701) - INCROM $e701, $e745 + start_script + jump_if_flag_less_than EVENT_NIKKI_STATE, $01, NULL + print_variable_npc_text Text0704, Text0705 + ask_question_jump Text0706, .ows_e714 + print_text_quit_fully Text0707 + +.ows_e714 + print_npc_text Text0708 + start_duel PRIZES_4, FLOWER_GARDEN_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatKristin: ; e71c (3:671c) + start_script + try_give_pc_pack $06 + print_npc_text Text0709 + give_booster_packs BOOSTER_EVOLUTION_GRASS, BOOSTER_EVOLUTION_GRASS, NO_BOOSTER + print_npc_text Text070a + max_out_flag_value EVENT_BEAT_KRISTIN + jump_if_flag_not_less_than EVENT_NIKKI_STATE, $02, .ows_e740 + jump_if_flag_zero_2 EVENT_BEAT_BRITTANY, .ows_e740 + jump_if_flag_zero_2 EVENT_BEAT_HEATHER, .ows_e740 + script_set_flag_value EVENT_NIKKI_STATE, $01 + max_out_flag_value EVENT_ISHIHARAS_HOUSE_MENTIONED + print_npc_text Text070b +.ows_e740 + quit_script_fully + +Script_LostToKristin: ; e741 (3:6741) + start_script + print_text_quit_fully Text070c Script_Heather: ; e745 (3:6745) - INCROM $e745, $e79e + start_script + jump_if_flag_less_than EVENT_NIKKI_STATE, $01, NULL + print_variable_npc_text Text070d, Text070e + ask_question_jump Text070f, .ows_e758 + print_text_quit_fully Text0710 + +.ows_e758 + print_npc_text Text0711 + start_duel PRIZES_4, KALEIDOSCOPE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatHeather: ; e760 (3:6760) + start_script + jump_if_flag_less_than EVENT_NIKKI_STATE, $02, NULL + print_variable_npc_text Text0712, Text0713 + give_booster_packs BOOSTER_COLOSSEUM_GRASS, BOOSTER_COLOSSEUM_GRASS, NO_BOOSTER + print_npc_text Text0714 + max_out_flag_value EVENT_BEAT_HEATHER + jump_if_flag_not_less_than EVENT_NIKKI_STATE, $02, .ows_e789 + jump_if_flag_zero_2 EVENT_BEAT_BRITTANY, .ows_e789 + jump_if_flag_zero_2 EVENT_BEAT_KRISTIN, .ows_e789 + script_set_flag_value EVENT_NIKKI_STATE, $01 + max_out_flag_value EVENT_ISHIHARAS_HOUSE_MENTIONED + print_npc_text Text0715 +.ows_e789 + quit_script_fully + +Script_LostToHeather: ; e78a (3:678a) + start_script + jump_if_flag_less_than EVENT_NIKKI_STATE, $02, NULL + print_variable_npc_text Text0716, Text0717 + quit_script_fully + +Preload_NikkiInGrassClub: ; e796 (3:6796) + get_flag_value EVENT_NIKKI_STATE + cp $02 + ccf + ret Script_Nikki: ; e79e (3:679e) - INCROM $e79e, $e7f6 + ld a, [wCurMap] + cp ISHIHARAS_HOUSE + jp z, Script_dae9 + + start_script + jump_if_flag_zero_2 EVENT_BEAT_NIKKI, NULL + print_variable_npc_text Text0718, Text0719 + ask_question_jump Text071a, .ows_e7bf + jump_if_flag_zero_2 EVENT_BEAT_NIKKI, NULL + print_variable_npc_text Text071b, Text071c + quit_script_fully + +.ows_e7bf + jump_if_flag_nonzero_2 EVENT_BEAT_NIKKI, .ows_e7cb + print_npc_text Text071d + start_duel PRIZES_6, FLOWER_POWER_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +.ows_e7cb + print_npc_text Text071e + start_duel PRIZES_6, FLOWER_POWER_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +Script_BeatNikki: ; e7d3 (3:67d3) + start_script + jump_if_flag_zero_2 EVENT_BEAT_NIKKI, NULL + print_variable_npc_text Text071f, Text0720 + jump_if_flag_nonzero_2 EVENT_BEAT_NIKKI, .ows_e7eb + max_out_flag_value EVENT_BEAT_NIKKI + try_give_medal_pc_packs + show_medal_received_screen EVENT_BEAT_NIKKI + record_master_win $05 + print_npc_text Text0721 +.ows_e7eb + give_booster_packs BOOSTER_LABORATORY_NEUTRAL, BOOSTER_LABORATORY_NEUTRAL, NO_BOOSTER + script_jump Script_LostToNikki.ows_e7f3 + +Script_LostToNikki: ; e7f2 (3:67f2) + start_script +.ows_e7f3 + print_text_quit_fully Text0722 ClubEntranceAfterDuel: ; e7f6 (3:67f6) ld hl, .after_duel_table - jp FindEndOfBattleScript + jp FindEndOfDuelScript .after_duel_table db NPC_RONALD2 @@ -4640,10 +6258,10 @@ TryFirstRonaldEncounter: ; e813 (3:6813) TryFirstRonaldFight: ; e822 (3:6822) ld a, NPC_RONALD2 - ld [$d3ab], a + ld [wTempNPC], a call FindLoadedNPC ret c - get_flag_value EVENT_FLAG_4C + get_flag_value EVENT_RONALD_FIRST_DUEL_STATE or a ret nz ld bc, Script_FirstRonaldFight @@ -4651,47 +6269,54 @@ TryFirstRonaldFight: ; e822 (3:6822) TrySecondRonaldFight: ; e837 (3:6837) ld a, NPC_RONALD3 - ld [$d3ab], a + ld [wTempNPC], a call FindLoadedNPC ret c - get_flag_value EVENT_FLAG_4D + get_flag_value EVENT_RONALD_SECOND_DUEL_STATE or a ret nz - ld bc, ScriptSecondRonaldFight + ld bc, Script_SecondRonaldFight jp SetNextNPCAndScript -; 0xe84c Script_Clerk6: ; e84c (3:684c) - INCROM $e84c, $e850 + start_script + print_text_quit_fully Text0642 Script_Lad3: ; e850 (3:6850) - INCROM $e850, $e862 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0643, Text0644 + quit_script_fully + +Preload_Ronald1InClubEntrance: ; e85b (3:685b) + get_flag_value EVENT_RONALD_FIRST_CLUB_ENTRANCE_ENCOUNTER + cp $01 + ret Script_FirstRonaldEncounter: ; e862 (3:6862) start_script - max_out_flag_value EVENT_FLAG_4B + max_out_flag_value EVENT_RONALD_FIRST_CLUB_ENTRANCE_ENCOUNTER move_active_npc NPCMovement_e894 - run_command Func_d135 - db $00 - print_text_string Text0645 + load_current_map_name_into_txram_slot $00 + print_npc_text Text0645 close_text_box move_player NORTH, 1 move_player NORTH, 1 - print_text_string Text0646 + print_npc_text Text0646 ask_question_jump_default_yes NULL, .ows_e882 - print_text_string Text0647 + print_npc_text Text0647 script_jump .ows_e885 .ows_e882 - print_text_string Text0648 + print_npc_text Text0648 .ows_e885 - print_text_string Text0649 + print_npc_text Text0649 close_text_box set_player_direction WEST move_player EAST, 4 move_active_npc NPCMovement_e894 - run_command Func_cdcb - run_command Func_d41d + unload_active_npc + play_default_song quit_script_fully NPCMovement_e894: ; e894 (3:6894) @@ -4701,45 +6326,67 @@ NPCMovement_e894: ; e894 (3:6894) db SOUTH db SOUTH db $ff -; e89a - INCROM $e89a, $e8c0 +Preload_Ronald2InClubEntrance: ; e89a (3:689a) + get_flag_value EVENT_RONALD_FIRST_DUEL_STATE + ld e, $02 +Func_e8a0: ; e8a0 (3:68a0) + cp $01 + jr z, .asm_e8b4 + cp $02 + jr nc, .asm_e8b2 + call TryGiveMedalPCPacks + get_flag_value EVENT_MEDAL_COUNT + cp e + jr z, .asm_e8be +.asm_e8b2 + or a + ret + +.asm_e8b4 + ld a, $08 + ld [wLoadNPCXPos], a + ld a, $08 + ld [wLoadNPCYPos], a +.asm_e8be + scf + ret Script_FirstRonaldFight: ; e8c0 (3:68c0) start_script move_active_npc NPCMovement_e905 - do_frames $3c + do_frames 60 move_active_npc NPCMovement_e90d - print_text_string Text064a - jump_if_player_coords_match $08, $02, $68d6 + print_npc_text Text064a + jump_if_player_coords_match 8, 2, .ows_e8d6 set_player_direction WEST move_player WEST, 1 +.ows_e8d6 set_player_direction SOUTH move_player SOUTH, 1 move_player SOUTH, 1 - print_text_string Text064b - script_set_flag_value $4c, $01 - start_battle PRIZES_6, IM_RONALD_DECK_ID, MUSIC_RONALD + print_npc_text Text064b + script_set_flag_value EVENT_RONALD_FIRST_DUEL_STATE, $01 + start_duel PRIZES_6, IM_RONALD_DECK_ID, MUSIC_RONALD quit_script_fully Script_BeatFirstRonaldFight: ; e8e9 (3:68e9) start_script - print_text_string Text064c + print_npc_text Text064c give_card JIGGLYPUFF1 show_card_received_screen JIGGLYPUFF1 - print_text_string Text064d - script_jump ScriptJump_FinishedFirstRonaldFight + print_npc_text Text064d + script_jump Script_LostToFirstRonaldFight.ows_e8fb Script_LostToFirstRonaldFight: ; e8f7 (3:68f7) start_script - print_text_string Text064e - -ScriptJump_FinishedFirstRonaldFight: - script_set_flag_value EVENT_FLAG_4C, $02 + print_npc_text Text064e +.ows_e8fb + script_set_flag_value EVENT_RONALD_FIRST_DUEL_STATE, $02 close_text_box move_active_npc NPCMovement_e90f - run_command Func_cdcb - run_command Func_d41d + unload_active_npc + play_default_song quit_script_fully NPCMovement_e905: ; e905 (3:6905) @@ -4763,99 +6410,356 @@ NPCMovement_e90f: ; e90f (3:690f) db SOUTH db SOUTH db $ff -; e915 - INCROM $e915, $e91e +Preload_Ronald3InClubEntrance: ; e915 (3:6915) + get_flag_value EVENT_RONALD_SECOND_DUEL_STATE + ld e, $05 + jp Func_e8a0 -ScriptSecondRonaldFight: ; e91e (3:691e) +Script_SecondRonaldFight: ; e91e (3:691e) start_script move_active_npc NPCMovement_e905 do_frames 60 move_active_npc NPCMovement_e90d - print_text_string Text064f - jump_if_player_coords_match $08, $02, .ows_6934 + print_npc_text Text064f + jump_if_player_coords_match 8, 2, .ows_6934 set_player_direction WEST move_player WEST, 1 .ows_6934 set_player_direction SOUTH move_player SOUTH, 1 move_player SOUTH, 1 - print_text_string Text0650 - script_set_flag_value EVENT_FLAG_4D, $01 - start_battle PRIZES_6, POWERFUL_RONALD_DECK_ID, MUSIC_RONALD + print_npc_text Text0650 + script_set_flag_value EVENT_RONALD_SECOND_DUEL_STATE, $01 + start_duel PRIZES_6, POWERFUL_RONALD_DECK_ID, MUSIC_RONALD quit_script_fully Script_BeatSecondRonaldFight: ; e947 (3:6947) start_script - print_text_string Text0651 + print_npc_text Text0651 give_card SUPER_ENERGY_RETRIEVAL show_card_received_screen SUPER_ENERGY_RETRIEVAL - print_text_string Text0652 - script_jump ScriptJump_FinishedSecondRonaldFight + print_npc_text Text0652 + script_jump Script_LostToSecondRonaldFight.ows_e959 Script_LostToSecondRonaldFight: ; e955 (3:6955) start_script - print_text_string Text0653 - -ScriptJump_FinishedSecondRonaldFight: ; e959 (3:6959) - script_set_flag_value EVENT_FLAG_4D, $02 + print_npc_text Text0653 +.ows_e959 + script_set_flag_value EVENT_RONALD_SECOND_DUEL_STATE, $02 close_text_box move_active_npc NPCMovement_e90f - run_command Func_cdcb - run_command Func_d41d + unload_active_npc + play_default_song quit_script_fully -; 0xe963 - PsychicClubLobbyAfterDuel: ; e963 (3:6963) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xe96a .after_duel_table - db NPC_ROBERT db NPC_ROBERT - dw $6995 - dw $69a1 + dw Script_BeatRobert + dw Script_LostToRobert db $00 - INCROM $e971, $e980 +PsychicClubLobbyLoadMap: ; e971 (3:6971) + ld a, NPC_RONALD1 + ld [wTempNPC], a + call FindLoadedNPC + ret c + ld bc, Script_ea02 + jp SetNextNPCAndScript Script_Robert: ; e980 (3:6980) - INCROM $e980, $e9a5 + start_script + print_npc_text Text0654 + ask_question_jump Text0655, .ows_e98d + print_npc_text Text0656 + quit_script_fully + +.ows_e98d + print_npc_text Text0657 + start_duel PRIZES_4, GHOST_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatRobert: ; e995 (3:6995) + start_script + print_npc_text Text0658 + give_booster_packs BOOSTER_EVOLUTION_PSYCHIC, BOOSTER_EVOLUTION_PSYCHIC, NO_BOOSTER + print_npc_text Text0659 + quit_script_fully + +Script_LostToRobert: ; e9a1 (3:69a1) + start_script + print_text_quit_fully Text065a Script_Pappy1: ; e9a5 (3:69a5) - INCROM $e9a5, $ea30 + start_script + jump_if_flag_equal EVENT_PAPPY1_STATE, $03, .ows_e9de + jump_if_flag_nonzero_2 EVENT_BEAT_MURRAY, .ows_e9cb + jump_if_flag_equal EVENT_PAPPY1_STATE, $02, .ows_e9c8 + script_set_flag_value EVENT_PAPPY1_STATE, $01 + print_npc_text Text065b + ask_question_jump_default_yes Text065c, .ows_e9c2 + print_text_quit_fully Text065d + +.ows_e9c2 + script_set_flag_value EVENT_PAPPY1_STATE, $02 + print_text_quit_fully Text065e + +.ows_e9c8 + print_text_quit_fully Text065f + +.ows_e9cb + jump_if_flag_zero_1 EVENT_PAPPY1_STATE, NULL + print_variable_npc_text Text0660, Text0661 + give_card MEWTWO3 + show_card_received_screen MEWTWO3 + script_set_flag_value EVENT_PAPPY1_STATE, $03 + print_text_quit_fully Text0662 + +.ows_e9de + print_text_quit_fully Text0663 + +Func_e9e1: ; e9e1 (3:69e1) + call TryGiveMedalPCPacks + get_flag_value EVENT_MEDAL_COUNT + cp $04 + jr nz, .asm_e9f5 + get_flag_value EVENT_RONALD_PSYCHIC_CLUB_LOBBY_ENCOUNTER + or a + jr nz, .asm_e9f5 + scf + ret +.asm_e9f5 + or a + ret + +Preload_Ronald1InPsychicClubLobby: ; e9f7 (3:69f7) + call Func_e9e1 + ret nc + ld a, [wPlayerYCoord] + ld [wLoadNPCYPos], a + ret + +Script_ea02: ; ea02 (3:6a02) + start_script + move_active_npc_by_direction NPCMovementTable_ea1a + max_out_flag_value EVENT_RONALD_PSYCHIC_CLUB_LOBBY_ENCOUNTER + print_npc_text Text0664 + close_text_box + set_player_direction SOUTH + move_player NORTH, 4 + move_player NORTH, 1 + move_active_npc_by_direction NPCMovementTable_ea22 + unload_active_npc + play_default_song + quit_script_fully + +NPCMovementTable_ea1a: ; ea1a (3:6a1a) + dw NPCMovement_ea2a + dw NPCMovement_ea2a + dw NPCMovement_ea2a + dw NPCMovement_ea2a + +NPCMovementTable_ea22: ; ea22 (3:6a22) + dw NPCMovement_ea2c + dw NPCMovement_ea2c + dw NPCMovement_ea2c + dw NPCMovement_ea2c + +NPCMovement_ea2a: ; ea2a (3:6a2a) + db EAST + db EAST +NPCMovement_ea2c: ; ea2c (3:6a2c) + db EAST + db EAST + db EAST + db $ff Script_Gal3: ; ea30 (3:6a30) - INCROM $ea30, $ea3b + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0665, Text0666 + quit_script_fully Script_Chap4: ; ea3b (3:6a3b) - INCROM $ea3b, $ea60 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0667, Text0668 + quit_script_fully + +PsychicClubAfterDuel: ; ea46 (3:6a46) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_DANIEL + db NPC_DANIEL + dw Script_BeatDaniel + dw Script_LostToDaniel + + db NPC_STEPHANIE + db NPC_STEPHANIE + dw Script_BeatStephanie + dw Script_LostToStephanie + + db NPC_MURRAY1 + db NPC_MURRAY1 + dw Script_BeatMurray + dw Script_LostToMurray + db $00 Script_Daniel: ; ea60 (3:6a60) - INCROM $ea60, $eaa2 + start_script + try_give_medal_pc_packs + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $04, .ows_ea7e + jump_if_flag_nonzero_2 EVENT_DANIEL_TALKED, .ows_ea70 + max_out_flag_value EVENT_DANIEL_TALKED + print_npc_text Text0669 +.ows_ea70 + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $01, .ows_ea78 + print_text_quit_fully Text066a + +.ows_ea78 + print_npc_text Text066b + script_jump .ows_ea81 + +.ows_ea7e + print_npc_text Text066c +.ows_ea81 + ask_question_jump Text066d, .ows_ea8a + print_npc_text Text066e + quit_script_fully + +.ows_ea8a + print_npc_text Text066f + start_duel PRIZES_4, NAP_TIME_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatDaniel: ; ea92 (3:6a92) + start_script + print_npc_text Text0670 + give_booster_packs BOOSTER_EVOLUTION_PSYCHIC, BOOSTER_EVOLUTION_PSYCHIC, NO_BOOSTER + print_npc_text Text0671 + quit_script_fully + +Script_LostToDaniel: ; ea9e (3:6a9e) + start_script + print_text_quit_fully Text0672 Script_Stephanie: ; eaa2 (3:6aa2) - INCROM $eaa2, $eadf + start_script + try_give_medal_pc_packs + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $02, .ows_eaac + print_text_quit_fully Text0673 -Script_Murray2: ; eadf (3:6adf) - INCROM $eadf, $eadf +.ows_eaac + print_npc_text Text0674 + ask_question_jump Text0675, .ows_eab8 + print_npc_text Text0676 + quit_script_fully -Script_Murray1: ; eadf (3:6adf) - INCROM $eadf, $eb53 +.ows_eab8 + print_npc_text Text0677 + start_duel PRIZES_4, STRANGE_POWER_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully -Script_Clerk7: ; eb53 (3:6b53) - INCROM $eb53, $eb57 +Script_BeatStephanie: ; eac0 (3:6ac0) + start_script + print_npc_text Text0678 + give_booster_packs BOOSTER_LABORATORY_PSYCHIC, BOOSTER_LABORATORY_PSYCHIC, NO_BOOSTER + print_npc_text Text0679 + quit_script_fully + +Script_LostToStephanie: ; eacc (3:6acc) + start_script + print_text_quit_fully Text067a + +Preload_Murray2: ; ead0 (3:6ad0) + call TryGiveMedalPCPacks + get_flag_value EVENT_MEDAL_COUNT + cp $04 + ret + +Preload_Murray1: ; eada (3:6ada) + call Preload_Murray2 + ccf + ret + +Script_Murray: ; eadf (3:6adf) + start_script + try_give_pc_pack $07 + try_give_medal_pc_packs + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $04, .ows_eaef + print_npc_text Text067b + print_text Text067c + quit_script_fully + +.ows_eaef + jump_if_flag_nonzero_2 EVENT_BEAT_MURRAY, Script_LostToMurray.ows_eb31 + jump_if_flag_zero_2 EVENT_MURRAY_TALKED, NULL + print_variable_npc_text Text067d, Text067e + max_out_flag_value EVENT_MURRAY_TALKED + ask_question_jump Text067f, .ows_eb07 + print_npc_text Text0680 + quit_script_fully + +.ows_eb07 + print_npc_text Text0681 + start_duel PRIZES_6, STRANGE_PSYSHOCK_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +Script_BeatMurray: ; eb0f (3:6b0f) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_MURRAY, Script_LostToMurray.ows_eb45 + print_npc_text Text0682 + max_out_flag_value EVENT_BEAT_MURRAY + try_give_medal_pc_packs + show_medal_received_screen EVENT_BEAT_MURRAY + record_master_win $06 + print_npc_text Text0683 + give_booster_packs BOOSTER_LABORATORY_PSYCHIC, BOOSTER_LABORATORY_PSYCHIC, NO_BOOSTER + print_npc_text Text0684 + quit_script_fully + +Script_LostToMurray: ; eb29 (3:6b29) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_MURRAY, .ows_eb50 + print_text_quit_fully Text0685 +.ows_eb31 + print_npc_text Text0686 + ask_question_jump Text067f, .ows_eb3d + print_npc_text Text0687 + quit_script_fully + +.ows_eb3d + print_npc_text Text0688 + start_duel PRIZES_6, STRANGE_PSYSHOCK_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +.ows_eb45 + print_npc_text Text0689 + give_booster_packs BOOSTER_LABORATORY_PSYCHIC, BOOSTER_LABORATORY_PSYCHIC, NO_BOOSTER + print_npc_text Text068a + quit_script_fully + +.ows_eb50 + print_text_quit_fully Text068b + +Script_Clerk7: ; eb53 (3:6b53) + start_script + print_text_quit_fully Text0744 ScienceClubLobbyAfterDuel:; eb57 (3:6b57) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xeb5e .after_duel_table db NPC_IMAKUNI @@ -4863,52 +6767,315 @@ ScienceClubLobbyAfterDuel:; eb57 (3:6b57) dw Script_BeatImakuni dw Script_LostToImakuni db $00 -; 0xeb65 - INCROM $eb65, $eb84 +Preload_ImakuniInScienceClubLobby: ; eb65 (3:6b65) + get_flag_value EVENT_IMAKUNI_STATE + cp IMAKUNI_TALKED + jr c, .asm_eb7b + get_flag_value EVENT_TEMP_DUELED_IMAKUNI + jr nz, .asm_eb7b + get_flag_value EVENT_IMAKUNI_ROOM + cp IMAKUNI_SCIENCE_CLUB + jr z, .asm_eb7d +.asm_eb7b + or a + ret + +.asm_eb7d + ld a, MUSIC_IMAKUNI + ld [wd111], a + scf + ret Script_Lad1: ; eb84 (3:6b84) - INCROM $eb84, $ebc1 + start_script + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $07, .ows_ebbb + jump_if_flag_nonzero_2 EVENT_ISHIHARA_MET, .ows_eb97 + max_out_flag_value EVENT_ISHIHARA_MENTIONED + max_out_flag_value EVENT_ISHIHARAS_HOUSE_MENTIONED + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0745 + +.ows_eb97 + jump_if_flag_nonzero_2 EVENT_TEMP_TRADED_WITH_ISHIHARA, .ows_ebb8 + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $05, .ows_ebaf + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $03, .ows_ebaa + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0746 + +.ows_ebaa + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0747 + +.ows_ebaf + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_ebb8 + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0748 + +.ows_ebb8 + print_text_quit_fully Text0749 + +.ows_ebbb + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $08 + print_text_quit_fully Text074a Script_Man3: ; ebc1 (3:6bc1) - INCROM $ebc1, $ebc5 + start_script + print_text_quit_fully Text074b Script_Specs2: ; ebc5 (3:6bc5) - INCROM $ebc5, $ebed + call UpdateRNGSources + and $03 + ld c, a + ld b, $00 + ld hl, Data_ebe7 + add hl, bc + ld e, [hl] + ld d, $00 + call GetCardName + ld hl, wTxRam2 + ld a, e + ld [hli], a + ld [hl], d + + start_script + print_npc_text Text074c + move_active_npc NPCMovement_ebeb + print_text_quit_fully Text074d + +Data_ebe7: ; ebe7 (3:6be7) + db PORYGON + db DITTO + db MUK + db WEEZING + +NPCMovement_ebeb: ; ebeb (3:6beb) + db WEST | NO_MOVE + db $ff Script_Specs3: ; ebed (3:6bed) - INCROM $ebed, $ec11 + start_script + print_text_quit_fully Text074e + +ScienceClubAfterDuel: ; ebf1 (3:6bf1) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_JOSEPH + db NPC_JOSEPH + dw Script_BeatJoseph + dw Script_LostToJoseph + + db NPC_DAVID + db NPC_DAVID + dw Script_BeatDavid + dw Script_LostToDavid + + db NPC_ERIK + db NPC_ERIK + dw Script_BeatErik + dw Script_LostToErik + + db NPC_RICK + db NPC_RICK + dw Script_BeatRick + dw Script_LostToRick + db $00 Script_David: ; ec11 (3:6c11) - INCROM $ec11, $ec42 + start_script + jump_if_flag_zero_1 EVENT_DAVID_STATE, NULL + print_variable_npc_text Text074f, Text0750 + script_set_flag_value EVENT_DAVID_STATE, $01 + ask_question_jump Text0751, .ows_ec27 + print_npc_text Text0752 + quit_script_fully + +.ows_ec27 + print_npc_text Text0753 + start_duel PRIZES_4, LOVELY_NIDORAN_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatDavid: ; ec2f (3:6c2f) + start_script + script_set_flag_value EVENT_DAVID_STATE, $02 + print_npc_text Text0754 + give_booster_packs BOOSTER_MYSTERY_GRASS_COLORLESS, BOOSTER_MYSTERY_GRASS_COLORLESS, NO_BOOSTER + print_npc_text Text0755 + quit_script_fully + +Script_LostToDavid: ; ec3e (3:6c3e) + start_script + print_text_quit_fully Text0756 Script_Erik: ; ec42 (3:6c42) - INCROM $ec42, $ec67 + start_script + print_npc_text Text0757 + ask_question_jump Text0758, .ows_ec4f + print_npc_text Text0759 + quit_script_fully + +.ows_ec4f + print_npc_text Text075a + start_duel PRIZES_4, POISON_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatErik: ; ec57 (3:6c57) + start_script + print_npc_text Text075b + give_booster_packs BOOSTER_EVOLUTION_GRASS, BOOSTER_EVOLUTION_GRASS, NO_BOOSTER + print_npc_text Text075c + quit_script_fully + +Script_LostToErik: ; ec63 (3:6c63) + start_script + print_text_quit_fully Text075d Script_Rick: ; ec67 (3:6c67) - INCROM $ec67, $ecdb + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_RICK, Script_LostToRick.ows_eca2 + print_npc_text Text075e + ask_question_jump Text075f, .ows_ec78 + print_npc_text Text0760 + quit_script_fully + +.ows_ec78 + print_npc_text Text0761 + start_duel PRIZES_6, WONDERS_OF_SCIENCE_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +Script_BeatRick: ; ec80 (3:6c80) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_RICK, Script_LostToRick.ows_ecb6 + print_npc_text Text0762 + max_out_flag_value EVENT_BEAT_RICK + try_give_medal_pc_packs + show_medal_received_screen EVENT_BEAT_RICK + record_master_win $07 + print_npc_text Text0763 + give_booster_packs BOOSTER_LABORATORY_GRASS, BOOSTER_LABORATORY_GRASS, NO_BOOSTER + print_npc_text Text0764 + quit_script_fully + +Script_LostToRick: ; ec9a (3:6c9a) + start_script + jump_if_flag_nonzero_2 EVENT_BEAT_RICK, .ows_ecc1 + print_text_quit_fully Text0765 + +.ows_eca2 + print_npc_text Text0766 + ask_question_jump Text075f, .ows_ecae + print_npc_text Text0767 + quit_script_fully + +.ows_ecae + print_npc_text Text0768 + start_duel PRIZES_6, WONDERS_OF_SCIENCE_DECK_ID, MUSIC_DUEL_THEME_2 + quit_script_fully + +.ows_ecb6 + print_npc_text Text0769 + give_booster_packs BOOSTER_LABORATORY_GRASS, BOOSTER_LABORATORY_GRASS, NO_BOOSTER + print_npc_text Text076a + quit_script_fully + +.ows_ecc1 + print_text_quit_fully Text076b + +Preload_Joseph: ; ecc4 (3:6cc4) + ld a, EVENT_JOSEPH_STATE + call GetEventFlagValue + or a + jr z, .asm_ecd9 + ld a, [wLoadNPCXPos] + add $02 + ld [wLoadNPCXPos], a + ld a, $03 + ld [wLoadNPCDirection], a +.asm_ecd9 + scf + ret Script_Joseph: ; ecdb (3:6cdb) - INCROM $ecdb, $ed45 + start_script + try_give_pc_pack $08 + jump_if_flag_nonzero_2 EVENT_JOSEPH_STATE, Script_LostToJoseph.ows_ed24 + print_npc_text Text076c + ask_question_jump Text076d, .ows_ecee + print_npc_text Text076e + quit_script_fully + +.ows_ecee + print_npc_text Text076f + start_duel PRIZES_4, FLYIN_POKEMON_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatJoseph: ; ecf6 (3:6cf6) + start_script + jump_if_flag_nonzero_2 EVENT_JOSEPH_STATE, Script_LostToJoseph.ows_ed37 + print_npc_text Text0770 + close_text_box + move_active_npc_by_direction NPCMovementTable_ed11 + set_active_npc_direction WEST + max_out_flag_value EVENT_JOSEPH_STATE + print_npc_text Text0771 + give_booster_packs BOOSTER_LABORATORY_GRASS, BOOSTER_LABORATORY_GRASS, NO_BOOSTER + print_npc_text Text0772 + quit_script_fully + +NPCMovementTable_ed11: ; ed11 (3:6d11) + dw NPCMovement_ed19 + dw NPCMovement_ed19 + dw NPCMovement_ed19 + dw NPCMovement_ed19 + +NPCMovement_ed19: ; ed19 (3:6d19) + db EAST + db WEST | NO_MOVE + db $ff + +Script_LostToJoseph: ; ed1c (3:6d1c) + start_script + jump_if_flag_nonzero_2 EVENT_JOSEPH_STATE, .ows_ed42 + print_text_quit_fully Text0773 + +.ows_ed24 + print_npc_text Text0774 + ask_question_jump Text076d, .ows_ed2f + print_text_quit_fully Text076e + +.ows_ed2f + print_npc_text Text0775 + start_duel PRIZES_4, FLYIN_POKEMON_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +.ows_ed37 + print_npc_text Text0776 + give_booster_packs BOOSTER_LABORATORY_GRASS, BOOSTER_LABORATORY_GRASS, NO_BOOSTER + print_npc_text Text0777 + quit_script_fully + +.ows_ed42 + print_text_quit_fully Text0778 Script_Clerk8: ; ed45 (3:6d45) - INCROM $ed45, $ed49 + start_script + print_text_quit_fully Text068c FireClubLobbyAfterDuel: ; ed49 (3:6d49) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret -; 0xed50 .after_duel_table db NPC_JESSICA db NPC_JESSICA - dw $6dba - dw $6dce + dw Script_BeatJessicaInFireClubLobby + dw Script_LostToJessicaInFireClubLobby db $00 -; 0xed57 - FireClubPressedA: ; ed57 (3:6d57) ld hl, SlowpokePaintingObjectTable call FindExtraInteractableObjects @@ -4924,27 +7091,27 @@ SlowpokePaintingObjectTable: ; ed5e (3:6d5e) ; Searches to try to find a match, and starts a Script if possible FindExtraInteractableObjects: ; ed64 (3:6d64) ld de, $5 -.findObjectMatchLoop +.loop ld a, [hl] or a ret z push hl ld a, [wPlayerXCoord] cp [hl] - jr nz, .didNotMatch + jr nz, .not_match inc hl ld a, [wPlayerYCoord] cp [hl] - jr nz, .didNotMatch + jr nz, .not_match inc hl ld a, [wPlayerDirection] cp [hl] - jr z, .foundObject -.didNotMatch + jr z, .match +.not_match pop hl add hl, de - jr .findObjectMatchLoop -.foundObject + jr .loop +.match inc hl ld c, [hl] inc hl @@ -4953,227 +7120,418 @@ FindExtraInteractableObjects: ; ed64 (3:6d64) call SetNextScript scf ret -; 0xed8d - INCROM $ed8d, $ed96 +Preload_JessicaInFireClubLobby: ; ed8d (3:6d8d) + get_flag_value EVENT_PUPIL_JESSICA_STATE + or a + ret z + cp 8 + ret Script_Jessica: ; ed96 (3:6d96) - INCROM $ed96, $ede8 + start_script + jump_if_flag_not_less_than EVENT_PUPIL_JESSICA_STATE, 8, Script_dead + jump_if_flag_equal EVENT_PUPIL_JESSICA_STATE, 1, NULL + print_variable_npc_text Text068d, Text068e + script_set_flag_value EVENT_PUPIL_JESSICA_STATE, 2 + ask_question_jump Text068f, .ows_edb2 + print_npc_text Text0690 + quit_script_fully + +.ows_edb2 + print_npc_text Text0691 + start_duel PRIZES_4, LOVE_TO_BATTLE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatJessicaInFireClubLobby: ; edba (3:6dba) + start_script + script_set_flag_value EVENT_PUPIL_JESSICA_STATE, 8 + print_npc_text Text0692 + give_booster_packs BOOSTER_COLOSSEUM_FIGHTING, BOOSTER_COLOSSEUM_FIGHTING, NO_BOOSTER + print_npc_text Text0693 + close_text_box + move_active_npc_by_direction NPCMovementTable_edd2 + unload_active_npc + quit_script_fully + +Script_LostToJessicaInFireClubLobby: ; edce (3:6dce) + start_script + print_text_quit_fully Text0694 + +NPCMovementTable_edd2: ; edd2 (3:6dd2) + dw NPCMovement_edda + dw NPCMovement_ede4 + dw NPCMovement_edda + dw NPCMovement_edda + +NPCMovement_edda: ; edda (3:6dda) + db EAST + db NORTH + db EAST + db EAST + db EAST + db EAST + db EAST + db EAST + db EAST + db $ff + +NPCMovement_ede4: ; ede4 (3:6de4) + db NORTH + db EAST + db $fe, -11 Script_Chap3: ; ede8 (3:6de8) - INCROM $ede8, $ee2c + start_script + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $07, .ows_ee1f + jump_if_flag_nonzero_2 EVENT_ISHIHARA_MET, .ows_edfb + max_out_flag_value EVENT_ISHIHARA_MENTIONED + max_out_flag_value EVENT_ISHIHARAS_HOUSE_MENTIONED + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0695 + +.ows_edfb + jump_if_flag_nonzero_2 EVENT_TEMP_TRADED_WITH_ISHIHARA, .ows_ee1c + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $05, .ows_ee13 + jump_if_flag_not_less_than EVENT_ISHIHARA_TRADE_STATE, $03, .ows_ee0e + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0696 + +.ows_ee0e + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0697 + +.ows_ee13 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_ee1c + max_out_flag_value EVENT_ISHIHARA_WANTS_TO_TRADE + print_text_quit_fully Text0698 + +.ows_ee1c + print_text_quit_fully Text0699 + +.ows_ee1f + script_set_flag_value EVENT_ISHIHARA_TRADE_STATE, $08 + print_text_quit_fully Text069a + +Preload_Lad2: ; ee25 (3:6e25) + get_flag_value EVENT_LAD2_STATE + cp $01 + ret Script_Lad2: ; ee2c (3:6e2c) - INCROM $ee2c, $ee76 + start_script + try_give_medal_pc_packs + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $03, .ows_ee36 + print_text_quit_fully Text069b + +.ows_ee36 + print_npc_text Text069c + ask_question_jump Text069d, .ows_ee4a + print_npc_text Text069e + script_set_flag_value EVENT_LAD2_STATE, $02 + close_text_box + move_active_npc_by_direction NPCMovementTable_ee61 + unload_active_npc + quit_script_fully + +.ows_ee4a + jump_if_any_energy_cards_in_collection .ows_ee51 + print_npc_text Text069f + quit_script_fully + +.ows_ee51 + remove_all_energy_cards_from_collection + print_text Text06a0 + print_npc_text Text06a1 + script_set_flag_value EVENT_LAD2_STATE, $01 + close_text_box + move_active_npc_by_direction NPCMovementTable_ee61 + unload_active_npc + quit_script_fully + +NPCMovementTable_ee61: ; ee61 (3:6e61) + dw NPCMovement_ee69 + dw NPCMovement_ee72 + dw NPCMovement_ee69 + dw NPCMovement_ee69 + +NPCMovement_ee69: ; ee69 (3:6e69) + db EAST + db SOUTH + db SOUTH + db SOUTH + db EAST + db EAST + db EAST + db EAST + db $ff + +NPCMovement_ee72: ; ee72 (3:6e72) + db SOUTH + db EAST + db $fe, -10 Script_ee76: ; ee76 (3:6e76) start_script - jump_if_flag_equal EVENT_FLAG_21, $01, .ows_ee7d + jump_if_flag_equal EVENT_LAD2_STATE, $01, .ows_ee7d quit_script_fully .ows_ee7d - script_set_flag_value EVENT_FLAG_21, $02 - run_command Func_ccdc - tx Text06a2 + script_set_flag_value EVENT_LAD2_STATE, $02 + print_text FoundLv9SlowpokeText give_card SLOWPOKE1 show_card_received_screen SLOWPOKE1 quit_script_fully -; 0xee88 Script_Mania: ; ee88 (3:6e88) - INCROM $ee88, $ee93 - + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text06a3, Text06a4 + quit_script_fully -FireClubAfterDuel: ;ee93 (3:6e93) +FireClubAfterDuel: ; ee93 (3:6e93) ld hl, .after_duel_table - call FindEndOfBattleScript + call FindEndOfDuelScript ret .after_duel_table db NPC_JOHN db NPC_JOHN - dw $6ec8 - dw $6ed4 + dw Script_BeatJohn + dw Script_LostToJohn db NPC_ADAM db NPC_ADAM - dw $6eed - dw $6ef9 + dw Script_BeatAdam + dw Script_LostToAdam db NPC_JONATHAN db NPC_JONATHAN - dw $6f12 - dw $6f1e + dw Script_BeatJonathan + dw Script_LostToJonathan db NPC_KEN db NPC_KEN dw Script_BeatKen - dw Script_LoseToKen - + dw Script_LostToKen db $00 -; 0xeeb3 Script_John: ; eeb3 (3:6eb3) - INCROM $eeb3, $eed8 + start_script + print_npc_text Text06a5 + ask_question_jump Text06a6, .ows_eec0 + print_npc_text Text06a7 + quit_script_fully + +.ows_eec0 + print_npc_text Text06a8 + start_duel PRIZES_4, ANGER_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatJohn: ; eec8 (3:6ec8) + start_script + print_npc_text Text06a9 + give_booster_packs BOOSTER_EVOLUTION_FIRE, BOOSTER_EVOLUTION_FIRE, NO_BOOSTER + print_npc_text Text06aa + quit_script_fully + +Script_LostToJohn: ; eed4 (3:6ed4) + start_script + print_text_quit_fully Text06ab Script_Adam: ; eed8 (3:6ed8) - INCROM $eed8, $eefd + start_script + print_npc_text Text06ac + ask_question_jump Text06ad, .ows_eee5 + print_npc_text Text06ae + quit_script_fully + +.ows_eee5 + print_npc_text Text06af + start_duel PRIZES_4, FLAMETHROWER_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatAdam: ; eeed (3:6eed) + start_script + print_npc_text Text06b0 + give_booster_packs BOOSTER_COLOSSEUM_FIRE, BOOSTER_COLOSSEUM_FIRE, NO_BOOSTER + print_npc_text Text06b1 + quit_script_fully + +Script_LostToAdam: ; eef9 (3:6ef9) + start_script + print_text_quit_fully Text06b2 Script_Jonathan: ; eefd (3:6efd) - INCROM $eefd, $ef22 + start_script + print_npc_text Text06b3 + ask_question_jump Text06b4, .ows_ef0a + print_npc_text Text06b5 + quit_script_fully + +.ows_ef0a + print_npc_text Text06b6 + start_duel PRIZES_4, RESHUFFLE_DECK_ID, MUSIC_DUEL_THEME_1 + quit_script_fully + +Script_BeatJonathan: ; ef12 (3:6f12) + start_script + print_npc_text Text06b7 + give_booster_packs BOOSTER_COLOSSEUM_FIRE, BOOSTER_COLOSSEUM_FIRE, NO_BOOSTER + print_npc_text Text06b8 + quit_script_fully + +Script_LostToJonathan: ; ef1e (3:6f1e) + start_script + print_text_quit_fully Text06b9 Script_Ken: ; ef22 (3:6f22) start_script try_give_pc_pack $09 - jump_if_flag_nonzero_2 EVENT_FLAG_23, .have_300_cards + jump_if_flag_nonzero_2 EVENT_KEN_HAD_ENOUGH_CARDS, .have_300_cards jump_if_enough_cards_owned 300, .have_300_cards - jump_if_flag_zero_1 EVENT_FLAG_24, NULL - print_variable_text Text06ba, Text06bb - script_set_flag_value EVENT_FLAG_24, $01 + jump_if_flag_zero_1 EVENT_KEN_TALKED, NULL + print_variable_npc_text Text06ba, Text06bb + script_set_flag_value EVENT_KEN_TALKED, $01 quit_script_fully + .have_300_cards - max_out_flag_value EVENT_FLAG_23 - jump_if_flag_nonzero_2 EVENT_FLAG_0A, Script_KenBattle_AlreadyHaveMedal - jump_if_flag_zero_1 EVENT_FLAG_24, NULL - print_variable_text Text06bc, Text06bd - script_set_flag_value EVENT_FLAG_24, $01 - ask_question_jump Text06be, .do_battle - print_text_string Text06bf + max_out_flag_value EVENT_KEN_HAD_ENOUGH_CARDS + jump_if_flag_nonzero_2 EVENT_BEAT_KEN, Script_Ken_AlreadyHaveMedal + jump_if_flag_zero_1 EVENT_KEN_TALKED, NULL + print_variable_npc_text Text06bc, Text06bd + script_set_flag_value EVENT_KEN_TALKED, $01 + ask_question_jump Text06be, .start_duel + print_npc_text Text06bf quit_script_fully -.do_battle - print_text_string Text06c0 - start_battle PRIZES_6, FIRE_CHARGE_DECK_ID, MUSIC_DUEL_THEME_2 + +.start_duel + print_npc_text Text06c0 + start_duel PRIZES_6, FIRE_CHARGE_DECK_ID, MUSIC_DUEL_THEME_2 quit_script_fully -; 0xef5e Script_BeatKen: ; ef5e (3:6f5e) start_script - print_text_string Text06c1 - jump_if_flag_nonzero_2 EVENT_FLAG_0A, .give_booster_packs - max_out_flag_value EVENT_FLAG_0A + print_npc_text Text06c1 + jump_if_flag_nonzero_2 EVENT_BEAT_KEN, .give_booster_packs + max_out_flag_value EVENT_BEAT_KEN try_give_medal_pc_packs - run_command Func_d125 - db $0a - run_command Func_d435 - db $08 - print_text_string Text06c2 + show_medal_received_screen EVENT_BEAT_KEN + record_master_win $08 + print_npc_text Text06c2 .give_booster_packs give_booster_packs BOOSTER_MYSTERY_NEUTRAL, BOOSTER_MYSTERY_NEUTRAL, NO_BOOSTER - print_text_string Text06c3 + print_npc_text Text06c3 quit_script_fully -; 0xef78 - - -Script_LoseToKen: ; ef78 (3:6f78) +Script_LostToKen: ; ef78 (3:6f78) start_script - jump_if_flag_zero_2 EVENT_FLAG_0A, NULL - print_variable_text Text06c4, Text06c5 + jump_if_flag_zero_2 EVENT_BEAT_KEN, NULL + print_variable_npc_text Text06c4, Text06c5 quit_script_fully -; 0xef83 -Script_KenBattle_AlreadyHaveMedal: ; ef83 (3:6f83) - print_text_string Text06c6 - ask_question_jump Text06be, .do_battle +Script_Ken_AlreadyHaveMedal: ; ef83 (3:6f83) + print_npc_text Text06c6 + ask_question_jump Text06be, .start_duel print_text_quit_fully Text06bf -.do_battle - print_text_string Text06c7 - start_battle PRIZES_6, FIRE_CHARGE_DECK_ID, MUSIC_DUEL_THEME_2 + +.start_duel + print_npc_text Text06c7 + start_duel PRIZES_6, FIRE_CHARGE_DECK_ID, MUSIC_DUEL_THEME_2 quit_script_fully -; 0xef96 Preload_Clerk9: ; ef96 (3:6f96) call TryGiveMedalPCPacks get_flag_value EVENT_MEDAL_COUNT - ld hl, .jumpTable + ld hl, .jump_table cp $09 jp c, JumpToFunctionInTable debug_ret - jr .asm_efe4 - -.jumpTable - dw .asm_efe4 - dw .asm_efe4 - dw .asm_efe4 - dw .asm_efba - dw .asm_efde - dw .asm_efc9 - dw .asm_efd8 - dw .asm_efd8 - dw .asm_efd8 - -.asm_efba - get_flag_value EVENT_FLAG_3F + jr .less_than_three_medals + +.jump_table + dw .less_than_three_medals + dw .less_than_three_medals + dw .less_than_three_medals + dw .three_medals + dw .four_medals + dw .five_medals + dw .more_than_five_medals + dw .more_than_five_medals + dw .more_than_five_medals + +.three_medals + get_flag_value EVENT_CHALLENGE_CUP_1_STATE or a - jr nz, .asm_efe4 + jr nz, .less_than_three_medals ld c, $01 - set_flag_value EVENT_FLAG_3F - jr .asm_efe4 + set_flag_value EVENT_CHALLENGE_CUP_1_STATE + jr .less_than_three_medals -.asm_efc9 - get_flag_value EVENT_FLAG_40 +.five_medals + get_flag_value EVENT_CHALLENGE_CUP_2_STATE or a - jr nz, .asm_efde + jr nz, .four_medals ld c, $01 - set_flag_value EVENT_FLAG_40 - jr .asm_efde + set_flag_value EVENT_CHALLENGE_CUP_2_STATE + jr .four_medals -.asm_efd8 +.more_than_five_medals ld c, $07 - set_flag_value EVENT_FLAG_40 -.asm_efde + set_flag_value EVENT_CHALLENGE_CUP_2_STATE +.four_medals ld c, $07 - set_flag_value EVENT_FLAG_3F -.asm_efe4 - zero_flag_value EVENT_FLAG_42 - get_flag_value EVENT_FLAG_3F + set_flag_value EVENT_CHALLENGE_CUP_1_STATE +.less_than_three_medals + zero_flag_value EVENT_CHALLENGE_CUP_STARTING + get_flag_value EVENT_CHALLENGE_CUP_1_STATE cp $00 - jr z, .asm_eff8 + jr z, .check_challenge_cup_two cp $07 - jr z, .asm_eff8 + jr z, .check_challenge_cup_two ld c, $01 - jr .asm_f016 + jr .start_challenge_cup -.asm_eff8 - get_flag_value EVENT_FLAG_40 +.check_challenge_cup_two + get_flag_value EVENT_CHALLENGE_CUP_2_STATE cp $00 - jr z, .asm_f008 + jr z, .check_challenge_cup_three cp $07 - jr z, .asm_f008 + jr z, .check_challenge_cup_three ld c, $02 - jr .asm_f016 + jr .start_challenge_cup -.asm_f008 - get_flag_value EVENT_FLAG_41 +.check_challenge_cup_three + get_flag_value EVENT_CHALLENGE_CUP_3_STATE cp $00 - jr z, .asm_f023 + jr z, .no_challenge_cup cp $07 - jr z, .asm_f023 + jr z, .no_challenge_cup ld c, $03 -.asm_f016 - set_flag_value EVENT_FLAG_44 - max_flag_value EVENT_FLAG_42 - ld a, $0b +.start_challenge_cup + set_flag_value EVENT_CHALLENGE_CUP_NUMBER + max_flag_value EVENT_CHALLENGE_CUP_STARTING + ld a, MUSIC_CHALLENGE_HALL ld [wd111], a -.asm_f023 +.no_challenge_cup scf ret Script_Clerk9: ; f025 (3:7025) start_script - jump_if_flag_zero_1 EVENT_FLAG_3F, .ows_f066 - jump_if_flag_equal EVENT_FLAG_41, $07, .ows_f069 - jump_if_flag_equal EVENT_FLAG_41, $03, .ows_f06f - jump_if_flag_equal EVENT_FLAG_41, $02, .ows_f072 - jump_if_flag_equal EVENT_FLAG_41, $01, .ows_f06c - jump_if_flag_equal EVENT_FLAG_40, $07, .ows_f069 - jump_if_flag_equal EVENT_FLAG_40, $03, .ows_f06f - jump_if_flag_equal EVENT_FLAG_40, $02, .ows_f072 - jump_if_flag_equal EVENT_FLAG_40, $01, .ows_f06c - jump_if_flag_equal EVENT_FLAG_3F, $07, .ows_f069 - jump_if_flag_equal EVENT_FLAG_3F, $03, .ows_f06f - jump_if_flag_equal EVENT_FLAG_3F, $02, .ows_f072 - jump_if_flag_equal EVENT_FLAG_3F, $01, .ows_f06c + jump_if_flag_zero_1 EVENT_CHALLENGE_CUP_1_STATE, .ows_f066 + jump_if_flag_equal EVENT_CHALLENGE_CUP_3_STATE, $07, .ows_f069 + jump_if_flag_equal EVENT_CHALLENGE_CUP_3_STATE, $03, .ows_f06f + jump_if_flag_equal EVENT_CHALLENGE_CUP_3_STATE, $02, .ows_f072 + jump_if_flag_equal EVENT_CHALLENGE_CUP_3_STATE, $01, .ows_f06c + jump_if_flag_equal EVENT_CHALLENGE_CUP_2_STATE, $07, .ows_f069 + jump_if_flag_equal EVENT_CHALLENGE_CUP_2_STATE, $03, .ows_f06f + jump_if_flag_equal EVENT_CHALLENGE_CUP_2_STATE, $02, .ows_f072 + jump_if_flag_equal EVENT_CHALLENGE_CUP_2_STATE, $01, .ows_f06c + jump_if_flag_equal EVENT_CHALLENGE_CUP_1_STATE, $07, .ows_f069 + jump_if_flag_equal EVENT_CHALLENGE_CUP_1_STATE, $03, .ows_f06f + jump_if_flag_equal EVENT_CHALLENGE_CUP_1_STATE, $02, .ows_f072 + jump_if_flag_equal EVENT_CHALLENGE_CUP_1_STATE, $01, .ows_f06c .ows_f066 print_text_quit_fully Text050a @@ -5195,23 +7553,23 @@ Preload_ChallengeHallNPCs2: ; f075 (3:7075) ret Preload_ChallengeHallNPCs1: ; f07a (3:707a) - get_flag_value EVENT_FLAG_42 + get_flag_value EVENT_CHALLENGE_CUP_STARTING or a jr z, .quit - ld a, $0b + ld a, MUSIC_CHALLENGE_HALL ld [wd111], a scf .quit ret ChallengeHallLobbyLoadMap: ; f088 (3:7088) - get_flag_value EVENT_FLAG_58 + get_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE or a ret z - ld a, $02 + ld a, NPC_RONALD1 ld [wTempNPC], a call FindLoadedNPC - ld bc, $7166 + ld bc, Script_f166 jp SetNextNPCAndScript Script_Pappy3: ; f09c (3:709c) @@ -5239,87 +7597,194 @@ Script_Chap5: ; f0b0 (3:70b0) print_text_quit_fully Text0514 Preload_ChallengeHallLobbyRonald1: ; f0b4 (3:70b4) - zero_flag_value2 EVENT_FLAG_58 - get_flag_value EVENT_RECEIVED_LEGENDARY_CARD + zero_flag_value2 EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS or a - jr nz, .asm_f0ff - get_flag_value EVENT_FLAG_59 + jr nz, .challenge_cup_2_ended + get_flag_value EVENT_PLAYER_ENTERED_CHALLENGE_CUP or a - jr nz, .asm_f11f - get_flag_value EVENT_FLAG_40 + jr nz, .dont_load + get_flag_value EVENT_CHALLENGE_CUP_2_STATE cp $00 - jr z, .asm_f0e5 - call .asm_710f - get_flag_value EVENT_FLAG_40 + jr z, .check_challenge_cup_1 + call .challenge_cup_1_ended + get_flag_value EVENT_CHALLENGE_CUP_2_STATE ld e, a - get_flag_value EVENT_FLAG_49 + get_flag_value EVENT_CHALLENGE_CUP_2_RESULT ld d, a - ld hl, Unknown_f156 - call Func_f121 - jr nc, .asm_f11f - jr .asm_f0f7 -.asm_f0e5 - get_flag_value EVENT_FLAG_3F + ld hl, RonaldChallengeHallLobbyCup2States + call SetRonaldChallengeHallLobbyState + jr nc, .dont_load + jr .load_ronald + +.check_challenge_cup_1 + get_flag_value EVENT_CHALLENGE_CUP_1_STATE ld e, a - get_flag_value EVENT_FLAG_48 + get_flag_value EVENT_CHALLENGE_CUP_1_RESULT ld d, a - ld hl, Unknown_f146 - call Func_f121 - jr nc, .asm_f11f -.asm_f0f7 + ld hl, RonaldChallengeHallLobbyCup1States + call SetRonaldChallengeHallLobbyState + jr nc, .dont_load +.load_ronald ld a, [wPlayerYCoord] ld [wLoadNPCYPos], a scf ret -.asm_f0ff - max_flag_value EVENT_FLAG_54 - max_flag_value EVENT_FLAG_55 - max_flag_value EVENT_FLAG_56 - max_flag_value EVENT_FLAG_57 -.asm_710f - max_flag_value EVENT_FLAG_50 - max_flag_value EVENT_FLAG_51 - max_flag_value EVENT_FLAG_52 - max_flag_value EVENT_FLAG_53 -.asm_f11f + +.challenge_cup_2_ended + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_5 + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_6 + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_7 + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_8 +.challenge_cup_1_ended + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_1 + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_2 + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_3 + max_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_4 +.dont_load or a ret -Func_f121: ; f121 (3:7121) +SetRonaldChallengeHallLobbyState: ; f121 (3:7121) ld c, $04 -.asm_f123 +.loop ld a, [hli] cp e - jr nz, .asm_f13e + jr nz, .next_inc ld a, [hli] cp d - jr nz, .asm_f13f + jr nz, .next ld a, [hl] call GetEventFlagValue or a - jr nz, .asm_f13f + jr nz, .next ld a, [hl] call MaxOutEventFlag inc hl ld c, [hl] - set_flag_value EVENT_FLAG_58 + set_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE scf ret -.asm_f13e + +.next_inc inc hl -.asm_f13f +.next inc hl inc hl dec c - jr nz, .asm_f123 + jr nz, .loop or a ret -Unknown_f146: ; f146 (3:7146) - INCROM $f146, $f156 +RonaldChallengeHallLobbyCup1States: ; f146 (3:7146) + db $01, $00, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_1, $01 + db $03, $03, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_2, $02 + db $07, $03, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_3, $03 + db $07, $00, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_4, $04 + +RonaldChallengeHallLobbyCup2States: ; f156 (3:7156) + db $01, $00, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_5, $05 + db $03, $03, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_6, $06 + db $07, $03, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_7, $07 + db $07, $00, EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_8, $08 + +Script_f166: ; f166 (3:7166) + start_script + move_active_npc NPCMovement_f232 + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $01, .ows_f192 + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $02, .ows_f1a5 + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $03, .ows_f1b8 + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $04, .ows_f1cb + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $05, .ows_f1de + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $06, .ows_f1f1 + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $07, .ows_f204 + jump_if_flag_equal EVENT_RONALD_CHALLENGE_HALL_LOBBY_STATE, $08, .ows_f217 +.ows_f192 + print_npc_text Text0515 + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text0516 + script_jump .ows_f227 + +.ows_f1a5 + print_npc_text Text0517 + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text0518 + script_jump .ows_f227 + +.ows_f1b8 + print_npc_text Text0519 + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text051a + script_jump .ows_f227 + +.ows_f1cb + print_npc_text Text051b + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text051c + script_jump .ows_f227 + +.ows_f1de + print_npc_text Text051d + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text051e + script_jump .ows_f227 + +.ows_f1f1 + print_npc_text Text051f + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text0520 + script_jump .ows_f227 -Unknown_f156: ; f156 (3:7156) - INCROM $f156, $f239 +.ows_f204 + print_npc_text Text0521 + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text0522 + script_jump .ows_f227 + +.ows_f217 + print_npc_text Text0523 + close_text_box + move_player WEST, 1 + move_player WEST, 1 + move_player WEST, 1 + print_npc_text Text0524 +.ows_f227 + close_text_box + set_player_direction SOUTH + move_player NORTH, 4 + move_active_npc NPCMovement_f232 + unload_active_npc + quit_script_fully + +NPCMovement_f232: ; f232 (3:7232) + db EAST + db EAST + db EAST + db EAST + db EAST + db EAST + db $ff ChallengeHallAfterDuel: ; f239 (3:7239) ld c, $00 @@ -5339,11 +7804,11 @@ ChallengeHallAfterDuel: ; f239 (3:7239) jp SetNextNPCAndScript ChallengeHallAfterDuelTable: - dw WonAtChallengeHall - dw LostAtChallengeHall + dw Script_WonAtChallengeHall + dw Script_LostAtChallengeHall ChallengeHallLoadMap: ; f258 (3:7258) - get_flag_value EVENT_FLAG_47 + get_flag_value EVENT_CHALLENGE_CUP_IN_MENU or a ret z ld a, NPC_HOST @@ -5357,7 +7822,7 @@ Script_Clerk13: ; f26c (3:726c) print_text_quit_fully Text0525 Preload_Guide: ; f270 (3:7270) - get_flag_value EVENT_FLAG_42 + get_flag_value EVENT_CHALLENGE_CUP_STARTING or a jr z, .asm_f281 ld a, $1c @@ -5370,11 +7835,11 @@ Preload_Guide: ; f270 (3:7270) Script_Guide: ; f283 (3:7283) start_script - jump_if_flag_zero_2 EVENT_FLAG_42, .ows_f28b + jump_if_flag_zero_2 EVENT_CHALLENGE_CUP_STARTING, .ows_f28b print_text_quit_fully Text0526 .ows_f28b - jump_if_flag_zero_1 EVENT_FLAG_3F, .ows_f292 + jump_if_flag_zero_1 EVENT_CHALLENGE_CUP_1_STATE, .ows_f292 print_text_quit_fully Text0527 .ows_f292 @@ -5382,14 +7847,14 @@ Script_Guide: ; f283 (3:7283) Script_Clerk12: ; f295 (3:7295) start_script - jump_if_flag_equal EVENT_FLAG_41, $03, .ows_f2c4 - jump_if_flag_equal EVENT_FLAG_41, $02, .ows_f2c1 - jump_if_flag_equal EVENT_FLAG_40, $03, .ows_f2c4 - jump_if_flag_equal EVENT_FLAG_40, $02, .ows_f2c1 - jump_if_flag_equal EVENT_FLAG_3F, $03, .ows_f2c4 - jump_if_flag_equal EVENT_FLAG_3F, $02, .ows_f2c1 - jump_if_flag_equal EVENT_FLAG_44, $02, .ows_f2cd - jump_if_flag_equal EVENT_FLAG_44, $03, .ows_f2d3 + jump_if_flag_equal EVENT_CHALLENGE_CUP_3_STATE, $03, .ows_f2c4 + jump_if_flag_equal EVENT_CHALLENGE_CUP_3_STATE, $02, .ows_f2c1 + jump_if_flag_equal EVENT_CHALLENGE_CUP_2_STATE, $03, .ows_f2c4 + jump_if_flag_equal EVENT_CHALLENGE_CUP_2_STATE, $02, .ows_f2c1 + jump_if_flag_equal EVENT_CHALLENGE_CUP_1_STATE, $03, .ows_f2c4 + jump_if_flag_equal EVENT_CHALLENGE_CUP_1_STATE, $02, .ows_f2c1 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $02, .ows_f2cd + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $03, .ows_f2d3 script_jump .ows_f2c7 .ows_f2c1 @@ -5399,23 +7864,23 @@ Script_Clerk12: ; f295 (3:7295) print_text_quit_fully Text052a .ows_f2c7 - print_text_string Text052b + print_npc_text Text052b script_jump .ows_f2d6 .ows_f2cd - print_text_string Text052c + print_npc_text Text052c script_jump .ows_f2d6 .ows_f2d3 - print_text_string Text052d + print_npc_text Text052d .ows_f2d6 - print_text_string Text052e + print_npc_text Text052e ask_question_jump Text052f, .ows_f2e1 print_text_quit_fully Text0530 .ows_f2e1 - max_out_flag_value EVENT_FLAG_59 - print_text_string Text0531 + max_out_flag_value EVENT_PLAYER_ENTERED_CHALLENGE_CUP + print_npc_text Text0531 close_text_box move_active_npc NPCMovement_f349 jump_if_player_coords_match 8, 18, .ows_f2fa @@ -5438,8 +7903,8 @@ Script_Clerk12: ; f295 (3:7295) move_player NORTH, 1 move_player NORTH, 1 move_player NORTH, 1 - jump_if_flag_nonzero_2 EVENT_FLAG_43, .ows_f33a - max_out_flag_value EVENT_FLAG_43 + jump_if_flag_nonzero_2 EVENT_CHALLENGE_CUP_STAGE_VISITED, .ows_f33a + max_out_flag_value EVENT_CHALLENGE_CUP_STAGE_VISITED move_player NORTH, 1 move_player NORTH, 1 set_player_direction EAST @@ -5457,17 +7922,14 @@ Script_Clerk12: ; f295 (3:7295) move_player EAST, 1 move_active_npc NPCMovement_f34e close_advanced_text_box - set_next_npc_and_script $4a, Script_f353 - end_script_loop + set_next_npc_and_script NPC_HOST, Script_f353 + end_script ret -; f349 NPCMovement_f349: ; f349 (3:7349) db NORTH db NORTH db EAST -; fallthrough - NPCMovement_f34c: ; f34c (3:734c) db WEST | NO_MOVE db $ff @@ -5487,22 +7949,18 @@ Script_f353: ; f353 (3:7353) move_active_npc NPCMovement_f37d do_frames 20 move_active_npc NPCMovement_f390 - run_command Func_d16b - db $00 - print_text_string Text0532 + load_challenge_hall_npc_into_txram_slot $00 + print_npc_text Text0532 close_text_box move_active_npc NPCMovement_f37f - print_text_string Text0533 + print_npc_text Text0533 close_text_box move_active_npc NPCMovement_f388 - print_text_string Text0534 + print_npc_text Text0534 close_text_box move_active_npc NPCMovement_f38e - print_text_string Text0535 - run_command Func_cd4f - db $04 - db $00 - db $00 + print_npc_text Text0535 + start_challenge_hall_duel PRIZES_4, SAMS_PRACTICE_DECK_ID, MUSIC_STOP quit_script_fully NPCMovement_f37d: ; f37d (3:737d) @@ -5526,8 +7984,6 @@ NPCMovement_f388: ; f388 (3:7388) db NORTH db WEST db WEST -; fallthrough - NPCMovement_f38b: ; f38b (3:738b) db WEST db SOUTH @@ -5536,50 +7992,49 @@ NPCMovement_f38b: ; f38b (3:738b) NPCMovement_f38e: ; f38e (3:738e) db NORTH db EAST -; fallthrough - NPCMovement_f390: ; f390 (3:7390) db SOUTH | NO_MOVE db $ff -LostAtChallengeHall: ; f392 (3:7392) +Script_LostAtChallengeHall: ; f392 (3:7392) start_script do_frames 20 move_active_npc NPCMovement_f37d do_frames 20 move_active_npc NPCMovement_f390 - jump_if_flag_equal EVENT_FLAG_45, $02, ScriptJump_f410 - jump_if_flag_equal EVENT_FLAG_45, $03, ScriptJump_f410.ows_f41a - run_command Func_d16b - db $00 - run_command Func_d16b - db $01 - print_text_string Text0536 + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $02, Script_f410 + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $03, Script_f410.ows_f41a + load_challenge_hall_npc_into_txram_slot $00 + load_challenge_hall_npc_into_txram_slot $01 + print_npc_text Text0536 .ows_f3ae close_text_box move_active_npc NPCMovement_f38b - print_text_string Text0537 + print_npc_text Text0537 close_text_box move_active_npc NPCMovement_f38e - jump_if_flag_equal EVENT_FLAG_44, $02, .ows_f3ce - jump_if_flag_equal EVENT_FLAG_44, $03, .ows_f3d9 - script_set_flag_value EVENT_FLAG_3F, $03 - script_set_flag_value EVENT_FLAG_48, $03 - zero_out_flag_value EVENT_FLAG_51 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $02, .ows_f3ce + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $03, .ows_f3d9 + script_set_flag_value EVENT_CHALLENGE_CUP_1_STATE, $03 + script_set_flag_value EVENT_CHALLENGE_CUP_1_RESULT, $03 + zero_out_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_2 script_jump .ows_f3e2 + .ows_f3ce - script_set_flag_value EVENT_FLAG_40, $03 - script_set_flag_value EVENT_FLAG_49, $03 - zero_out_flag_value EVENT_FLAG_55 + script_set_flag_value EVENT_CHALLENGE_CUP_2_STATE, $03 + script_set_flag_value EVENT_CHALLENGE_CUP_2_RESULT, $03 + zero_out_flag_value EVENT_RONALD_CHALLENGE_HALL_LOBBY_CONVO_6 script_jump .ows_f3e2 + .ows_f3d9 - script_set_flag_value EVENT_FLAG_41, $03 - script_set_flag_value EVENT_FLAG_4A, $03 + script_set_flag_value EVENT_CHALLENGE_CUP_3_STATE, $03 + script_set_flag_value EVENT_CHALLENGE_CUP_3_RESULT, $03 script_jump .ows_f3e2 + .ows_f3e2 close_advanced_text_box set_next_npc_and_script NPC_CLERK12, Script_f3e9 - end_script_loop + end_script ret Script_f3e9: ; f3e9 (3:73e9) @@ -5607,23 +8062,21 @@ NPCMovement_f40d: ; f40d (3:740d) db SOUTH | NO_MOVE db $ff -ScriptJump_f410: ; f410 (4:7410) - run_command Func_d16b - db $00 - run_command Func_d16b - db $01 - print_text_string Text0538 - script_jump LostAtChallengeHall.ows_f3ae +Script_f410: ; f410 (3:7410) + load_challenge_hall_npc_into_txram_slot $00 + load_challenge_hall_npc_into_txram_slot $01 + print_npc_text Text0538 + script_jump Script_LostAtChallengeHall.ows_f3ae .ows_f41a - print_text_string Text0539 + print_npc_text Text0539 set_dialog_npc NPC_RONALD1 - jump_if_flag_equal EVENT_FLAG_44, $03, .ows_f42e - jump_if_flag_equal EVENT_FLAG_44, $01, NULL - print_variable_text Text053a, Text053b + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $03, .ows_f42e + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $01, NULL + print_variable_npc_text Text053a, Text053b .ows_f42e set_dialog_npc NPC_HOST - script_jump LostAtChallengeHall.ows_f3ae + script_jump Script_LostAtChallengeHall.ows_f3ae Script_f433: ; f433 (3:7433) start_script @@ -5631,64 +8084,58 @@ Script_f433: ; f433 (3:7433) move_active_npc NPCMovement_f37d do_frames 20 move_active_npc NPCMovement_f390 - script_jump WonAtChallengeHall.ows_f4a4 + script_jump Script_WonAtChallengeHall.ows_f4a4 -WonAtChallengeHall: ; f441 (3:7441) +Script_WonAtChallengeHall: ; f441 (3:7441) start_script do_frames 20 move_active_npc NPCMovement_f37d do_frames 20 move_active_npc NPCMovement_f390 - jump_if_flag_equal EVENT_FLAG_45, $03, ScriptJump_f4db - jump_if_flag_equal EVENT_FLAG_45, $02, .ows_f456 + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $03, Script_f4db + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $02, .ows_f456 .ows_f456 - jump_if_flag_equal EVENT_FLAG_45, $01, NULL - print_variable_text Text053c, Text053d + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $01, NULL + print_variable_npc_text Text053c, Text053d move_active_npc NPCMovement_f37f - run_command Func_d16b - db $00 - print_text_string Text053e + load_challenge_hall_npc_into_txram_slot $00 + print_npc_text Text053e close_text_box - move_wram_npc NPCMovement_f4c8 - run_command Func_cdd8 - print_text_string Text053f + move_challenge_hall_npc NPCMovement_f4c8 + unload_challenge_hall_npc + print_npc_text Text053f close_text_box - run_command Func_d195 - run_command Func_cdf5 - db $14 - db $14 - move_wram_npc NPCMovement_f4d0 - run_command Func_d16b - db $00 - jump_if_flag_equal EVENT_FLAG_45, $02, NULL - print_variable_text Text0540, Text0541 + pick_challenge_hall_opponent + set_challenge_hall_npc_coords 20, 20 + move_challenge_hall_npc NPCMovement_f4d0 + load_challenge_hall_npc_into_txram_slot $00 + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $02, NULL + print_variable_npc_text Text0540, Text0541 move_active_npc NPCMovement_f383 - jump_if_flag_equal EVENT_FLAG_45, $02, .ows_f4a4 - jump_if_flag_equal EVENT_FLAG_44, $03, .ows_f4a1 + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $02, .ows_f4a4 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $03, .ows_f4a1 close_text_box - set_dialog_npc $02 - jump_if_flag_equal EVENT_FLAG_44, $01, NULL - print_variable_text Text0542, Text0543 + set_dialog_npc NPC_RONALD1 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $01, NULL + print_variable_npc_text Text0542, Text0543 set_dialog_npc NPC_HOST close_text_box .ows_f4a1 - print_text_string Text0544 + print_npc_text Text0544 .ows_f4a4 - zero_out_flag_value EVENT_FLAG_47 - print_text_string Text0545 + zero_out_flag_value EVENT_CHALLENGE_CUP_IN_MENU + print_npc_text Text0545 ask_question_jump_default_yes Text0546, .ows_f4bd - jump_if_flag_equal EVENT_FLAG_45, $02, NULL - print_variable_text Text0547, Text0548 - run_command Func_cd4f - db $04 - db $00 - db $00 + jump_if_flag_equal EVENT_CHALLENGE_CUP_OPPONENT_NUMBER, $02, NULL + print_variable_npc_text Text0547, Text0548 + start_challenge_hall_duel PRIZES_4, SAMS_PRACTICE_DECK_ID, MUSIC_STOP quit_script_fully + .ows_f4bd - print_text_string Text0549 + print_npc_text Text0549 close_text_box - max_out_flag_value EVENT_FLAG_47 - run_command Func_d1ad + max_out_flag_value EVENT_CHALLENGE_CUP_IN_MENU + open_menu close_text_box script_jump .ows_f4a4 @@ -5718,201 +8165,1103 @@ NPCMovement_f4d8: ; f4d8 (3:74d8) db SOUTH | NO_MOVE db $ff -ScriptJump_f4db: ; f4db (3:74db) - print_text_string Text054a +Script_f4db: ; f4db (3:74db) + print_npc_text Text054a move_active_npc NPCMovement_f37f - run_command Func_d16b - db $00 - print_text_string Text054b + load_challenge_hall_npc_into_txram_slot $00 + print_npc_text Text054b close_text_box - jump_if_flag_equal EVENT_FLAG_44, $03, .ows_f513 - set_dialog_npc $02 - jump_if_flag_equal EVENT_FLAG_44, $01, NULL - print_variable_text Text054c, Text054d - move_wram_npc NPCMovement_f4d8 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $03, .ows_f513 + set_dialog_npc NPC_RONALD1 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $01, NULL + print_variable_npc_text Text054c, Text054d + move_challenge_hall_npc NPCMovement_f4d8 do_frames 40 - move_wram_npc NPCMovement_f34c - jump_if_flag_equal EVENT_FLAG_44, $01, NULL - print_variable_text Text054e, Text054f + move_challenge_hall_npc NPCMovement_f34c + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $01, NULL + print_variable_npc_text Text054e, Text054f set_dialog_npc NPC_HOST close_text_box - move_wram_npc NPCMovement_f4c9 + move_challenge_hall_npc NPCMovement_f4c9 script_jump .ows_f516 + .ows_f513 - move_wram_npc NPCMovement_f4c8 + move_challenge_hall_npc NPCMovement_f4c8 .ows_f516 - run_command Func_cdd8 + unload_challenge_hall_npc move_active_npc NPCMovement_f383 - print_text_string Text0550 + print_npc_text Text0550 close_text_box move_active_npc NPCMovement_f38b - run_command Func_d1b3 - print_text_string Text0551 + pick_challenge_cup_prize_card + print_npc_text Text0551 give_card VARIABLE_CARD - show_card_received_screen $00 - print_text_string Text0552 + show_card_received_screen VARIABLE_CARD + print_npc_text Text0552 close_text_box - jump_if_flag_equal EVENT_FLAG_44, $02, .ows_f540 - jump_if_flag_equal EVENT_FLAG_44, $03, .ows_f549 - script_set_flag_value EVENT_FLAG_3F, $02 - script_set_flag_value EVENT_FLAG_48, $02 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $02, .ows_f540 + jump_if_flag_equal EVENT_CHALLENGE_CUP_NUMBER, $03, .ows_f549 + script_set_flag_value EVENT_CHALLENGE_CUP_1_STATE, $02 + script_set_flag_value EVENT_CHALLENGE_CUP_1_RESULT, $02 script_jump .ows_f552 + .ows_f540 - script_set_flag_value EVENT_FLAG_40, $02 - script_set_flag_value EVENT_FLAG_49, $02 + script_set_flag_value EVENT_CHALLENGE_CUP_2_STATE, $02 + script_set_flag_value EVENT_CHALLENGE_CUP_2_RESULT, $02 script_jump .ows_f552 + .ows_f549 - script_set_flag_value EVENT_FLAG_41, $02 - script_set_flag_value EVENT_FLAG_4A, $02 + script_set_flag_value EVENT_CHALLENGE_CUP_3_STATE, $02 + script_set_flag_value EVENT_CHALLENGE_CUP_3_RESULT, $02 script_jump .ows_f552 + .ows_f552 close_advanced_text_box set_next_npc_and_script NPC_CLERK12, Script_f3e9 - end_script_loop + end_script ret -; f559 ; Loads the NPC to fight at the challenge hall Preload_ChallengeHallOpponent: ; f559 (3:7559) - get_flag_value EVENT_FLAG_42 + get_flag_value EVENT_CHALLENGE_CUP_STARTING or a ret z - get_flag_value EVENT_FLAG_46 + get_flag_value EVENT_CHALLENGE_CUP_OPPONENT_CHOSEN or a jr z, .asm_f56e ld a, [wd696] ld [wTempNPC], a scf ret + .asm_f56e call Func_f5db ld c, $01 - set_flag_value EVENT_FLAG_45 + set_flag_value EVENT_CHALLENGE_CUP_OPPONENT_NUMBER call Func_f580 - max_flag_value EVENT_FLAG_46 + max_flag_value EVENT_CHALLENGE_CUP_OPPONENT_CHOSEN scf ret Func_f580: ; f580 (3:7580) - get_flag_value EVENT_FLAG_44 + get_flag_value EVENT_CHALLENGE_CUP_NUMBER cp $3 - jr z, .asm_f596 - get_flag_value EVENT_FLAG_45 + jr z, .pick_challenger_include_ronald + get_flag_value EVENT_CHALLENGE_CUP_OPPONENT_NUMBER cp $3 - ld d, $18 - jr nz, .asm_f598 - ld a, $2 - jr .asm_f5ac + ld d, ChallengeHallNPCs.end - ChallengeHallNPCs - 1 ; discount Ronald + jr nz, .pick_challenger + ld a, NPC_RONALD1 + jr .force_ronald -.asm_f596 - ld d, $19 +.pick_challenger_include_ronald + ld d, ChallengeHallNPCs.end - ChallengeHallNPCs -.asm_f598 +.pick_challenger ld a, d call Random ld c, a - call $75cc - jr c, .asm_f598 - call $75d4 + call Func_f5cc + jr c, .pick_challenger + call Func_f5d4 ld b, $0 - ld hl, $75b3 + ld hl, ChallengeHallNPCs add hl, bc ld a, [hl] -.asm_f5ac +.force_ronald ld [wTempNPC], a ld [wd696], a ret -; 0xf5b3 - INCROM $f5b3, $f5db +ChallengeHallNPCs: ; f5b3 (3:75b3) + db NPC_CHRIS + db NPC_MICHAEL + db NPC_JESSICA + db NPC_MATTHEW + db NPC_RYAN + db NPC_ANDREW + db NPC_SARA + db NPC_AMANDA + db NPC_JOSHUA + db NPC_JENNIFER + db NPC_NICHOLAS + db NPC_BRANDON + db NPC_BRITTANY + db NPC_KRISTIN + db NPC_HEATHER + db NPC_ROBERT + db NPC_DANIEL + db NPC_STEPHANIE + db NPC_JOSEPH + db NPC_DAVID + db NPC_ERIK + db NPC_JOHN + db NPC_ADAM + db NPC_JONATHAN + db NPC_RONALD1 +.end + +Func_f5cc: ; f5cc (3:75cc) + call Func_f5e9 + ld a, [hl] + and b + ret z + scf + ret + +Func_f5d4: ; f5d4 (3:75d4) + call Func_f5e9 + ld a, [hl] + or b + ld [hl], a + ret Func_f5db: ; f5db (3:75db) xor a - ld [$d698], a - ld [$d699], a - ld [$d69a], a - ld [$d69b], a + ld [wd698], a + ld [wd699], a + ld [wd69a], a + ld [wd69b], a ret -; 0xf5e9 - INCROM $f5e9, $f602 +Func_f5e9: ; f5e9 (3:75e9) + ld hl, wd698 + ld a, c +.asm_f5ed + cp $08 + jr c, .asm_f5f6 + sub $08 + inc hl + jr .asm_f5ed +.asm_f5f6 + ld b, $80 + jr .asm_f5fd +.asm_f5fa + srl b + dec a +.asm_f5fd + cp $00 + jr nz, .asm_f5fa + ret Func_f602: ; f602 (3:7602) - INCROM $f602, $f631 + zero_flag_value EVENT_CHALLENGE_CUP_OPPONENT_CHOSEN + ret + +PokemonDomeEntranceLoadMap: ; f607 (3:7607) + zero_flag_value EVENT_HALL_OF_HONOR_DOORS_OPEN + zero_flag_value2 EVENT_POKEMON_DOME_STATE + zero_flag_value2 EVENT_COURTNEY_STATE + zero_flag_value2 EVENT_STEVE_STATE + zero_flag_value2 EVENT_JACK_STATE + zero_flag_value2 EVENT_ROD_STATE + get_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + or a + ret nz + zero_flag_value2 EVENT_RONALD_POKEMON_DOME_STATE + ret + +PokemonDomeEntranceCloseTextBox: ; f62a (3:762a) + ld a, $00 + farcall Func_80b89 + ret Script_f631: ; f631 (3:7631) start_script - print_text_string Text0508 + print_npc_text Text0508 close_advanced_text_box set_next_npc_and_script NPC_RONALD1, .ows_f63c - end_script_loop - + end_script ret .ows_f63c - INCROM $f63c, $f71f + call TryGiveMedalPCPacks + get_flag_value EVENT_MEDAL_COUNT + ld [wTxRam3], a + inc a + ld [wTxRam3_b], a + xor a + ld [wTxRam3 + 1], a + ld [wTxRam3_b + 1], a + + start_script + jump_if_flag_not_less_than EVENT_MEDAL_COUNT, $07, .ows_f69b + jump_if_flag_zero_2 EVENT_RONALD_FIRST_CLUB_ENTRANCE_ENCOUNTER, .ows_f69b + jump_if_flag_nonzero_2 EVENT_RONALD_POKEMON_DOME_ENTRANCE_ENCOUNTER, .ows_f69b + override_song MUSIC_RONALD + max_out_flag_value EVENT_RONALD_POKEMON_DOME_ENTRANCE_ENCOUNTER + jump_if_player_coords_match 18, 2, .ows_f66e + move_active_npc NPCMovement_f69c + script_jump .ows_f671 + +.ows_f66e + move_active_npc NPCMovement_f69d +.ows_f671 + print_npc_text Text0553 + close_text_box + set_player_direction SOUTH + move_player SOUTH, 1 + print_npc_text Text0554 + ask_question_jump_default_yes NULL, .ows_f688 + print_npc_text Text0555 + script_jump .ows_f695 + +.ows_f688 + jump_if_flag_zero_1 EVENT_MEDAL_COUNT, .ows_f692 + print_npc_text Text0556 + script_jump .ows_f695 + +.ows_f692 + print_npc_text Text0557 +.ows_f695 + close_text_box + move_active_npc NPCMovement_f6a6 + unload_active_npc + play_default_song +.ows_f69b + quit_script_fully + +NPCMovement_f69c: ; f69c (3:769c) + db EAST +NPCMovement_f69d: ; f69d (3:769d) + db NORTH + db NORTH + db NORTH + db NORTH + db EAST + db EAST + db NORTH + db NORTH + db $ff + +NPCMovement_f6a6: ; f6a6 (3:76a6) + db WEST + db WEST + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db $ff + +Script_f6af: ; f6af (3:76af) + start_script + try_give_medal_pc_packs + jump_if_flag_equal EVENT_MEDAL_COUNT, $08, .ows_f6b9 + print_text_quit_fully Text0558 + +.ows_f6b9 + print_npc_text Text0559 + play_sfx SFX_0F + replace_map_blocks $00 + do_frames 30 + move_player NORTH, 1 + quit_script_fully + +PokemonDomeMovePlayer: ; f6c6 (3:76c6) + ld a, [wPlayerYCoord] + cp $16 + ret nz + ld a, [wPlayerXCoord] + cp $0e + ret c + cp $11 + ret nc + ld a, NPC_ROD + ld [wTempNPC], a + ld bc, Script_f84c + jp SetNextNPCAndScript + +PokemonDomeAfterDuel: ; f6e0 (3:76e0) + ld hl, .after_duel_table + call FindEndOfDuelScript + ret + +.after_duel_table + db NPC_COURTNEY + db NPC_COURTNEY + dw Script_BeatCourtney + dw Script_LostToCourtney + + db NPC_STEVE + db NPC_STEVE + dw Script_BeatSteve + dw Script_LostToSteve + + db NPC_JACK + db NPC_JACK + dw Script_BeatJack + dw Script_LostToJack + + db NPC_ROD + db NPC_ROD + dw Script_BeatRod + dw Script_LostToRod + + db NPC_RONALD1 + db NPC_RONALD1 + dw Script_BeatRonald1InPokemonDome + dw Script_LostToRonald1InPokemonDome + db $00 + +PokemonDomeLoadMap: ; f706 (3:7706) + ld a, $0d + farcall TryGivePCPack + get_flag_value EVENT_POKEMON_DOME_IN_MENU + or a + ret z + ld bc, Script_f80b + jp SetNextScript + +PokemonDomeCloseTextBox: ; f718 (3:7718) + ld a, $01 + farcall Func_80b89 + ret Script_Courtney: ; f71f (3:771f) - INCROM $f71f, $f72a + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text055a, Text055b + quit_script_fully Script_Steve: ; f72a (3:772a) - INCROM $f72a, $f735 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text055c, Text055d + quit_script_fully Script_Jack: ; f735 (3:7735) - INCROM $f735, $f740 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text055e, Text055f + quit_script_fully Script_Rod: ; f740 (3:7740) - INCROM $f740, $fbdb + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0560, Text0561 + quit_script_fully + +Preload_Courtney: ; f74b (3:774b) + get_flag_value EVENT_COURTNEY_STATE + cp $01 + jr z, Func_f76c + lb bc, $16, $0c + cp $02 + jr z, Func_f77d + get_flag_value EVENT_CHALLENGED_GRAND_MASTERS + jr nz, Func_f762 + scf + ret + +Func_f762: ; f762 (3:7762) + ld a, [wLoadNPCYPos] + add $02 + ld [wLoadNPCYPos], a + scf + ret + +Func_f76c: ; f76c (3:776c) + ld a, $12 + ld [wLoadNPCXPos], a + ld a, $0e + ld [wLoadNPCYPos], a + ld a, WEST + ld [wLoadNPCDirection], a + scf + ret + +Func_f77d: ; f77d (3:777d) + ld a, WEST + ld [wLoadNPCDirection], a +Func_f782: ; f782 (3:7782) + ld a, b + ld [wLoadNPCXPos], a + ld a, c + ld [wLoadNPCYPos], a + scf + ret + +Preload_Steve: ; f78c (3:778c) + get_flag_value EVENT_STEVE_STATE + cp $01 + jr z, Func_f76c + lb bc, $16, $0e + cp $02 + jr z, Func_f77d + get_flag_value EVENT_CHALLENGED_GRAND_MASTERS + jr nz, Func_f762 + scf + ret + +Preload_Jack: ; f7a3 (3:77a3) + get_flag_value EVENT_JACK_STATE + cp $01 + jr z, Func_f76c + lb bc, $14, $0a + cp $02 + jr z, Func_f77d + get_flag_value EVENT_CHALLENGED_GRAND_MASTERS + jr nz, Func_f762 + scf + ret + +Preload_Rod: ; f7ba (3:77ba) + get_flag_value EVENT_ROD_STATE + cp $01 + jr z, Func_f76c + get_flag_value EVENT_POKEMON_DOME_STATE + lb bc, $10, $0a + cp $02 + jr z, Func_f782 + lb bc, $0e, $0a + cp $01 + jr z, Func_f782 + scf + ret + +Preload_Ronald1InPokemonDome: ; f7d6 (3:77d6) + get_flag_value EVENT_RONALD_POKEMON_DOME_STATE + cp $02 + ret nc + get_flag_value EVENT_RONALD_POKEMON_DOME_STATE + or a + jr z, .asm_f7eb + ld a, MUSIC_RONALD + ld [wd111], a + jr Func_f76c +.asm_f7eb + scf + ret + +Script_f7ed: ; f7ed (3:77ed) + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_f7f9 + print_npc_text Text0562 +.ows_f7f4 + close_text_box + move_player NORTH, 2 + quit_script_fully + +.ows_f7f9 + print_npc_text Text0563 + ask_question_jump Text0564, .ows_f804 + script_jump .ows_f7f4 + +.ows_f804 + enter_map $0c, POKEMON_DOME_ENTRANCE, 22, 4, NORTH + quit_script_fully + +Script_f80b: ; f80b (3:780b) + start_script + jump_if_flag_equal EVENT_STEVE_STATE, $01, .ows_f820 + jump_if_flag_equal EVENT_JACK_STATE, $01, .ows_f82b + jump_if_flag_equal EVENT_ROD_STATE, $01, .ows_f836 + jump_if_flag_equal EVENT_RONALD_POKEMON_DOME_STATE, $01, .ows_f841 +.ows_f820 + close_advanced_text_box + set_next_npc_and_script NPC_STEVE, .ows_f827 + end_script + ret + +.ows_f827 + start_script + script_jump Script_BeatCourtney.ows_f996 + +.ows_f82b + close_advanced_text_box + set_next_npc_and_script NPC_JACK, .ows_f832 + end_script + ret + +.ows_f832 + start_script + script_jump Script_BeatSteve.ows_fa02 + +.ows_f836 + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_f83d + end_script + ret + +.ows_f83d + start_script + script_jump Script_BeatJack.ows_fa78 + +.ows_f841 + close_advanced_text_box + set_next_npc_and_script NPC_RONALD1, .ows_f848 + end_script + ret + +.ows_f848 + start_script + script_jump Script_BeatRod.ows_fb20 + +Script_f84c: ; f84c (3:784c) + start_script + jump_if_flag_nonzero_2 EVENT_HALL_OF_HONOR_DOORS_OPEN, Script_f7ed + print_npc_text Text0565 + ask_question_jump Text0566, .ows_f85f + print_npc_text Text0567 + script_jump Script_f7ed.ows_f804 + +.ows_f85f + print_npc_text Text0568 + close_text_box + jump_if_player_coords_match 14, 22, .ows_f86f + set_player_direction WEST + move_player WEST, 1 + set_player_direction NORTH +.ows_f86f + move_player NORTH, 1 + move_player NORTH, 1 + set_player_direction WEST + move_player WEST, 1 + move_player WEST, 1 + set_player_direction NORTH + move_player NORTH, 1 + move_player NORTH, 1 + move_player NORTH, 1 + move_player NORTH, 1 + set_player_direction EAST + move_player EAST, 1 + move_player EAST, 1 + set_player_direction NORTH + jump_if_flag_zero_2 EVENT_CHALLENGED_GRAND_MASTERS, NULL + print_variable_npc_text Text0569, Text056a + move_active_npc NPCMovement_fb8c + jump_if_flag_nonzero_2 EVENT_CHALLENGED_GRAND_MASTERS, .ows_f8ef + print_npc_text Text056b + close_advanced_text_box + set_next_npc_and_script NPC_COURTNEY, .ows_f8af + end_script + ret + +.ows_f8af + start_script + move_active_npc NPCMovement_fb8e + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_f8ba + end_script + ret + +.ows_f8ba + start_script + print_npc_text Text056c + close_advanced_text_box + set_next_npc_and_script NPC_STEVE, .ows_f8c5 + end_script + ret + +.ows_f8c5 + start_script + move_active_npc NPCMovement_fb8e + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_f8d0 + end_script + ret + +.ows_f8d0 + start_script + print_npc_text Text056d + close_advanced_text_box + set_next_npc_and_script NPC_JACK, .ows_f8db + end_script + ret + +.ows_f8db + start_script + move_active_npc NPCMovement_fb8e + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_f8e6 + end_script + ret + +.ows_f8e6 + start_script + max_out_flag_value EVENT_CHALLENGED_GRAND_MASTERS + print_npc_text Text056e + script_jump .ows_f8f8 + +.ows_f8ef + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text056f, Text0570 +.ows_f8f8 + print_npc_text Text0571 + close_text_box + set_player_direction WEST + move_player WEST, 1 + set_player_direction SOUTH + move_player SOUTH, 1 + move_player SOUTH, 1 + set_player_direction EAST + move_active_npc NPCMovement_fb8d + script_set_flag_value EVENT_POKEMON_DOME_STATE, $01 + close_advanced_text_box + set_next_npc_and_script NPC_COURTNEY, .ows_f918 + end_script + ret + +.ows_f918 + start_script + try_give_pc_pack $0e + script_set_flag_value EVENT_COURTNEY_STATE, $01 + set_dialog_npc NPC_ROD + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0572, Text0573 + close_text_box + set_dialog_npc NPC_COURTNEY + move_active_npc NPCMovement_fba6 + set_active_npc_direction WEST + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0574, Text0575 + start_duel PRIZES_6, LEGENDARY_MOLTRES_DECK_ID, MUSIC_DUEL_THEME_3 + quit_script_fully + +Script_LostToCourtney: ; f93f (3:793f) + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0576, Text0577 + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_f950 + end_script + ret + +.ows_f950 + start_script + move_active_npc NPCMovement_fba1 + print_npc_text Text0578 + script_jump Script_f7ed.ows_f804 + +Script_BeatCourtney: ; f95a (3:795a) + start_script + script_set_flag_value EVENT_COURTNEY_STATE, $02 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0579, Text057a + close_text_box + move_active_npc NPCMovement_fbb7 + set_active_npc_direction WEST + close_advanced_text_box + set_next_npc_and_script NPC_STEVE, .ows_f974 + end_script + ret + +.ows_f974 + start_script + try_give_pc_pack $0f + script_set_flag_value EVENT_STEVE_STATE, $01 + set_dialog_npc NPC_ROD + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text057b, Text057c + close_text_box + set_dialog_npc NPC_STEVE + move_active_npc NPCMovement_fba4 + set_active_npc_direction WEST + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text057d, Text057e +.ows_f996 + zero_out_flag_value EVENT_POKEMON_DOME_IN_MENU + set_dialog_npc NPC_ROD + print_npc_text Text057f + ask_question_jump_default_yes Text0580, .ows_f9af + print_npc_text Text0581 + set_dialog_npc NPC_STEVE + print_npc_text Text0582 + start_duel PRIZES_6, LEGENDARY_ZAPDOS_DECK_ID, MUSIC_DUEL_THEME_3 + quit_script_fully + +.ows_f9af + close_text_box + max_out_flag_value EVENT_POKEMON_DOME_IN_MENU + open_menu + close_text_box + script_jump .ows_f996 + +Script_LostToSteve: ; f9b7 (3:79b7) + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0583, Text0584 + close_advanced_text_box + set_next_npc_and_script NPC_ROD, Script_LostToCourtney.ows_f950 + end_script + ret + +Script_BeatSteve: ; f9c8 (3:79c8) + start_script + script_set_flag_value EVENT_STEVE_STATE, $02 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0585, Text0586 + close_text_box + move_active_npc NPCMovement_fbb8 + set_active_npc_direction WEST + close_advanced_text_box + set_next_npc_and_script NPC_JACK, .ows_f9e2 + end_script + ret + +.ows_f9e2 + start_script + script_set_flag_value EVENT_JACK_STATE, $01 + set_dialog_npc NPC_ROD + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0587, Text0588 + close_text_box + set_dialog_npc NPC_JACK + move_active_npc NPCMovement_fbbc + set_active_npc_direction WEST + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0589, Text058a +.ows_fa02 + zero_out_flag_value EVENT_POKEMON_DOME_IN_MENU + set_dialog_npc NPC_ROD + print_npc_text Text058b + ask_question_jump_default_yes Text058c, .ows_fa1b + print_npc_text Text058d + set_dialog_npc NPC_JACK + print_npc_text Text058e + start_duel PRIZES_6, LEGENDARY_ARTICUNO_DECK_ID, MUSIC_DUEL_THEME_3 + quit_script_fully + +.ows_fa1b + close_text_box + max_out_flag_value EVENT_POKEMON_DOME_IN_MENU + open_menu + close_text_box + script_jump .ows_fa02 + +Script_LostToJack: ; fa23 (3:7a23) + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text058f, Text0590 + close_advanced_text_box + set_next_npc_and_script NPC_ROD, Script_LostToCourtney.ows_f950 + end_script + ret + +Script_BeatJack: ; fa34 (3:7a34) + start_script + script_set_flag_value EVENT_JACK_STATE, $02 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0591, Text0592 + close_text_box + move_active_npc NPCMovement_fbc2 + set_active_npc_direction WEST + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_fa52 + move_npc NPC_ROD, NPCMovement_f390 + end_script + ret + +.ows_fa52 + start_script + script_set_flag_value EVENT_ROD_STATE, $01 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text0593, Text0594 + close_text_box + move_active_npc NPCMovement_fbaf + set_active_npc_direction WEST + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_fa75 + jump_if_flag_zero_2 EVENT_CHALLENGED_RONALD, NULL + print_variable_npc_text Text0595, Text0596 + script_jump .ows_fa78 + +.ows_fa75 + print_npc_text Text0597 +.ows_fa78 + zero_out_flag_value EVENT_POKEMON_DOME_IN_MENU + print_npc_text Text0598 + ask_question_jump_default_yes Text0599, .ows_fa90 + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text059a, Text059b + start_duel PRIZES_6, LEGENDARY_DRAGONITE_DECK_ID, MUSIC_DUEL_THEME_3 + quit_script_fully + +.ows_fa90 + close_text_box + max_out_flag_value EVENT_POKEMON_DOME_IN_MENU + open_menu + close_text_box + script_jump .ows_fa78 + +Script_LostToRod: ; fa98 (3:7a98) + start_script + print_npc_text Text059c + close_text_box + move_active_npc NPCMovement_fb9d + set_active_npc_direction SOUTH + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARDS, NULL + print_variable_npc_text Text059d, Text059e + script_jump Script_f7ed.ows_f804 + +Script_BeatRod: ; faae (3:7aae) + start_script + script_set_flag_value EVENT_ROD_STATE, $02 + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_fad5 + jump_if_flag_zero_2 EVENT_CHALLENGED_RONALD, NULL + print_variable_npc_text Text059f, Text05a0 + close_text_box + move_active_npc NPCMovement_fb90 + set_active_npc_direction SOUTH + jump_if_flag_zero_2 EVENT_CHALLENGED_RONALD, NULL + print_variable_npc_text Text05a1, Text05a2 + close_advanced_text_box + set_next_npc_and_script NPC_RONALD1, .ows_fae9 + end_script + ret + +.ows_fad5 + print_npc_text Text05a3 + move_active_npc NPCMovement_fb96 + set_active_npc_direction SOUTH + play_sfx SFX_0F + replace_map_blocks $01 + script_set_flag_value EVENT_POKEMON_DOME_STATE, $02 + max_out_flag_value EVENT_HALL_OF_HONOR_DOORS_OPEN + print_text_quit_fully Text05a4 + +.ows_fae9 + start_script + override_song MUSIC_STOP + script_set_flag_value EVENT_RONALD_POKEMON_DOME_STATE, $01 + play_sfx SFX_0F + replace_map_blocks $01 + move_active_npc NPCMovement_fbd2 + set_default_song MUSIC_RONALD + play_default_song + jump_if_flag_nonzero_2 EVENT_CHALLENGED_RONALD, .ows_fb15 + print_npc_text Text05a5 + set_dialog_npc NPC_ROD + move_npc NPC_ROD, NPCMovement_fb9b + print_npc_text Text05a6 + set_dialog_npc NPC_RONALD1 + print_npc_text Text05a7 + move_npc NPC_ROD, NPCMovement_fb99 + script_jump .ows_fb18 + +.ows_fb15 + print_npc_text Text05a8 +.ows_fb18 + close_text_box + move_active_npc NPCMovement_fba8 + set_active_npc_direction WEST + max_out_flag_value EVENT_CHALLENGED_RONALD +.ows_fb20 + zero_out_flag_value EVENT_POKEMON_DOME_IN_MENU + set_dialog_npc NPC_ROD + print_npc_text Text05a9 + ask_question_jump_default_yes Text05aa, .ows_fb40 + print_npc_text Text05ab + set_dialog_npc NPC_RONALD1 + print_npc_text Text05ac + set_dialog_npc NPC_ROD + print_npc_text Text05ad + set_dialog_npc NPC_RONALD1 + start_duel PRIZES_6, LEGENDARY_RONALD_DECK_ID, MUSIC_DUEL_THEME_3 + quit_script_fully + +.ows_fb40 + close_text_box + max_out_flag_value EVENT_POKEMON_DOME_IN_MENU + open_menu + close_text_box + script_jump .ows_fb20 + +Script_LostToRonald1InPokemonDome: ; fb48 (3:7b48) + start_script + print_npc_text Text05ae + close_advanced_text_box + set_next_npc_and_script NPC_ROD, Script_LostToCourtney.ows_f950 + end_script + ret + +Script_BeatRonald1InPokemonDome: ; fb53 (3:7b53) + start_script + script_set_flag_value EVENT_RONALD_POKEMON_DOME_STATE, $02 + print_npc_text Text05af + set_dialog_npc NPC_ROD + print_npc_text Text05b0 + print_text Text05b1 + set_dialog_npc NPC_RONALD1 + print_npc_text Text05b2 + close_text_box + move_active_npc NPCMovement_fbc7 + unload_active_npc + set_default_song MUSIC_HALL_OF_HONOR + play_default_song + close_advanced_text_box + set_next_npc_and_script NPC_ROD, .ows_fb76 + end_script + ret + +.ows_fb76 + start_script + move_active_npc NPCMovement_fba1 + set_player_direction NORTH + print_npc_text Text05b3 + move_active_npc NPCMovement_fbb2 + script_set_flag_value EVENT_POKEMON_DOME_STATE, $02 + max_out_flag_value EVENT_HALL_OF_HONOR_DOORS_OPEN + record_master_win $0a + print_text_quit_fully Text05b4 + +NPCMovement_fb8c: ; fb8c (3:7b8c) + db EAST +NPCMovement_fb8d: ; fb8d (3:7b8d) + db SOUTH +NPCMovement_fb8e: ; fb8e (3:7b8e) + db SOUTH + db $ff + +NPCMovement_fb90: ; fb90 (3:7b90) + db NORTH + db NORTH + db WEST + db WEST + db SOUTH | NO_MOVE + db $ff + +NPCMovement_fb96: ; fb96 (3:7b96) + db NORTH + db NORTH + db WEST +NPCMovement_fb99: ; fb99 (3:7b99) + db SOUTH | NO_MOVE + db $ff + +NPCMovement_fb9b: ; fb9b (3:7b9b) + db NORTH | NO_MOVE + db $ff + +NPCMovement_fb9d: ; fb9d (3:7b9d) + db NORTH + db NORTH + db WEST + db WEST +NPCMovement_fba1: ; fba1 (3:7ba1) + db WEST + db SOUTH + db $ff + +NPCMovement_fba4: ; fba4 (3:7ba4) + db WEST + db WEST +NPCMovement_fba6: ; fba6 (3:7ba6) + db WEST + db SOUTH +NPCMovement_fba8: ; fba8 (3:7ba8) + db SOUTH + db SOUTH + db EAST + db SOUTH + db SOUTH + db WEST | NO_MOVE + db $ff + +NPCMovement_fbaf: ; fbaf (3:7baf) + db EAST + db $fe, -7 + +NPCMovement_fbb2: ; fbb2 (3:7bb2) + db NORTH + db EAST + db EAST + db SOUTH | NO_MOVE + db $ff + +NPCMovement_fbb7: ; fbb7 (3:7bb7) + db NORTH +NPCMovement_fbb8: ; fbb8 (3:7bb8) + db EAST + db EAST + db WEST | NO_MOVE + db $ff + +NPCMovement_fbbc: ; fbbc (3:7bbc) + db EAST + db EAST + db EAST + db EAST + db $fe, -26 + +NPCMovement_fbc2: ; fbc2 (3:7bc2) + db NORTH + db NORTH + db EAST + db WEST | NO_MOVE + db $ff + +NPCMovement_fbc7: ; fbc7 (3:7bc7) + db SOUTH + db SOUTH + db WEST + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db SOUTH + db $ff + +NPCMovement_fbd2: ; fbd2 (3:7bd2) + db WEST + db WEST + db WEST + db WEST + db WEST + db WEST + db WEST + db $fe, -12 HallOfHonorLoadMap: ; fbdb (3:7bdb) ld a, SFX_10 call PlaySFX ret -; 0xfbe1 - INCROM $fbe1, $fbf1 +Script_fbe1: ; fbe1 (3:7be1) + start_script + print_text Text05b5 + ask_question_jump_default_yes Text05b6, .ows_fbee + print_text Text05b7 + quit_script_fully + +.ows_fbee + open_deck_machine $0a + quit_script_fully Script_fbf1: ; fbf1 (3:7bf1) start_script - jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARD, .ows_fc10 - max_out_flag_value EVENT_RECEIVED_LEGENDARY_CARD - run_command Func_ccdc - tx Text05b8 + jump_if_flag_nonzero_2 EVENT_RECEIVED_LEGENDARY_CARDS, .ows_fc10 + max_out_flag_value EVENT_RECEIVED_LEGENDARY_CARDS + print_text Text05b8 give_card ZAPDOS3 give_card MOLTRES2 give_card ARTICUNO2 give_card DRAGONITE1 show_card_received_screen $ff .ows_fc05 - run_command Func_d38f - db $00 - run_command Func_ccdc - tx Text05b9 + flash_screen $00 + print_text Text05b9 .ows_fc0a - run_command Func_d38f - db $01 - run_command Func_d396 - db $01 - run_command Func_d3b9 + flash_screen $01 + save_game $01 + play_credits quit_script_fully .ows_fc10 - jump_if_flag_equal EVENT_FLAG_71, $0f, .ows_fc20 - run_command Func_d209 - run_command Func_ccdc - tx Text05ba + jump_if_flag_equal EVENT_LEGENDARY_CARDS_RECEIVED_FLAGS, $0f, .ows_fc20 + pick_legendary_card + print_text Text05ba give_card VARIABLE_CARD show_card_received_screen VARIABLE_CARD script_jump .ows_fc05 .ows_fc20 - run_command Func_ccdc - tx Text05bb - run_command Func_d38f - db $00 - run_command Func_ccdc - tx Text05bc + print_text Text05bb + flash_screen $00 + print_text Text05bc script_jump .ows_fc0a Func_fc2b: ; fc2b (3:7c2b) @@ -5929,72 +9278,71 @@ Func_fc2b: ; fc2b (3:7c2b) ld c, [hl] inc hl ld b, [hl] - ld a, $b0 + ld a, LOW(ClerkNPCName_) ld [wCurrentNPCNameTx], a - ld a, $3 - ld [wCurrentNPCNameTx+1], a + ld a, HIGH(ClerkNPCName_) + ld [wCurrentNPCNameTx + 1], a jp SetNextScript PointerTable_fc4c: ; fc4c (3:7c4c) - dw Unknown_fc64 - dw Unknown_fc68 - dw Unknown_fc60 + dw Script_fc64 + dw Script_fc68 + dw Script_fc60 Script_fc52: ; fc52 (3:7c52) start_script - print_text_string Text06c8 + print_npc_text Text06c8 ask_question_jump_default_yes NULL, .ows_fc5e print_text_quit_fully Text06c9 .ows_fc5e - run_command Func_cd76 + battle_center quit_script_fully -Unknown_fc60: ; fc60 (3:7c60) - INCROM $fc60, $fc64 +Script_fc60: ; fc60 (3:7c60) + start_script + print_text_quit_fully Text06ca -Unknown_fc64: ; fc64 (3:7c64) - INCROM $fc64, $fc68 +Script_fc64: ; fc64 (3:7c64) + start_script + print_text_quit_fully Text06cb -Unknown_fc68: ; fc68 (3:7c68) - INCROM $fc68, $fc6c +Script_fc68: ; fc68 (3:7c68) + start_script + print_text_quit_fully Text06cc ; Clerk looks away from you if you can't use infrared ; This is one of the preloads that does not change whether or not they appear Preload_GiftCenterClerk: ; fc6c (3:7c6c) ld a, [wConsole] cp CONSOLE_CGB - jr z, .notCGB + jr z, .cgb ld a, NORTH ld [wLoadNPCDirection], a -.notCGB +.cgb scf ret Func_fc7a: ; fc7a (3:7c7a) ld a, [wConsole] ld c, a - set_flag_value EVENT_FLAG_74 + set_flag_value EVENT_CONSOLE start_script - jump_if_flag_not_equal EVENT_FLAG_74, $02, Func_fcad.ows_fcd5 - print_text_string Text06cd - run_command Func_d39d - db $00 - jump_if_flag_not_less_than EVENT_FLAG_72, $04, Func_fc7a.ows_fcaa - print_text_string Text06ce + jump_if_flag_not_equal EVENT_CONSOLE, $02, Func_fcad.ows_fcd5 + print_npc_text Text06cd + gift_center $00 + jump_if_flag_not_less_than EVENT_GIFT_CENTER_MENU_CHOICE, $04, .ows_fcaa + print_npc_text Text06ce ask_question_jump_default_yes Text06cf, .ows_fca0 - print_text_string Text06d0 - script_jump Func_fc7a.ows_fcaa + print_npc_text Text06d0 + script_jump .ows_fcaa .ows_fca0 - run_command Func_d396 - db $00 + save_game $00 play_sfx SFX_56 - run_command Func_ccdc - tx Text06d1 - run_command Func_d39d - db $01 + print_text Text06d1 + gift_center $01 quit_script_fully .ows_fcaa @@ -6003,15 +9351,14 @@ Func_fc7a: ; fc7a (3:7c7a) Func_fcad: ; fcad (3:7cad) ld a, [wd10e] ld c, a - set_flag_value EVENT_FLAG_72 + set_flag_value EVENT_GIFT_CENTER_MENU_CHOICE start_script play_sfx SFX_56 - run_command Func_d396 - db $00 - jump_if_flag_equal EVENT_FLAG_72, $00, .ows_fccc - jump_if_flag_equal EVENT_FLAG_72, $02, .ows_fccf - jump_if_flag_equal EVENT_FLAG_72, $03, .ows_fcd2 + save_game $00 + jump_if_flag_equal EVENT_GIFT_CENTER_MENU_CHOICE, $00, .ows_fccc + jump_if_flag_equal EVENT_GIFT_CENTER_MENU_CHOICE, $02, .ows_fccf + jump_if_flag_equal EVENT_GIFT_CENTER_MENU_CHOICE, $03, .ows_fcd2 script_jump Func_fc7a.ows_fcaa .ows_fccc @@ -6024,9 +9371,9 @@ Func_fcad: ; fcad (3:7cad) print_text_quit_fully Text06d5 .ows_fcd5 - move_arbitrary_npc NPC_GIFT_CENTER_CLERK, NPCMovement_fce1 - print_text_string Text06d6 - move_arbitrary_npc NPC_GIFT_CENTER_CLERK, NPCMovement_fce3 + move_npc NPC_GIFT_CENTER_CLERK, NPCMovement_fce1 + print_npc_text Text06d6 + move_npc NPC_GIFT_CENTER_CLERK, NPCMovement_fce3 quit_script_fully NPCMovement_fce1: ; fce1 (3:7ce1) @@ -6036,7 +9383,7 @@ NPCMovement_fce1: ; fce1 (3:7ce1) NPCMovement_fce3: ; fce3 (3:7ce3) db NORTH | NO_MOVE db $ff -; fce5 +; 0xfce5 rept $31b db $ff diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm index 9178336..b8a40a6 100644 --- a/src/engine/bank04.asm +++ b/src/engine/bank04.asm @@ -28,13 +28,13 @@ Func_10031: ; 10031 (4:4031) push af ld a, $1 call BankswitchSRAM - call $4cbb + call Func_10cbb call DisableSRAM - call $4b28 + call Func_10b28 call FlushAllPalettes call EnableLCD call DoFrameIfLCDEnabled - call $4cea + call Func_10cea call FlushAllPalettes pop af call BankswitchSRAM @@ -45,7 +45,13 @@ Func_10059: ; 10059 (4:4059) INCROM $10059, $100a2 Func_100a2: ; 100a2 (4:40a2) - INCROM $100a2, $1029e + INCROM $100a2, $1010c + +Func_1010c: ; 1010c (4:410c) + INCROM $1010c, $10197 + +Func_10197: ; 10197 (4:4197) + INCROM $10197, $1029e Medal_1029e: ; 1029e (4:429e) sub $8 @@ -59,22 +65,22 @@ Medal_1029e: ; 1029e (4:429e) call PlaySong farcall Func_70000 call DisableLCD - call $4000 + call Func_10000 ld a, $fa ld [wd114], a - call $410c + call Func_1010c pop bc ld a, c add a ld c, a ld b, $0 - ld hl, Unknown_1030b + ld hl, MasterMedalNames add hl, bc ld a, [hli] ld [wTxRam2], a ld a, [hl] ld [wTxRam2 + 1], a - call $4031 + call Func_10031 ld a, MUSIC_MEDAL call PlaySong ld a, $ff @@ -86,7 +92,7 @@ Medal_1029e: ; 1029e (4:429e) ld [wd116], a and $f jr nz, .asm_102e2 - call $4197 + call Func_10197 ld a, [wd116] cp $e0 jr nz, .asm_102e2 @@ -98,8 +104,15 @@ Medal_1029e: ; 1029e (4:429e) ld [wd291], a ret -Unknown_1030b: ; 1030b (4:430b) - INCROM $1030b, $1031b +MasterMedalNames: ; 1030b (4:430b) + tx GrassClubMapNameText + tx ScienceClubMapNameText + tx FireClubMapNameText + tx WaterClubMapNameText + tx LightningClubMapNameText + tx PsychicClubMapNameText + tx RockClubMapNameText + tx FightingClubMapNameText BoosterPack_1031b: ; 1031b (4:431b) ld c, a @@ -107,25 +120,25 @@ BoosterPack_1031b: ; 1031b (4:431b) push af push bc call DisableLCD - call $4000 + call Func_10000 xor a ld [wTextBoxFrameType], a pop bc push bc ld b, $0 - ld hl, $43a5 + ld hl, Unknown_103a5 add hl, bc ld a, [hl] ld c, a add a add a ld c, a - ld hl, $43c2 + ld hl, Unknown_103c2 add hl, bc ld a, [hli] push hl ld bc, $0600 - call $70ca + call Func_130ca pop hl ld a, [hli] ld [wTxRam3], a @@ -135,7 +148,7 @@ BoosterPack_1031b: ; 1031b (4:431b) ld [wTxRam2], a ld a, [hl] ld [wTxRam2 + 1], a - call $4031 + call Func_10031 call PauseSong ld a, MUSIC_BOOSTER_PACK call PlaySong @@ -166,9 +179,12 @@ BoosterPack_1031b: ; 1031b (4:431b) pop af ld [wd291], a ret -; 0x103a5 - INCROM $103a5, $103d2 +Unknown_103a5: ; 103a5 (4:43a5) + INCROM $103a5, $103c2 + +Unknown_103c2: ; 103c2 (4:43c2) + INCROM $103c2, $103d2 Func_103d2: ; 103d2 (4:43d2) INCROM $103d2, $103d3 @@ -177,7 +193,7 @@ Duel_Init: ; 103d3 (4:43d3) ld a, [wd291] push af call DisableLCD - call $4000 + call Func_10000 ld a, $4 ld [wTextBoxFrameType], a lb de, 0, 12 @@ -188,7 +204,7 @@ Duel_Init: ; 103d3 (4:43d3) add a ld c, a ld b, $0 - ld hl, $445b + ld hl, Unknown_1045b add hl, bc ld a, [hli] ld [wTxRam2], a @@ -199,8 +215,8 @@ Duel_Init: ; 103d3 (4:43d3) ld [wTxRam2_b], a ld a, [wOpponentName + 1] ld [wTxRam2_b + 1], a - ld hl, $4451 - call $51b3 ; LoadDuelistName + ld hl, Unknown_10451 + call Func_111b3 ; LoadDuelistName pop hl ld a, [hli] ld [wTxRam2], a @@ -209,8 +225,8 @@ Duel_Init: ; 103d3 (4:43d3) ld [wTxRam2 + 1], a or c jr z, .asm_10425 - ld hl, $4456 - call $51b3 ; LoadDeckName + ld hl, Unknown_10456 + call Func_111b3 ; LoadDeckName .asm_10425 ld bc, $0703 @@ -218,7 +234,7 @@ Duel_Init: ; 103d3 (4:43d3) call Func_3e2a ; LoadDuelistPortrait ld a, [wMatchStartTheme] call PlaySong - call $4031 + call Func_10031 call DoFrameIfLCDEnabled lb bc, $2f, $1d ; cursor tile, tile behind cursor lb de, 18, 17 ; x, y @@ -229,15 +245,27 @@ Duel_Init: ; 103d3 (4:43d3) pop af ld [wd291], a ret -; 0x10451 - INCROM $10451, $10548 +Unknown_10451: ; 10451 (4:4451) + INCROM $10451, $10456 + +Unknown_10456: ; 10456 (4:4456) + INCROM $10456, $1045b + +Unknown_1045b: ; 1045b (4:445b) + INCROM $1045b, $1052f + +Func_1052f: ; 1052f (4:452f) + INCROM $1052f, $10548 Func_10548: ; 10548 (4:4548) INCROM $10548, $10756 Func_10756: ; 10756 (4:4756) - INCROM $10756, $10a70 + INCROM $10756, $1076d + +Func_1076d: ; 1076d (4:476d) + INCROM $1076d, $10a70 ; gives the pc pack described in a TryGivePCPack: ; 10a70 (4:4a70) @@ -284,7 +312,10 @@ Func_10ab4: ; 10ab4 (4:4ab4) INCROM $10ab4, $10af9 Func_10af9: ; 10af9 (4:4af9) - INCROM $10af9, $10c96 + INCROM $10af9, $10b28 + +Func_10b28: ; 10b28 (4:4b28) + INCROM $10b28, $10c96 Func_10c96: ; 10c96 (4:4c96) ldh a, [hBankSRAM] @@ -292,13 +323,13 @@ Func_10c96: ; 10c96 (4:4c96) push bc ld a, $1 call BankswitchSRAM - call $4cbb + call Func_10cbb call Func_10ab4 pop bc ld a, c or a jr nz, .asm_10cb0 - call $4cea + call Func_10cea call Func_10af9 .asm_10cb0 @@ -307,15 +338,24 @@ Func_10c96: ; 10c96 (4:4c96) call BankswitchSRAM call DisableSRAM ret -; 0x10cbb - INCROM $10cbb, $10dba +Func_10cbb: ; 10cbb (4:4cbb) + INCROM $10cbb, $10cea + +Func_10cea: ; 10cea (4:4cea) + INCROM $10cea, $10d98 + +Unknown_10d98: ; 10d98 (4:4d98) + INCROM $10d98, $10da9 + +Unknown_10da9: ; 10da9 (4:4da9) + INCROM $10da9, $10dba Func_10dba: ; 10dba (4:4dba) ld a, $1 farcall Func_c29b ld a, [wd0ba] - ld hl, $4e17 + ld hl, Unknown_10e17 farcall Func_111e9 .asm_10dca call DoFrameIfLCDEnabled @@ -331,15 +371,18 @@ Func_10dba: ; 10dba (4:4dba) .asm_10ddd ld [wd10e], a push af - ld hl, $4df0 + ld hl, Unknown_10df0 call JumpToFunctionInTable farcall CloseTextBox call DoFrameIfLCDEnabled pop af ret -; 0x10df0 - INCROM $10df0, $10e28 +Unknown_10df0: ; 10df0 (4:4df0) + INCROM $10df0, $10e17 + +Unknown_10e17: ; 10e17 (4:4e17) + INCROM $10e17, $10e28 Func_10e28: ; 10e28 (4:4e28) INCROM $10e28, $10e55 @@ -441,7 +484,7 @@ Func_10f2e: ; 10f2e (4:4f2e) rlca ld e, a ld d, $0 - ld hl, Unknown_397b + ld hl, OverworldMapNames add hl, de ld a, [hli] ld h, [hl] @@ -788,12 +831,15 @@ Func_11184: ; 11184 (4:5184) ld hl, wd341 dec [hl] ret -; 0x111b3 +Func_111b3: ; 111b3 (4:51b3) INCROM $111b3, $111e9 Func_111e9: ; 111e9 (4:51e9) - INCROM $111e9, $1124d + INCROM $111e9, $11238 + +Func_11238: ; 11238 (4:5238) + INCROM $11238, $1124d Func_1124d: ; 1124d (4:524d) INCROM $1124d, $11320 @@ -830,7 +876,7 @@ Func_1157c: ; 1157c (4:557c) ld [wd32e], a .asm_1159f - call $5238 + call Func_11238 ret Func_115a3: ; 115a3 (4:55a3) @@ -968,16 +1014,16 @@ Func_11f4e: ; 11f4e (4:5f4e) INCROM $11f4e, $1217b OverworldScriptTable: ; 1217b (4:617b) - dw ScriptCommand_EndScriptLoop1 + dw ScriptCommand_EndScript dw ScriptCommand_CloseAdvancedTextBox - dw ScriptCommand_PrintTextString - dw Func_ccdc + dw ScriptCommand_PrintNPCText + dw ScriptCommand_PrintText dw ScriptCommand_AskQuestionJump - dw ScriptCommand_StartBattle + dw ScriptCommand_StartDuel + dw ScriptCommand_PrintVariableNPCText dw ScriptCommand_PrintVariableText - dw Func_cda8 dw ScriptCommand_PrintTextQuitFully - dw Func_cdcb + dw ScriptCommand_UnloadActiveNPC dw ScriptCommand_MoveActiveNPCByDirection dw ScriptCommand_CloseTextBox dw ScriptCommand_GiveBoosterPacks @@ -985,16 +1031,16 @@ OverworldScriptTable: ; 1217b (4:617b) dw ScriptCommand_JumpIfCardInCollection dw ScriptCommand_GiveCard dw ScriptCommand_TakeCard - dw Func_cf53 - dw Func_cf7b + dw ScriptCommand_JumpIfAnyEnergyCardsInCollection + dw ScriptCommand_RemoveAllEnergyCardsFromCollection dw ScriptCommand_JumpIfEnoughCardsOwned dw ScriptCommand_JumpBasedOnFightingClubPupilStatus - dw Func_cfc6 - dw Func_cfd4 - dw Func_d00b - dw Func_d025 - dw Func_d032 - dw Func_d03f + dw ScriptCommand_SetActiveNPCDirection + dw ScriptCommand_PickNextMan1RequestedCard + dw ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot + dw ScriptCommand_JumpIfMan1RequestedCardOwned + dw ScriptCommand_JumpIfMan1RequestedCardInCollection + dw ScriptCommand_RemoveMan1RequestedCardFromCollection dw ScriptCommand_Jump dw ScriptCommand_TryGiveMedalPCPacks dw ScriptCommand_SetPlayerDirection @@ -1002,60 +1048,60 @@ OverworldScriptTable: ; 1217b (4:617b) dw ScriptCommand_ShowCardReceivedScreen dw ScriptCommand_SetDialogNPC dw ScriptCommand_SetNextNPCAndScript - dw Func_d095 - dw Func_d0be + dw ScriptCommand_SetSpriteAttributes + dw ScriptCommand_SetActiveNPCCoords dw ScriptCommand_DoFrames - dw Func_d0d9 + dw ScriptCommand_JumpIfActiveNPCCoordsMatch dw ScriptCommand_JumpIfPlayerCoordsMatch dw ScriptCommand_MoveActiveNPC dw ScriptCommand_GiveOneOfEachTrainerBooster - dw Func_d103 - dw Func_d125 - dw Func_d135 - dw Func_d16b - dw Func_cd4f - dw Func_cd94 - dw ScriptCommand_MoveWramNPC - dw Func_cdd8 - dw Func_cdf5 - dw Func_d195 - dw Func_d1ad - dw Func_d1b3 + dw ScriptCommand_JumpIfNPCLoaded + dw ScriptCommand_ShowMedalReceivedScreen + dw ScriptCommand_LoadCurrentMapNameIntoTxRamSlot + dw ScriptCommand_LoadChallengeHallNPCIntoTxRamSlot + dw ScriptCommand_StartChallengeHallDuel + dw ScriptCommand_PrintTextForChallengeCup + dw ScriptCommand_MoveChallengeHallNPC + dw ScriptCommand_UnloadChallengeHallNPC + dw ScriptCommand_SetChallengeHallNPCCoords + dw ScriptCommand_PickChallengeHallOpponent + dw ScriptCommand_OpenMenu + dw ScriptCommand_PickChallengeCupPrizeCard dw ScriptCommand_QuitScriptFully - dw Func_d244 + dw ScriptCommand_ReplaceMapBlocks dw ScriptCommand_ChooseDeckToDuelAgainstMultichoice dw ScriptCommand_OpenDeckMachine dw ScriptCommand_ChooseStarterDeckMultichoice dw ScriptCommand_EnterMap dw ScriptCommand_MoveArbitraryNPC - dw Func_d209 - dw Func_d38f - dw Func_d396 - dw Func_cd76 - dw Func_d39d - dw Func_d3b9 + dw ScriptCommand_PickLegendaryCard + dw ScriptCommand_FlashScreen + dw ScriptCommand_SaveGame + dw ScriptCommand_BattleCenter + dw ScriptCommand_GiftCenter + dw ScriptCommand_PlayCredits dw ScriptCommand_TryGivePCPack dw ScriptCommand_nop - dw Func_d3d4 - dw Func_d3e0 - dw Func_d3fe - dw Func_d408 - dw Func_d40f + dw ScriptCommand_GiveStarterDeck + dw ScriptCommand_WalkPlayerToMasonLaboratory + dw ScriptCommand_OverrideSong + dw ScriptCommand_SetDefaultSong + dw ScriptCommand_PlaySong dw ScriptCommand_PlaySFX dw ScriptCommand_PauseSong dw ScriptCommand_ResumeSong - dw Func_d41d + dw ScriptCommand_PlayDefaultSong dw ScriptCommand_WaitForSongToFinish - dw Func_d435 + dw ScriptCommand_RecordMasterWin dw ScriptCommand_AskQuestionJumpDefaultYes dw ScriptCommand_ShowSamNormalMultichoice dw ScriptCommand_ShowSamTutorialMultichoice - dw Func_d43d - dw ScriptCommand_EndScriptLoop2 - dw ScriptCommand_EndScriptLoop3 - dw ScriptCommand_EndScriptLoop4 - dw ScriptCommand_EndScriptLoop5 - dw ScriptCommand_EndScriptLoop6 + dw ScriptCommand_ChallengeMachine + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript dw ScriptCommand_SetFlagValue dw ScriptCommand_JumpIfFlagZero1 dw ScriptCommand_JumpIfFlagNonzero1 @@ -1068,21 +1114,21 @@ OverworldScriptTable: ; 1217b (4:617b) dw ScriptCommand_JumpIfFlagNonzero2 dw ScriptCommand_JumpIfFlagZero2 dw ScriptCommand_IncrementFlagValue - dw ScriptCommand_EndScriptLoop7 - dw ScriptCommand_EndScriptLoop8 - dw ScriptCommand_EndScriptLoop9 - dw ScriptCommand_EndScriptLoop10 + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript + dw ScriptCommand_EndScript MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst: ;1224b db $04, $00 ; x, y to start drawing box db $10, $08 ; width, height of box db $06, $02 ; x, y coordinate to start printing next text - tx Text03f6 ; text id to print next + tx LightningAndFireDeckChoiceText ; text id to print next db $06, $04 ; x, y coordinate to start printing next text - tx Text03f7 ; text id to print next + tx WaterAndFightingDeckChoiceText ; text id to print next db $06, $06 ; x, y coordinate to start printing next text - tx Text03f8 ; text id to print next + tx GrassAndPsychicDeckChoiceText ; text id to print next db $ff ; marker byte -- end text entries db $05, $02 ; cursor starting x, y db $02 ; number of tiles the cursor moves per toggle @@ -1095,11 +1141,11 @@ MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck: ;12264 db $04, $00 ; x, y to start drawing box db $10, $08 ; width, height of box db $06, $02 ; x, y coordinate to start printing next text - tx Text03fa ; text id to print next + tx CharmanderAndFriendsDeckChoiceText ; text id to print next db $06, $04 ; x, y coordinate to start printing next text - tx Text03fb ; text id to print next + tx SquirtleAndFriendsDeckChoiceText ; text id to print next db $06, $06 ; x, y coordinate to start printing next text - tx Text03fc ; text id to print next + tx BulbasaurAndFriendsDeckChoiceText ; text id to print next db $ff ; marker byte -- end text entries db $05, $02 ; cursor starting x, y db $02 ; number of tiles the cursor moves per toggle @@ -1115,7 +1161,7 @@ SamNormalMultichoice_ConfigurationTable: ;1227d tx Text03ff ; text id to print next db $ff ; marker byte -- end text entries db $0b, $02 ; cursor starting x, y - db $02 ; number of tiles the cursor moves per toggle + db $02 ; number of tiles the cursor moves per toggle db $04 ; cursor max index db $0f ; cursor image @@ -1202,7 +1248,7 @@ MainMenu_ContinueFromDiary: ; 12741 (4:6741) farcall Func_70000 call EnableSRAM xor a - ld [$ba44], a + ld [sba44], a call DisableSRAM ld a, GAME_EVENT_OVERWORLD ld [wGameEvent], a @@ -1234,7 +1280,10 @@ MainMenu_ContinueDuel: ; 1277e (4:677e) ret ; 0x1279a - INCROM $1279a, $12871 + INCROM $1279a, $12863 + +Func_12863: ; 12863 (4:6863) + INCROM $12863, $12871 Func_12871: ; 12871 (4:6871) INCROM $12871, $1288c @@ -1393,10 +1442,12 @@ FillNewSpriteAnimBufferEntry: ; 129d9 (4:69d9) pop bc pop hl ret -; 0x129fa Func_129fa: ; 129fa (4:69fa) ld a, [wWhichSprite] + ; fallthrough + +Func_129fd: ; 129fd (4:69fd) push af ld a, [wd5d7] or a @@ -1836,7 +1887,13 @@ Func_12c5e: ; 12c5e (4:6c5e) INCROM $12c5e, $12c7f Func_12c7f: ; 12c7f (4:6c7f) - INCROM $12c7f, $131b3 + INCROM $12c7f, $12fc6 + +Func_12fc6: ; 12fc6 (4:6fc6) + INCROM $12fc6, $130ca + +Func_130ca: ; 130ca (4:70ca) + INCROM $130ca, $131b3 Func_131b3: ; 131b3 (4:71b3) INCROM $131b3, $131d3 @@ -1859,12 +1916,12 @@ Func_1344d: ; 1344d (4:744d) Func_13485: ; 13485 (4:7485) call EnableSRAM - ld a, [$ba68] + ld a, [sba68] or a ret z - ld a, [$ba56] + ld a, [sba56] ld [wTxRam3], a - ld a, [$ba57] + ld a, [sba57] ld [wTxRam3 + 1], a call DisableSRAM call PauseSong diff --git a/src/engine/bank05.asm b/src/engine/bank05.asm index 0de163d..a1c6f0d 100644 --- a/src/engine/bank05.asm +++ b/src/engine/bank05.asm @@ -804,7 +804,7 @@ EstimateDamage_VersusDefendingCard: ; 143e5 (5:43e5) push hl ld [hl], $00 call CalculateDamage_VersusDefendingPokemon -; ...and subsequently recovered to continue the battle normally +; ...and subsequently recovered to continue the duel normally pop hl pop af ld [hl], a @@ -1025,7 +1025,7 @@ EstimateDamage_FromDefendingPokemon: ; 1450b (5:450b) push hl ld [hl], $00 call CalculateDamage_FromDefendingPokemon -; ...and subsequently recovered to continue the battle normally +; ...and subsequently recovered to continue the duel normally pop hl pop af ld [hl], a diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm index 10876f0..5c8fbda 100644 --- a/src/engine/bank06.asm +++ b/src/engine/bank06.asm @@ -923,26 +923,26 @@ glossary_entry: MACRO ENDM GlossaryData1: - glossary_entry 7, Text02fa, Text030c - glossary_entry 5, Text02fb, Text030d - glossary_entry 7, Text02fc, Text030e - glossary_entry 6, Text02fd, Text030f - glossary_entry 6, Text02fe, Text0310 - glossary_entry 4, Text02ff, Text0311 - glossary_entry 5, Text0300, Text0312 - glossary_entry 7, Text0301, Text0313 - glossary_entry 5, Text0302, Text0314 + glossary_entry 7, AboutTheDeckText, DeckDescriptionText + glossary_entry 5, AboutTheDiscardPileText, DiscardPileDescriptionText + glossary_entry 7, AboutTheHandText, HandDescriptionText + glossary_entry 6, AboutTheArenaText, ArenaDescriptionText + glossary_entry 6, AboutTheBenchText, BenchDescriptionText + glossary_entry 4, AboutTheActivePokemonText, ActivePokemonDescriptionText + glossary_entry 5, AboutBenchPokemonText, BenchPokemonDescriptionText + glossary_entry 7, AboutPrizesText, PrizesDescriptionText + glossary_entry 5, AboutDamageCountersText, DamageCountersDescriptionText GlossaryData2: - glossary_entry 5, Text0303, Text0315 - glossary_entry 5, Text0304, Text0316 - glossary_entry 5, Text0305, Text0317 - glossary_entry 5, Text0306, Text0318 - glossary_entry 6, Text0307, Text0319 - glossary_entry 5, Text0308, Text031a - glossary_entry 6, Text0309, Text031b - glossary_entry 6, Text030a, Text031c - glossary_entry 6, Text030b, Text031d + glossary_entry 5, AboutEnergyCardsText, EnergyCardsDescriptionText + glossary_entry 5, AboutTrainerCardsText, TrainerCardsDescriptionText + glossary_entry 5, AboutBasicPokemonText, BasicPokemonDescriptionText + glossary_entry 5, AboutEvolutionCardsText, EvolutionCardsDescriptionText + glossary_entry 6, AboutAttackingText, AttackingDescriptionText + glossary_entry 5, AboutPokemonPowerText, PokemonPowerDescriptionText + glossary_entry 6, AboutWeaknessText, WeaknessDescriptionText + glossary_entry 6, AboutResistanceText, ResistanceDescriptionText + glossary_entry 6, AboutRetreatingText, RetreatingDescriptionText Func_18661: ; 18661 (6:4661) xor a @@ -1375,13 +1375,13 @@ GetDamageText: ; 19168 (6:5168) ldtx hl, AttackDamageText and (1 << RESISTANCE) | (1 << WEAKNESS) ret z ; not weak or resistant - ldtx hl, ReceivedDamageDueToWeaknessAltText + ldtx hl, WeaknessMoreDamage2Text cp (1 << RESISTANCE) | (1 << WEAKNESS) ret z ; weak and resistant and (1 << WEAKNESS) - ldtx hl, ReceivedDamageDueToWeaknessText + ldtx hl, WeaknessMoreDamageText ret nz ; weak - ldtx hl, ReceivedDamageDueToResistanceText + ldtx hl, ResistanceLessDamageText ret ; resistant .no_damage @@ -1391,7 +1391,7 @@ GetDamageText: ; 19168 (6:5168) ld a, [wce81] and (1 << RESISTANCE) ret z ; not resistant - ldtx hl, DidNotReceiveDamageResistanceText + ldtx hl, ResistanceNoDamageText ret ; resistant UpdateMainSceneHUD: ; 19199 (6:5199) @@ -1657,7 +1657,7 @@ Func_1a68d: ; 1a68d (6:668d) call SetupText bank1call InitAndDrawCardListScreenLayout ldtx hl, ChooseTheCardYouWishToExamineText - ldtx de, Text0196 + ldtx de, BoosterPackText bank1call SetCardListHeaderText ld a, A_BUTTON | START ld [wNoItemSelectionMenuKeys], a @@ -1717,12 +1717,12 @@ Func_1a6cd: ; 1a6cd (6:66cd) ld hl, $00a3 bank1call DrawWholeScreenTextBox ld a, $0a - ld [$0000], a + ld [MBC3SRamEnable], a xor a ldh [hBankSRAM], a - ld [$4000], a - ld [$a000], a - ld [$0000], a + ld [MBC3SRamBank], a + ld [MBC3RTC], a + ld [MBC3SRamEnable], a jp Reset ret @@ -1745,7 +1745,7 @@ Func_1a73a: ; 1a73a (6:673a) or b jr nz, .asm_6749 ld a, $0a - ld [$0000], a + ld [MBC3SRamEnable], a ld a, e ld [s0a00b], a pop bc @@ -1761,20 +1761,20 @@ WhatIsYourNameData: ; 1a75e (6:675e) ; without any bank description. ; That is, the developers hard-coded it. -_-;; Deck1Data: ; 1a763 (6:6763) - textitem 2, 1, Text022b - textitem 14, 1, Text0219 + textitem 2, 1, Deck1Text + textitem 14, 1, DeckText db $ff Deck2Data: ; 1a76c (6:676c) - textitem 2, 1, Text022c - textitem 14, 1, Text0219 + textitem 2, 1, Deck2Text + textitem 14, 1, DeckText db $ff Deck3Data: ; 1a775 (6:6775) - textitem 2, 1, Text022d - textitem 14, 1, Text0219 + textitem 2, 1, Deck3Text + textitem 14, 1, DeckText db $ff Deck4Data: ; 1a77e (6:677e) - textitem 2, 1, Text022e - textitem 14, 1, Text0219 + textitem 2, 1, Deck4Text + textitem 14, 1, DeckText db $ff ; set each byte zero from hl for b bytes. @@ -1971,7 +1971,7 @@ DrawNamingScreenBG: ; 1a892 (6:6892) ; print "End". ld hl, .data call PlaceTextItems - ldtx hl, Text0221 + ldtx hl, PlayerNameKeyboardText lb de, 2, 4 call InitTextPrinting call ProcessTextFromID @@ -2848,7 +2848,7 @@ Func_1ae99: ; 1ae99 (6:6e99) ld hl, DrawNamingScreenBG.data call PlaceTextItems ; print the keyboard characters. - ldtx hl, NamingScreenKeyboardText ; "A B C D..." + ldtx hl, DeckNameKeyboardText ; "A B C D..." lb de, 2, 4 call InitTextPrinting call ProcessTextFromID @@ -3330,7 +3330,7 @@ Func_1bae4: ; 1bae4 (6:7ae4) push af ld hl, wd088 ld b, [hl] - farcall $2, $7625 + farcall Func_b625 jr c, .asm_7af5 pop af ld [wd0a6], a diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm index ce0087e..953defc 100644 --- a/src/engine/bank07.asm +++ b/src/engine/bank07.asm @@ -112,7 +112,7 @@ Func_1c461: ; 1c461 (7:4461) ld a, b ld [hli], a ld [hl], c - call $46e3 + call Func_1c6e3 pop bc pop hl ret @@ -214,7 +214,7 @@ Func_1c50a: ; 1c50a (7:450a) ld a, [hl] or a jr z, .asm_1c52c - call $44fa + call Func_1c4fa jr nc, .asm_1c521 xor a ld [wd3b8], a @@ -223,7 +223,7 @@ Func_1c50a: ; 1c50a (7:450a) xor a ld [hli], a ld a, [hl] - farcall $4, $69fd + farcall Func_129fd ld hl, wd349 dec [hl] @@ -337,7 +337,7 @@ Func_1c5e9: ; 1c5e9 (7:45e9) ld l, LOADED_NPC_FIELD_07 call GetItemInLoadedNPCIndex ld a, [hl] - ld bc, $fffd + ld bc, -3 add hl, bc ld [hl], a call Func_1c58e @@ -346,6 +346,7 @@ Func_1c5e9: ; 1c5e9 (7:45e9) ret ; 0x1c5ff +Func_1c5ff: ; 1c5ff (7:45ff) INCROM $1c5ff, $1c610 Func_1c610: ; 1c610 (7:4610) @@ -382,7 +383,7 @@ Func_1c719: ; 1c719 (7:4719) ld b, a ld c, [hl] ld a, $40 - call $3937 + call UpdatePermissionOfMapPosition pop bc pop hl ret @@ -473,12 +474,12 @@ Func_1c78d: ; 1c78d (7:478d) inc hl ld [hl], b dec hl - call $39ea + call Func_39ea cp $f0 jr nc, .asm_1c7bb push af and $7f - call $45ff + call Func_1c5ff pop af bit 7, a jr z, .asm_1c7dc @@ -489,7 +490,7 @@ Func_1c78d: ; 1c78d (7:478d) cp $ff jr z, .asm_1c7d2 inc bc - call $39ea + call Func_39ea push hl ld l, a ld h, $0 @@ -551,8 +552,8 @@ Func_1c83d: ; 1c83d (7:483d) pop bc pop hl ret -; 0x1c858 +Func_1c858: ; 1c858 (7:4858) INCROM $1c858, $1c8bc Func_1c8bc: ; 1c8bc (7:48bc) @@ -1014,7 +1015,7 @@ Func_1cb18: ; 1cb18 (7:4b18) cp $ff jr z, .asm_1cb4b ld [wWhichSprite], a - farcall $4, $69fa + farcall Func_129fa ld a, $ff ld [hl], a .asm_1cb4b @@ -1166,7 +1167,7 @@ Func_1cc03: ; 1cc03 (7:4c03) ret ; 0x1cc2f -.Func_1cc2f +.Func_1cc2f ld a, $4e .loop inc a @@ -2302,8 +2303,8 @@ Func_1d078: ; 1d078 (7:5078) ld a, MUSIC_STOP call PlaySong call Func_3ca0 - call $5335 - call $53ce + call Func_1d335 + call Func_1d3ce xor a ld [wd635], a ld a, $3c @@ -2311,7 +2312,7 @@ Func_1d078: ; 1d078 (7:5078) .asm_1d095 call DoFrameIfLCDEnabled call UpdateRNGSources - call $5614 + call Func_1d614 ld hl, wd635 inc [hl] call AssertSongFinished @@ -2335,46 +2336,46 @@ Func_1d078: ; 1d078 (7:5078) farcall Func_10ab4 .asm_1d0c7 - call $50fa - call $511c + call Func_1d0fa + call Func_1d11c ld a, [wd628] cp $2 jr nz, .asm_1d0db - call $5289 + call Func_1d289 jr c, Func_1d078 jr .asm_1d0e7 .asm_1d0db ld a, [wd628] cp $1 jr nz, .asm_1d0e7 - call $52b8 + call Func_1d2b8 jr c, Func_1d078 .asm_1d0e7 ld a, [wd628] cp $0 jr nz, .asm_1d0f3 - call $52dd + call Func_1d2dd jr c, Func_1d078 .asm_1d0f3 call ResetDoFrameFunction call Func_3ca0 ret -; 0x1d0fa +Func_1d0fa: ; 1d0fa (7:50fa) INCROM $1d0fa, $1d11c Func_1d11c: ; 1d11c (7:511c) ld a, MUSIC_PC_MAIN_MENU call PlaySong call DisableLCD - farcall $4, $4000 + farcall Func_10000 lb de, $30, $8f call SetupText call Func_3ca0 xor a ld [wLineSeparation], a - call $51e1 - call $517f + call Func_1d1e1 + call Func_1d17f ld a, $ff ld [wd626], a ld a, [wd627] @@ -2387,13 +2388,13 @@ Func_1d11c: ; 1d11c (7:511c) .asm_1d14f ld hl, wd636 farcall Func_111e9 - farcall $4, $4031 + farcall Func_10031 .asm_1d15a call DoFrameIfLCDEnabled call UpdateRNGSources call HandleMenuInput push af - call $51e9 + call Func_1d1e9 pop af jr nc, .asm_1d15a ldh a, [hCurMenuItem] @@ -2409,12 +2410,30 @@ Func_1d11c: ; 1d11c (7:511c) ld a, e ld [wd628], a ret -; 0x1d17f - INCROM $1d17f, $1d306 +Func_1d17f: ; 1d17f (7:517f) + INCROM $1d17f, $1d1e1 + +Func_1d1e1: ; 1d1e1 (7:51e1) + INCROM $1d1e1, $1d1e9 + +Func_1d1e9: ; 1d1e9 (7:51e9) + INCROM $1d1e9, $1d289 + +Func_1d289: ; 1d289 (7:5289) + INCROM $1d289, $1d2b8 + +Func_1d2b8: ; 1d2b8 (7:52b8) + INCROM $1d2b8, $1d2dd + +Func_1d2dd: ; 1d2dd (7:52dd) + INCROM $1d2dd, $1d306 Func_1d306: ; 1d306 (7:5306) - INCROM $1d306, $1d386 + INCROM $1d306, $1d335 + +Func_1d335: ; 1d335 (7:5335) + INCROM $1d335, $1d386 Titlescreen_1d386: ; 1d386 (7:5386) call AssertSongFinished @@ -2434,7 +2453,10 @@ Titlescreen_1d386: ; 1d386 (7:5386) ret Func_1d3a9: ; 1d3a9 (7:53a9) - INCROM $1d3a9, $1d42e + INCROM $1d3a9, $1d3ce + +Func_1d3ce: ; 1d3ce (7:53ce) + INCROM $1d3ce, $1d42e Func_1d42e: ; 1d42e (7:542e) INCROM $1d42e, $1d519 @@ -2450,35 +2472,38 @@ Titlescreen_1d519: ; 1d519 (7:5519) INCROM $1d523, $1d59c Func_1d59c: ; 1d59c (7:559c) - INCROM $1d59c, $1d6ad + INCROM $1d59c, $1d614 + +Func_1d614: ; 1d614 (7:5614) + INCROM $1d614, $1d6ad Credits_1d6ad: ; 1d6ad (7:56ad) ld a, MUSIC_STOP call PlaySong - call $5705 - call $4858 + call Func_1d705 + call Func_1c858 xor a ld [wd324], a ld a, MUSIC_CREDITS call PlaySong - farcall $4, $4031 - call $57fc + farcall Func_10031 + call Func_1d7fc .asm_1d6c8 call DoFrameIfLCDEnabled - call $5765 - call $580b + call Func_1d765 + call Func_1d80b ld a, [wd633] cp $ff jr nz, .asm_1d6c8 call WaitForSongToFinish ld a, $8 - farcall $4, $6863 + farcall Func_12863 ld a, MUSIC_STOP call PlaySong farcall Func_10ab4 call Func_3ca4 call Set_WD_off - call $5758 + call Func_1d758 call EnableLCD call DoFrameIfLCDEnabled call DisableLCD @@ -2486,6 +2511,18 @@ Credits_1d6ad: ; 1d6ad (7:56ad) set 1, [hl] call ResetDoFrameFunction ret -; 0x1d705 - INCROM $1d705, $1e1c4 +Func_1d705: ; 1d705 (7:5705) + INCROM $1d705, $1d758 + +Func_1d758: ; 1d758 (7:5758) + INCROM $1d758, $1d765 + +Func_1d765: ; 1d765 (7:5765) + INCROM $1d765, $1d7fc + +Func_1d7fc: ; 1d7fc (7:57fc) + INCROM $1d7fc, $1d80b + +Func_1d80b: ; 1d80b (7:580b) + INCROM $1d80b, $1e1c4 diff --git a/src/engine/bank20.asm b/src/engine/bank20.asm index dfc8304..9e5aa31 100644 --- a/src/engine/bank20.asm +++ b/src/engine/bank20.asm @@ -5,9 +5,9 @@ Func_80028: ; 80028 (20:4028) call Func_801f1 ld bc, $0000 call Func_80077 - farcall $3, $49c7 - call $41a1 - farcall $3, $43ee + farcall Func_c9c7 + call Func_801a1 + farcall Func_c3ee ret ; 0x8003d @@ -16,12 +16,12 @@ Func_80028: ; 80028 (20:4028) Func_80077: ; 80077 (20:4077) ld a, $1 ld [wd292], a - jr .asm_80082 + jr Func_80082 xor a ld [wd292], a -.asm_80082 +Func_80082: ; 80082 (20:4082) push hl push bc push de @@ -78,7 +78,7 @@ Func_800bd: ; 800bd (20:40bd) Func_800e0: ; 800e0 (20:40e0) push hl - ld hl, $d28e + ld hl, wd28e ld a, [wd12f] ld [hl], a ld a, [wd23c] @@ -99,7 +99,7 @@ Func_800e0: ; 800e0 (20:40e0) push bc push de ld b, $00 - ld a, [$d28e] + ld a, [wd28e] ld c, a ld de, wLoadedPalData call Func_3be4 @@ -138,17 +138,17 @@ Func_800e0: ; 800e0 (20:40e0) ret Func_80148: ; 80148 (20:4148) - ld a, [$d291] + ld a, [wd291] or a ret z - ld a, [$d23c] + ld a, [wd23c] or a jr z, .asm_80162 push hl push bc .asm_80155 push bc - ld a, [$d291] + ld a, [wd291] add [hl] ld [hli], a pop bc @@ -160,7 +160,7 @@ Func_80148: ; 80148 (20:4148) .asm_80162 push hl push bc - ld a, [$d291] + ld a, [wd291] .asm_80167 ld [hli], a dec b @@ -411,7 +411,7 @@ Func_803b9: ; 803b9 (20:43b9) call GetMapDataPointer call LoadGraphicsPointerFromHL ld a, [hl] - ld [$d239], a + ld [wd239], a ret ; 0x803c9 @@ -571,9 +571,9 @@ Func_80b89: ; 80b89 (20:4b89) push af ld c, a ld a, $01 - ld [$d292], a + ld [wd292], a ld b, $00 - ld hl, $d323 + ld hl, wd323 add hl, bc ld a, [hl] or a @@ -619,7 +619,7 @@ Func_80baa: ; 80baa (20:4baa) add a ld c, a ld b, $0 - ld hl, $4c21 + ld hl, Unknown_80c21 add hl, bc ld a, [hli] ld h, [hl] @@ -637,7 +637,7 @@ Func_80baa: ; 80baa (20:4baa) ld a, [hl] ld [wd131], a push bc - farcall $20, $4082 + farcall Func_80082 pop bc srl b ld a, c @@ -649,7 +649,7 @@ Func_80baa: ; 80baa (20:4baa) ld b, $0 ld hl, wBoosterViableCardList add hl, bc - farcall $3, $438f + farcall Func_c38f pop af ld [wd23b], a pop af @@ -666,8 +666,8 @@ Func_80baa: ; 80baa (20:4baa) pop bc pop hl ret -; 0x80c21 +Unknown_80c21: ; 80c21 (20:4c21) INCROM $80c21, $80e5a SpriteNullAnimationPointer: ; 80e5a (20:4e5a) diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm index 63a3642..45e71a2 100644 --- a/src/engine/effect_functions.asm +++ b/src/engine/effect_functions.asm @@ -495,7 +495,7 @@ ApplyAndAnimateHPRecovery: ; 2c221 (b:4221) ld e, a ld a, 0 adc d - ld d, a + ld d, a ; de = damage dealt + current HP ; bc = max HP of card call CompareDEtoBC @@ -877,7 +877,7 @@ HandleDefendingPokemonAttackSelection: ; 2c391 (b:4391) db 2 ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; 0x2c3fc ; loads in hl the pointer to attack's name. @@ -1244,7 +1244,7 @@ HandleColorChangeScreen: ; 2c588 (b:4588) db MAX_PLAY_AREA_POKEMON ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; 0x2c5be .DrawScreen: ; 2c5be (b:45be) @@ -1444,7 +1444,7 @@ PlayAreaSelectionMenuParameters: ; 2c6e0 (b:46e0) db MAX_PLAY_AREA_POKEMON ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; 0x2c6e8 BenchSelectionMenuParameters: ; 2c6e8 (b:46e8) @@ -1453,7 +1453,7 @@ BenchSelectionMenuParameters: ; 2c6e8 (b:46e8) db MAX_PLAY_AREA_POKEMON ; number of items db SYM_CURSOR_R ; cursor tile number db SYM_SPACE ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; 0x2c6f0 SpitPoison_AIEffect: ; 2c6f0 (b:46f0) @@ -9097,7 +9097,7 @@ MorphEffect: ; 2eff6 (b:6ff6) .successful ld a, DUELVARS_ARENA_CARD_STAGE call GetTurnDuelistVariable - or a + or a jr z, .skip_discard_stage_below ; if this is a stage 1 Pokemon (in case it's used diff --git a/src/engine/home.asm b/src/engine/home.asm index 9a0fcbb..944a99f 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -7983,7 +7983,7 @@ NarrowTextBoxMenuParameters: ; 2a96 (0:2a96) db 1 ; number of items db SYM_CURSOR_D ; cursor tile number db SYM_BOX_BOTTOM ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; draw a 20x6 text box aligned to the bottom of the screen DrawWideTextBox: ; 2a9e (0:2a9e) @@ -8020,7 +8020,7 @@ WideTextBoxMenuParameters: ; 2ac8 (0:2ac8) db 1 ; number of items db SYM_CURSOR_D ; cursor tile number db SYM_BOX_BOTTOM ; tile behind cursor - dw $0000 ; function pointer if non-0 + dw NULL ; function pointer if non-0 ; display a two-item horizontal menu with custom text provided in hl and handle input TwoItemHorizontalMenu: ; 2ad0 (0:2ad0) @@ -8793,7 +8793,7 @@ LoadTxRam3: ; 2ec4 (0:2ec4) ; load data of card with text id of name at de to wLoadedCard1 LoadCardDataToBuffer1_FromName: ; 2ecd (0:2ecd) - ld hl, CardPointers + 2 ; skip first $0000 pointer + ld hl, CardPointers + 2 ; skip first NULL pointer ld a, BANK(CardPointers) call BankpushROM2 .find_card_loop @@ -9051,7 +9051,7 @@ CheckMatchingCommand: ; 2ffe (0:2ffe) ld a, l or h jr nz, .not_null_pointer - ; return carry if pointer is $0000 + ; return carry if pointer is NULL scf ret @@ -10639,7 +10639,7 @@ GameEvent_Duel: ; 38c0 (0:38c0) ld [wd112], a call EnableSRAM xor a - ld [$ba44], a + ld [sba44], a call DisableSRAM call Func_3a3b bank1call StartDuel @@ -10652,7 +10652,7 @@ GameEvent_ChallengeMachine: ; 38db (0:38db) call Func_39fc call EnableSRAM xor a - ld [$ba44], a + ld [sba44], a call DisableSRAM .asm_38ed farcall Func_131d3 @@ -10667,7 +10667,7 @@ GameEvent_ContinueDuel: ; 38fb (0:38fb) ld [wd112], a bank1call TryContinueDuel call EnableSRAM - ld a, [$ba44] + ld a, [sba44] call DisableSRAM cp $ff jr z, GameEvent_ChallengeMachine.asm_38ed @@ -10680,7 +10680,7 @@ GameEvent_Credits: ; 3911 (0:3911) ret Func_3917: ; 3917 (0:3917) - ld a, EVENT_RECEIVED_LEGENDARY_CARD + ld a, EVENT_RECEIVED_LEGENDARY_CARDS farcall GetEventFlagValue call EnableSRAM ld [s0a00a], a @@ -10750,31 +10750,35 @@ CopyGfxDataFromTempBank: ; 395a (0:395a) call BankswitchROM ret -Unknown_396b: ; 396b (0:396b) - db $00, -$01, $01, $00, $00, $01, -$01, $00 - ; Movement offsets for player movements -PlayerMovementOffsetTable: ; 3973 (0:3973) - db 0, -2 ; move 2 tiles up - db 2, 0 ; move 2 tiles right - db 0, 2 ; move 2 tiles down - db -2, 0 ; move 2 tiles left - -Unknown_397b: ; 397b (0:397b) - dw $0323 - dw $0323 - dw $0324 - dw $0325 - dw $0326 - dw $0327 - dw $0328 - dw $0329 - dw $032a - dw $032b - dw $032c - dw $032d - dw $032e - dw $032f +PlayerMovementOffsetTable: ; 396b (0:396b) + db 0, -1 ; NORTH + db 1, 0 ; EAST + db 0, 1 ; SOUTH + db -1, 0 ; WEST + +; Movement offsets for player movements, in tiles +PlayerMovementOffsetTable_Tiles: ; 3973 (0:3973) + db 0, -2 ; NORTH + db 2, 0 ; EAST + db 0, 2 ; SOUTH + db -2, 0 ; WEST + +OverworldMapNames: ; 397b (0:397b) + tx OverworldMapMasonLaboratoryText + tx OverworldMapMasonLaboratoryText + tx OverworldMapIshiharasHouseText + tx OverworldMapFightingClubText + tx OverworldMapRockClubText + tx OverworldMapWaterClubText + tx OverworldMapLightningClubText + tx OverworldMapGrassClubText + tx OverworldMapPsychicClubText + tx OverworldMapScienceClubText + tx OverworldMapFireClubText + tx OverworldMapChallengeHallText + tx OverworldMapPokemonDomeText + tx OverworldMapMysteryHouseText Func_3997: ; 3997 (0:3997) ldh a, [hBankROM] @@ -11060,9 +11064,9 @@ RunOverworldScript: ; 3aed (0:3aed) Func_3b11: ; 3b11 (0:3b11) ldh a, [hBankROM] push af - ld a, $04 + ld a, BANK(_GameLoop) call BankswitchROM - call $66d1 + call _GameLoop pop af call BankswitchROM ret @@ -11194,7 +11198,7 @@ SetDoFrameFunction: ; 3bd2 (0:3bd2) ResetDoFrameFunction: ; 3bdb (0:3bdb) push hl - ld hl, $0000 + ld hl, NULL call SetDoFrameFunction pop hl ret @@ -11334,7 +11338,7 @@ DivideBCbyDE: ; 3c5a (0:3c5a) jr nz, .asm_3c63 ret -CallPlaySong: ; 3c83 (0:3c83) +ScriptPlaySong: ; 3c83 (0:3c83) call PlaySong ret @@ -11632,9 +11636,9 @@ Func_3e17: ; 3e17 (0:3e17) ld [wd131], a ldh a, [hBankROM] push af - ld a, $4 + ld a, BANK(Func_12fc6) call BankswitchROM - call $6fc6 + call Func_12fc6 pop af call BankswitchROM ret @@ -11649,9 +11653,9 @@ Func_3e31: ; 3e31 (0:3e31) ldh a, [hBankROM] push af call Func_3cb4 - ld a, $20 + ld a, BANK(Func_804d8) call BankswitchROM - call $44d8 + call Func_804d8 pop af call BankswitchROM ret diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm index 6836b4d..fd8aacf 100755..100644 --- a/src/macros/scripts.asm +++ b/src/macros/scripts.asm @@ -5,16 +5,16 @@ run_command: MACRO ENDM const_def - const ScriptCommand_EndScriptLoop1_index ; $00 + const ScriptCommand_EndScript_index ; $00 const ScriptCommand_CloseAdvancedTextBox_index ; $01 - const ScriptCommand_PrintTextString_index ; $02 - const Func_ccdc_index ; $03 + const ScriptCommand_PrintNPCText_index ; $02 + const ScriptCommand_PrintText_index ; $03 const ScriptCommand_AskQuestionJump_index ; $04 - const ScriptCommand_StartBattle_index ; $05 - const ScriptCommand_PrintVariableText_index ; $06 - const Func_cda8_index ; $07 + const ScriptCommand_StartDuel_index ; $05 + const ScriptCommand_PrintVariableNPCText_index ; $06 + const ScriptCommand_PrintVariableText_index ; $07 const ScriptCommand_PrintTextQuitFully_index ; $08 - const Func_cdcb_index ; $09 + const ScriptCommand_UnloadActiveNPC_index ; $09 const ScriptCommand_MoveActiveNPCByDirection_index ; $0a const ScriptCommand_CloseTextBox_index ; $0b const ScriptCommand_GiveBoosterPacks_index ; $0c @@ -22,16 +22,16 @@ ENDM const ScriptCommand_JumpIfCardInCollection_index ; $0e const ScriptCommand_GiveCard_index ; $0f const ScriptCommand_TakeCard_index ; $10 - const Func_cf53_index ; $11 - const Func_cf7b_index ; $12 + const ScriptCommand_JumpIfAnyEnergyCardsInCollection_index ; $11 + const ScriptCommand_RemoveAllEnergyCardsFromCollection_index ; $12 const ScriptCommand_JumpIfEnoughCardsOwned_index ; $13 const ScriptCommand_JumpBasedOnFightingClubPupilStatus_index ; $14 - const Func_cfc6_index ; $15 - const Func_cfd4_index ; $16 - const Func_d00b_index ; $17 - const Func_d025_index ; $18 - const Func_d032_index ; $19 - const Func_d03f_index ; $1a + const ScriptCommand_SetActiveNPCDirection_index ; $15 + const ScriptCommand_PickNextMan1RequestedCard_index ; $16 + const ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot_index ; $17 + const ScriptCommand_JumpIfMan1RequestedCardOwned_index ; $18 + const ScriptCommand_JumpIfMan1RequestedCardInCollection_index ; $19 + const ScriptCommand_RemoveMan1RequestedCardFromCollection_index ; $1a const ScriptCommand_Jump_index ; $1b const ScriptCommand_TryGiveMedalPCPacks_index ; $1c const ScriptCommand_SetPlayerDirection_index ; $1d @@ -39,60 +39,60 @@ ENDM const ScriptCommand_ShowCardReceivedScreen_index ; $1f const ScriptCommand_SetDialogNPC_index ; $20 const ScriptCommand_SetNextNPCAndScript_index ; $21 - const Func_d095_index ; $22 - const Func_d0be_index ; $23 + const ScriptCommand_SetSpriteAttributes_index ; $22 + const ScriptCommand_SetActiveNPCCoords_index ; $23 const ScriptCommand_DoFrames_index ; $24 - const Func_d0d9_index ; $25 + const ScriptCommand_JumpIfActiveNPCCoordsMatch_index ; $25 const ScriptCommand_JumpIfPlayerCoordsMatch_index ; $26 const ScriptCommand_MoveActiveNPC_index ; $27 const ScriptCommand_GiveOneOfEachTrainerBooster_index ; $28 - const Func_d103_index ; $29 - const Func_d125_index ; $2a - const Func_d135_index ; $2b - const Func_d16b_index ; $2c - const Func_cd4f_index ; $2d - const Func_cd94_index ; $2e - const ScriptCommand_MoveWramNPC_index ; $2f - const Func_cdd8_index ; $30 - const Func_cdf5_index ; $31 - const Func_d195_index ; $32 - const Func_d1ad_index ; $33 - const Func_d1b3_index ; $34 + const ScriptCommand_JumpIfNPCLoaded_index ; $29 + const ScriptCommand_ShowMedalReceivedScreen_index ; $2a + const ScriptCommand_LoadCurrentMapNameIntoTxRamSlot_index ; $2b + const ScriptCommand_LoadChallengeHallNPCIntoTxRamSlot_index ; $2c + const ScriptCommand_StartChallengeHallDuel_index ; $2d + const ScriptCommand_PrintTextForChallengeCup_index ; $2e + const ScriptCommand_MoveChallengeHallNPC_index ; $2f + const ScriptCommand_UnloadChallengeHallNPC_index ; $30 + const ScriptCommand_SetChallengeHallNPCCoords_index ; $31 + const ScriptCommand_PickChallengeHallOpponent_index ; $32 + const ScriptCommand_OpenMenu_index ; $33 + const ScriptCommand_PickChallengeCupPrizeCard_index ; $34 const ScriptCommand_QuitScriptFully_index ; $35 - const Func_d244_index ; $36 + const ScriptCommand_ReplaceMapBlocks_index ; $36 const ScriptCommand_ChooseDeckToDuelAgainstMultichoice_index ; $37 const ScriptCommand_OpenDeckMachine_index ; $38 const ScriptCommand_ChooseStarterDeckMultichoice_index ; $39 const ScriptCommand_EnterMap_index ; $3a const ScriptCommand_MoveArbitraryNPC_index ; $3b - const Func_d209_index ; $3c - const Func_d38f_index ; $3d - const Func_d396_index ; $3e - const Func_cd76_index ; $3f - const Func_d39d_index ; $40 - const Func_d3b9_index ; $41 + const ScriptCommand_PickLegendaryCard_index ; $3c + const ScriptCommand_FlashScreen_index ; $3d + const ScriptCommand_SaveGame_index ; $3e + const ScriptCommand_BattleCenter_index ; $3f + const ScriptCommand_GiftCenter_index ; $40 + const ScriptCommand_PlayCredits_index ; $41 const ScriptCommand_TryGivePCPack_index ; $42 const ScriptCommand_nop_index ; $43 - const Func_d3d4_index ; $44 - const Func_d3e0_index ; $45 - const Func_d3fe_index ; $46 - const Func_d408_index ; $47 - const Func_d40f_index ; $48 + const ScriptCommand_GiveStarterDeck_index ; $44 + const ScriptCommand_WalkPlayerToMasonLaboratory_index ; $45 + const ScriptCommand_OverrideSong_index ; $46 + const ScriptCommand_SetDefaultSong_index ; $47 + const ScriptCommand_PlaySong_index ; $48 const ScriptCommand_PlaySFX_index ; $49 const ScriptCommand_PauseSong_index ; $4a const ScriptCommand_ResumeSong_index ; $4b - const Func_d41d_index ; $4c + const ScriptCommand_PlayDefaultSong_index ; $4c const ScriptCommand_WaitForSongToFinish_index ; $4d - const Func_d435_index ; $4e + const ScriptCommand_RecordMasterWin_index ; $4e const ScriptCommand_AskQuestionJumpDefaultYes_index ; $4f const ScriptCommand_ShowSamNormalMultichoice_index ; $50 const ScriptCommand_ShowSamTutorialMultichoice_index ; $51 - const Func_d43d_index ; $52 - const ScriptCommand_EndScriptLoop2_index ; $53 - const ScriptCommand_EndScriptLoop3_index ; $54 - const ScriptCommand_EndScriptLoop4_index ; $55 - const ScriptCommand_EndScriptLoop5_index ; $56 - const ScriptCommand_EndScriptLoop6_index ; $57 + const ScriptCommand_ChallengeMachine_index ; $52 + const ScriptCommand_EndScript2_index ; $53 + const ScriptCommand_EndScript3_index ; $54 + const ScriptCommand_EndScript4_index ; $55 + const ScriptCommand_EndScript5_index ; $56 + const ScriptCommand_EndScript6_index ; $57 const ScriptCommand_SetFlagValue_index ; $58 const ScriptCommand_JumpIfFlagZero1_index ; $59 const ScriptCommand_JumpIfFlagNonzero1_index ; $5a @@ -105,16 +105,16 @@ ENDM const ScriptCommand_JumpIfFlagNonzero2_index ; $61 const ScriptCommand_JumpIfFlagZero2_index ; $62 const ScriptCommand_IncrementFlagValue_index ; $63 - const ScriptCommand_EndScriptLoop7_index ; $64 - const ScriptCommand_EndScriptLoop8_index ; $65 - const ScriptCommand_EndScriptLoop9_index ; $66 - const ScriptCommand_EndScriptLoop10_index ; $67 + const ScriptCommand_EndScript7_index ; $64 + const ScriptCommand_EndScript8_index ; $65 + const ScriptCommand_EndScript9_index ; $66 + const ScriptCommand_EndScript10_index ; $67 ; Script Macros ; Stops the current script and returns control flow back to assembly -end_script_loop: MACRO - run_command ScriptCommand_EndScriptLoop1 +end_script: MACRO + run_command ScriptCommand_EndScript ENDM ; Closes current dialog window @@ -122,9 +122,15 @@ close_advanced_text_box: MACRO run_command ScriptCommand_CloseAdvancedTextBox ENDM +; Opens a new dialog window and displays the given text and active npc name +print_npc_text: MACRO + run_command ScriptCommand_PrintNPCText + tx \1 ; Text Pointer +ENDM + ; Opens a new dialog window and displays the given text -print_text_string: MACRO - run_command ScriptCommand_PrintTextString +print_text: MACRO + run_command ScriptCommand_PrintText tx \1 ; Text Pointer ENDM @@ -140,14 +146,21 @@ ENDC dw \2 ; Jump Location ENDM -; Begins a battle with the NPC currently being spoken to -start_battle: MACRO - run_command ScriptCommand_StartBattle +; Begins a duel with the NPC currently being spoken to +start_duel: MACRO + run_command ScriptCommand_StartDuel db \1 ; Prize Amount (ex PRIZES_2) db \2 ; Deck ID (ex SAMS_PRACTICE_DECK_ID) db \3 ; Duel Music (ex MUSIC_DUEL_THEME_1) ENDM +; Prints the first or second npc text depending on if wScriptControlByte is nonzero or zero respectively +print_variable_npc_text: MACRO + run_command ScriptCommand_PrintVariableNPCText + tx \1 ; Text Pointer + tx \2 ; Text Pointer +ENDM + ; Prints the first or second text depending on if wScriptControlByte is nonzero or zero respectively print_variable_text: MACRO run_command ScriptCommand_PrintVariableText @@ -161,6 +174,11 @@ print_text_quit_fully: MACRO tx \1 ; Text Pointer ENDM +; Removes the current NPC from the map +unload_active_npc: MACRO + run_command ScriptCommand_UnloadActiveNPC +ENDM + ; Moves the current NPC depending on their current direction ; Argument points to a table of 4 NPCMovements chosen based on direction value move_active_npc_by_direction: MACRO @@ -208,6 +226,17 @@ take_card: MACRO db \1 ; card ID (ex LAPRAS) ENDM +; Jumps to a given script position if the player has any energy cards in their collection +jump_if_any_energy_cards_in_collection: MACRO + run_command ScriptCommand_JumpIfAnyEnergyCardsInCollection + dw \1 ; script label +ENDM + +; Removes all of the player's energy cards from their collection +remove_all_energy_cards_from_collection: MACRO + run_command ScriptCommand_RemoveAllEnergyCardsFromCollection +ENDM + ; Jumps to a given script position if the player owns enough cards jump_if_enough_cards_owned: MACRO run_command ScriptCommand_JumpIfEnoughCardsOwned @@ -225,6 +254,40 @@ fight_club_pupil_jump: MACRO dw \5 ; Script Label (All Pupils Defeated) ENDM +; Causes the active NPC to face the specified direction +set_active_npc_direction: MACRO + run_command ScriptCommand_SetActiveNPCDirection + db \1 ; Direction (ex NORTH) +ENDM + +; Picks the next card gift that will be requested by NPC_MAN1 +pick_next_man1_requested_card: MACRO + run_command ScriptCommand_PickNextMan1RequestedCard +ENDM + +; Loads into the given txram slot the name of the card gift requested by NPC_MAN1 +load_man1_requested_card_into_txram_slot: MACRO + run_command ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot + db \1 ; TxRam slot +ENDM + +; Jumps to the given script position if the player owns the card gift requested by NPC_MAN1 +jump_if_man1_requested_card_owned: MACRO + run_command ScriptCommand_JumpIfMan1RequestedCardOwned + dw \1 ; Script Label +ENDM + +; Jumps to the given script position if the player's collection contains the card gift requested by NPC_MAN1 +jump_if_man1_requested_card_in_collection: MACRO + run_command ScriptCommand_JumpIfMan1RequestedCardInCollection + dw \1 ; Script Label +ENDM + +; Removes from the player's collection the card gift requested by NPC_MAN1 +remove_man1_requested_card_from_collection: MACRO + run_command ScriptCommand_RemoveMan1RequestedCardFromCollection +ENDM + ; Jumps to a given script position script_jump: MACRO run_command ScriptCommand_Jump @@ -268,12 +331,35 @@ set_next_npc_and_script: MACRO dw \2 ; Script Label ENDM +; Sets some NPC sprite attributes +set_sprite_attributes: MACRO + run_command ScriptCommand_SetSpriteAttributes + db \1 ; Relates to LOADED_NPC_FIELD_06 + db \2 ; Relates to LOADED_NPC_FIELD_06 + db \3 ; Relates to LOADED_NPC_FIELD_05 +ENDM + +; Sets the active NPC's coords +set_active_npc_coords: MACRO + run_command ScriptCommand_SetActiveNPCCoords + db \1 ; X Coord + db \2 ; Y Coord +ENDM + ; Waits a number of frames do_frames: MACRO run_command ScriptCommand_DoFrames db \1 ; Number of frames to wait ENDM +; Jumps to a script position if the active NPC's X and Y match the given values +jump_if_active_npc_coords_match: MACRO + run_command ScriptCommand_JumpIfActiveNPCCoordsMatch + db \1 ; X Coord + db \2 ; Y Coord + dw \3 ; Script Label +ENDM + ; Jumps to a script position if the player's X and Y match the given values jump_if_player_coords_match: MACRO run_command ScriptCommand_JumpIfPlayerCoordsMatch @@ -293,18 +379,94 @@ give_one_of_each_trainer_booster: MACRO run_command ScriptCommand_GiveOneOfEachTrainerBooster ENDM -; Moves the NPC in wTempNPC using an NPCMovement -move_wram_npc: MACRO - run_command ScriptCommand_MoveWramNPC +; Jumps to a script position if the NPC is loaded +jump_if_npc_loaded: MACRO + run_command ScriptCommand_JumpIfNPCLoaded + db \1 ; NPC (ex NPC_DRMASON) + dw \2 ; Script Label +ENDM + +; Shows the medal received screen for the given master medal +show_medal_received_screen: MACRO + run_command ScriptCommand_ShowMedalReceivedScreen + db \1 ; medal event (ex EVENT_BEAT_NIKKI) +ENDM + +; Loads the current map name into the given txram slot +load_current_map_name_into_txram_slot: MACRO + run_command ScriptCommand_LoadCurrentMapNameIntoTxRamSlot + db \1 ; TxRam slot +ENDM + +; Loads the challenge hall opponent NPC name into the given txram slot +load_challenge_hall_npc_into_txram_slot: MACRO + run_command ScriptCommand_LoadChallengeHallNPCIntoTxRamSlot + db \1 ; TxRam slot +ENDM + +; Begins a duel with the challenge hall opponent +; The deck and song arguments are overwritten when the duel is initialized +start_challenge_hall_duel: MACRO + run_command ScriptCommand_StartChallengeHallDuel + db \1 ; Prize Amount (ex PRIZES_2) + db \2 ; Deck ID (ex SAMS_PRACTICE_DECK_ID) + db \3 ; Duel Music (ex MUSIC_DUEL_THEME_1) +ENDM + +; Prints the text based on the current challenge cup number +print_text_for_challenge_cup: MACRO + run_command ScriptCommand_PrintTextForChallengeCup + tx \1 ; Text Pointer for Challenge Cup #1 + tx \2 ; Text Pointer for Challenge Cup #2 + tx \3 ; Text Pointer for Challenge Cup #3 +ENDM + +; Moves the Challenge Hall opponent NPC using an NPCMovement +move_challenge_hall_npc: MACRO + run_command ScriptCommand_MoveChallengeHallNPC dw \1 ; NPCMovement (ex NPCMovement_d880) ENDM +; Unloads the Challenge Hall opponent NPC +unload_challenge_hall_npc: MACRO + run_command ScriptCommand_UnloadChallengeHallNPC +ENDM + +; Sets the Challenge Hall opponent NPC's coords +set_challenge_hall_npc_coords: MACRO + run_command ScriptCommand_SetChallengeHallNPCCoords + db \1 ; X Coord + db \2 ; Y Coord +ENDM + +; Picks the next Challenge Hall opponent NPC +pick_challenge_hall_opponent: MACRO + run_command ScriptCommand_PickChallengeHallOpponent +ENDM + +; Opens the pause menu +open_menu: MACRO + run_command ScriptCommand_OpenMenu +ENDM + +; Picks the Challenge Cup prize card +pick_challenge_cup_prize_card: MACRO + run_command ScriptCommand_PickChallengeCupPrizeCard +ENDM + ; Closes Advanced TextBoxes then Ends Script Loop quit_script_fully: MACRO run_command ScriptCommand_QuitScriptFully ENDM -choose_deck_to_duel_against_multichoice: MACRO +; Replaces map blocks +; used for deck machines, challenge machine, Pokemon Dome doors, Hall of Honor doors etc +replace_map_blocks: MACRO + run_command ScriptCommand_ReplaceMapBlocks + db \1 ; id +ENDM + +choose_deck_to_duel_against: MACRO run_command ScriptCommand_ChooseDeckToDuelAgainstMultichoice ENDM @@ -314,7 +476,7 @@ open_deck_machine: MACRO db \1 ; Deck Machine Type? ENDM -choose_starter_deck_multichoice: MACRO +choose_starter_deck: MACRO run_command ScriptCommand_ChooseStarterDeckMultichoice ENDM @@ -329,12 +491,51 @@ enter_map: MACRO ENDM ; Moves any NPC using an NPCMovement -move_arbitrary_npc: MACRO +move_npc: MACRO run_command ScriptCommand_MoveArbitraryNPC db \1 ; NPC (ex NPC_JOSHUA) dw \2 ; NPCMovement (NPCMovement_e2ab) ENDM +; Picks the next legendary card +pick_legendary_card: MACRO + run_command ScriptCommand_PickLegendaryCard +ENDM + +; Flashes the screen to white +; if arg is non-zero, keep the screen white +; otherwise, fade the screen back in +flash_screen: MACRO + run_command ScriptCommand_FlashScreen + db \1 ; keep screen white? +ENDM + +; Saves the game +; if arg is non-zero, save the player in MASON_LABORATORY +; otherwise, save the player in their current location +save_game: MACRO + run_command ScriptCommand_SaveGame + db \1 ; send to MASON_LABORATORY? +ENDM + +; Loads the Battle Center +battle_center: MACRO + run_command ScriptCommand_BattleCenter +ENDM + +; Loads the Gift Center +; if arg is zero, display the options selection menu +; otherwise, execute the player's previously chosen selection +gift_center: MACRO + run_command ScriptCommand_GiftCenter + db \1 ; execute selection? +ENDM + +; Plays the credits +play_credits: MACRO + run_command ScriptCommand_PlayCredits +ENDM + ; Tries to give the player a specific PC Pack from Dr. Mason try_give_pc_pack: MACRO run_command ScriptCommand_TryGivePCPack @@ -346,6 +547,34 @@ script_nop: MACRO run_command ScriptCommand_nop ENDM +; Gives the player their previously chosen starter deck +give_stater_deck: MACRO + run_command ScriptCommand_GiveStarterDeck +ENDM + +; Walks the player across the overworld map to MASON_LABORATORY +walk_player_to_mason_lab: MACRO + run_command ScriptCommand_WalkPlayerToMasonLaboratory +ENDM + +; Plays a song and saves it to wd112 +override_song: MACRO + run_command ScriptCommand_OverrideSong + db \1 ; Song ID (ex MUSIC_BOOSTER_PACK) +ENDM + +; Sets the default song for the overworld +set_default_song: MACRO + run_command ScriptCommand_SetDefaultSong + db \1 ; Song ID (ex MUSIC_BOOSTER_PACK) +ENDM + +; Plays a song +play_song: MACRO + run_command ScriptCommand_PlaySong + db \1 ; Song ID (ex MUSIC_BOOSTER_PACK) +ENDM + ; Plays a sound effect play_sfx: MACRO run_command ScriptCommand_PlaySFX @@ -362,11 +591,24 @@ resume_song: MACRO run_command ScriptCommand_ResumeSong ENDM +; Plays the default overworld song +play_default_song: MACRO + run_command ScriptCommand_PlayDefaultSong +ENDM + ; Waits for the current song to finish wait_for_song_to_finish: MACRO run_command ScriptCommand_WaitForSongToFinish ENDM +; Records when the player defeats a master (the 8 Club Masters or the Ronald Grand Master duel) +; the order of wins is stored in wd3bb +; the purpose of this is still unknown +record_master_win: MACRO + run_command ScriptCommand_RecordMasterWin + db \1 ; which master duel +ENDM + ; Asks the player a question then jumps ask_question_jump_default_yes: MACRO run_command ScriptCommand_AskQuestionJumpDefaultYes @@ -386,51 +628,36 @@ show_sam_tutorial_multichoice: MACRO run_command ScriptCommand_ShowSamTutorialMultichoice ENDM -end_script_loop_2: MACRO - run_command ScriptCommand_EndScriptLoop2 -ENDM - -end_script_loop_3: MACRO - run_command ScriptCommand_EndScriptLoop3 -ENDM - -end_script_loop_4: MACRO - run_command ScriptCommand_EndScriptLoop4 -ENDM - -end_script_loop_5: MACRO - run_command ScriptCommand_EndScriptLoop5 -ENDM - -end_script_loop_6: MACRO - run_command ScriptCommand_EndScriptLoop6 +; Runs the Challenge Machine +challenge_machine: MACRO + run_command ScriptCommand_ChallengeMachine ENDM ; Sets a flag's value script_set_flag_value: MACRO run_command ScriptCommand_SetFlagValue - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) db \2 ; new value ENDM ; Jumps to a script position if a given flag is zero jump_if_flag_zero_1: MACRO run_command ScriptCommand_JumpIfFlagZero1 - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) dw \2 ; Script Label ENDM ; Jumps to a script position if a given flag is nonzero jump_if_flag_nonzero_1: MACRO run_command ScriptCommand_JumpIfFlagNonzero1 - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) dw \2 ; Script Label ENDM ; Jumps to a script position if a flag matches given value jump_if_flag_equal: MACRO run_command ScriptCommand_JumpIfFlagEqual - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) db \2 ; value dw \3 ; Script Label ENDM @@ -438,23 +665,23 @@ ENDM ; Jumps to a script position if a flag does not match a given value jump_if_flag_not_equal: MACRO run_command ScriptCommand_JumpIfFlagNotEqual - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) db \2 ; value dw \3 ; Script Label ENDM -; Jump to a script position if a flag is not less than a given value +; Jumps to a script position if a flag is not less than a given value jump_if_flag_not_less_than: MACRO run_command ScriptCommand_JumpIfFlagNotLessThan - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) db \2 ; value dw \3 ; Script Label ENDM -; Jump to a script position if a flag is less than a given value +; Jumps to a script position if a flag is less than a given value jump_if_flag_less_than: MACRO run_command ScriptCommand_JumpIfFlagLessThan - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) db \2 ; value dw \3 ; Script Label ENDM @@ -462,49 +689,31 @@ ENDM ; Sets a flag to its maximum possible value max_out_flag_value: MACRO run_command ScriptCommand_MaxOutFlagValue - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) ENDM ; Sets a flags value to zero zero_out_flag_value: MACRO run_command ScriptCommand_ZeroOutFlagValue - db \1 ; flag (ex EVENT_FLAG_11) -ENDM - -; Jumps to a script position if a flag is zero -jump_if_flag_zero_2: MACRO - run_command ScriptCommand_JumpIfFlagZero2 - db \1 ; flag (ex EVENT_FLAG_11) - dw \2 ; Script Label + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) ENDM ; Jumps to a script position if a flag is nonzero jump_if_flag_nonzero_2: MACRO run_command ScriptCommand_JumpIfFlagNonzero2 - db \1 ; flag (ex EVENT_FLAG_11) + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) dw \2 ; Script Label ENDM -; Increments given flags value (truncates the new value) -script_increment_flag_value: MACRO - run_command ScriptCommand_IncrementFlagValue - db \1 ; flag (ex EVENT_FLAG_11) -ENDM - -end_script_loop_7: MACRO - run_command ScriptCommand_EndScriptLoop7 -ENDM - -end_script_loop_8: MACRO - run_command ScriptCommand_EndScriptLoop8 -ENDM - -end_script_loop_9: MACRO - run_command ScriptCommand_EndScriptLoop9 +; Jumps to a script position if a flag is zero +jump_if_flag_zero_2: MACRO + run_command ScriptCommand_JumpIfFlagZero2 + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) + dw \2 ; Script Label ENDM -end_script_loop_10: MACRO - run_command ScriptCommand_EndScriptLoop10 +; Increments given flags value (truncates the new value) +increment_flag_value: MACRO + run_command ScriptCommand_IncrementFlagValue + db \1 ; flag (ex EVENT_IMAKUNI_WIN_COUNT) ENDM - - diff --git a/src/sram.asm b/src/sram.asm index 6abe5d7..09c4e67 100644 --- a/src/sram.asm +++ b/src/sram.asm @@ -70,6 +70,32 @@ s0a3f8:: ; a3f8 sCurrentlySelectedDeck:: ; b700 ds $1 +sb701:: ; b701 + ds $1 + + ds $1 + +sb703:: ; b703 + ds $1 + + ds $340 + +sba44:: ; ba44 + ds $1 + + ds $11 + +sba56:: ; ba56 + ds $1 + +sba57:: ; ba57 + ds $1 + + ds $10 + +sba68:: ; ba68 + ds $1 + SECTION "SRAM1", SRAM SECTION "SRAM2", SRAM diff --git a/src/text/text1.asm b/src/text/text1.asm index fa04f0f..931a98d 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -217,22 +217,22 @@ PokemonsAttackText: ; 365d8 (d:65d8) text "<RAMTEXT>!" done -ReceivedDamageDueToResistanceText: ; 365e1 (d:65e1) +ResistanceLessDamageText: ; 365e1 (d:65e1) text "<RAMTEXT> received" line "<RAMNUM> damage due to Resistance!" done -ReceivedDamageDueToWeaknessText: ; 36609 (d:6609) +WeaknessMoreDamageText: ; 36609 (d:6609) text "<RAMTEXT> received" line "<RAMNUM> damage due to Weakness!" done -ReceivedDamageDueToWeaknessAltText: ; 3662f (d:662f) +WeaknessMoreDamage2Text: ; 3662f (d:662f) text "<RAMTEXT> received" line "<RAMNUM> damage due to Weakness!" done -DidNotReceiveDamageResistanceText: ; 36655 (d:6655) +ResistanceNoDamageText: ; 36655 (d:6655) text "<RAMTEXT> did not" line "receive damage due to Resistance." done diff --git a/src/text/text2.asm b/src/text/text2.asm index fc603ee..d85eda7 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -844,7 +844,7 @@ Text0195: ; 39f03 (e:5f03) line "Please wait..." done -Text0196: ; 39f21 (e:5f21) +BoosterPackText: ; 39f21 (e:5f21) text "Booster Pack" done @@ -1507,7 +1507,7 @@ OpponentsDiscardPileText: ; 3b7cf (e:77cf) text "Opponent's Discard Pile" done -Text0219: ; 3b7e8 (e:77e8) +DeckText: ; 3b7e8 (e:77e8) text "Deck" done @@ -1563,7 +1563,7 @@ Text0220: ; 3b886 (e:7886) textfw0 "-(2)" done -Text0221: ; 3b8f2 (e:78f2) +PlayerNameKeyboardText: ; 3b8f2 (e:78f2) textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I" line "" textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R" @@ -1580,7 +1580,7 @@ Text0221: ; 3b8f2 (e:78f2) textfw0 " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " " done -NamingScreenKeyboardText: ; 3b97b (e:797b) +DeckNameKeyboardText: ; 3b97b (e:797b) textfw3 "A", " ", "B", " ", "C", " ", "D", " ", "E", " ", "F", " ", "G", " ", "H", " ", "I" line "" textfw3 "J", " ", "K", " ", "L", " ", "M", " ", "N", " ", "O", " ", "P", " ", "Q", " ", "R" @@ -1632,19 +1632,19 @@ ChosenAsDuelingDeckText: ; 3ba55 (e:7a55) line "chosen as the dueling deck!" done -Text022b: ; 3ba78 (e:7a78) +Deck1Text: ; 3ba78 (e:7a78) textfw0 "1", "·" done -Text022c: ; 3ba7b (e:7a7b) +Deck2Text: ; 3ba7b (e:7a7b) textfw0 "2", "·" done -Text022d: ; 3ba7e (e:7a7e) +Deck3Text: ; 3ba7e (e:7a7e) textfw0 "3", "·" done -Text022e: ; 3ba81 (e:7a81) +Deck4Text: ; 3ba81 (e:7a81) textfw0 "4", "·" done diff --git a/src/text/text3.asm b/src/text/text3.asm index 4d3fccf..7699e08 100644 --- a/src/text/text3.asm +++ b/src/text/text3.asm @@ -21,7 +21,7 @@ Text0271: ; 3c082 (f:4082) text "Dismantled the Deck." done -Text0272: ; 3c098 (f:4098) +OKIfFileDeletedText: ; 3c098 (f:4098) text "OK if this file is deleted?" done @@ -644,79 +644,79 @@ ChooseWordAndPressAButtonText: ; 3d48f (f:548f) line "A button." done -Text02fa: ; 3d4b6 (f:54b6) +AboutTheDeckText: ; 3d4b6 (f:54b6) text "About the Deck" done -Text02fb: ; 3d4c6 (f:54c6) +AboutTheDiscardPileText: ; 3d4c6 (f:54c6) text "About the Discard Pile" done -Text02fc: ; 3d4de (f:54de) +AboutTheHandText: ; 3d4de (f:54de) text "About the Hand" done -Text02fd: ; 3d4ee (f:54ee) +AboutTheArenaText: ; 3d4ee (f:54ee) text "About the Arena" done -Text02fe: ; 3d4ff (f:54ff) +AboutTheBenchText: ; 3d4ff (f:54ff) text "About the Bench" done -Text02ff: ; 3d510 (f:5510) +AboutTheActivePokemonText: ; 3d510 (f:5510) text "About the Active Pokémon" done -Text0300: ; 3d52a (f:552a) +AboutBenchPokemonText: ; 3d52a (f:552a) text "About Bench Pokémon" done -Text0301: ; 3d53f (f:553f) +AboutPrizesText: ; 3d53f (f:553f) text "About Prizes" done -Text0302: ; 3d54d (f:554d) +AboutDamageCountersText: ; 3d54d (f:554d) text "About Damage Counters" done -Text0303: ; 3d564 (f:5564) +AboutEnergyCardsText: ; 3d564 (f:5564) text "About Energy Cards" done -Text0304: ; 3d578 (f:5578) +AboutTrainerCardsText: ; 3d578 (f:5578) text "About Trainer Cards" done -Text0305: ; 3d58d (f:558d) +AboutBasicPokemonText: ; 3d58d (f:558d) text "About Basic Pokémon" done -Text0306: ; 3d5a2 (f:55a2) +AboutEvolutionCardsText: ; 3d5a2 (f:55a2) text "About Evolution Cards" done -Text0307: ; 3d5b9 (f:55b9) +AboutAttackingText: ; 3d5b9 (f:55b9) text "About Attacking" done -Text0308: ; 3d5ca (f:55ca) +AboutPokemonPowerText: ; 3d5ca (f:55ca) text "About Pokémon Power" done -Text0309: ; 3d5df (f:55df) +AboutWeaknessText: ; 3d5df (f:55df) text "About Weakness" done -Text030a: ; 3d5ef (f:55ef) +AboutResistanceText: ; 3d5ef (f:55ef) text "About Resistance" done -Text030b: ; 3d601 (f:5601) +AboutRetreatingText: ; 3d601 (f:5601) text "About Retreating" done -Text030c: ; 3d613 (f:5613) +DeckDescriptionText: ; 3d613 (f:5613) text "The Deck is the pile of cards" line "you will be drawing from." line "At the beginning of your turn, you" @@ -725,7 +725,7 @@ Text030c: ; 3d613 (f:5613) line "from the Deck, you lose the game." done -Text030d: ; 3d6d0 (f:56d0) +DiscardPileDescriptionText: ; 3d6d0 (f:56d0) text "The pile in which you place used" line "cards is called the Discard Pile." line "You can look at both yours and your" @@ -733,7 +733,7 @@ Text030d: ; 3d6d0 (f:56d0) line "with the Check command." done -Text030e: ; 3d769 (f:5769) +HandDescriptionText: ; 3d769 (f:5769) text "The cards held by each player" line "are called a Hand." line "There is no restriction to the" @@ -742,7 +742,7 @@ Text030e: ; 3d769 (f:5769) line "cards in your Hand." done -Text030f: ; 3d807 (f:5807) +ArenaDescriptionText: ; 3d807 (f:5807) text "The place where the Pokémon" line "that is actively fighting" line "is placed is called the Arena." @@ -750,7 +750,7 @@ Text030f: ; 3d807 (f:5807) line "Active Pokémon in the Arena." done -Text0310: ; 3d899 (f:5899) +BenchDescriptionText: ; 3d899 (f:5899) text "The Bench is where your Pokémon" line "that are in play but aren't actively" line "fighting sit." @@ -761,14 +761,14 @@ Text0310: ; 3d899 (f:5899) line "the Bench." done -Text0311: ; 3d96e (f:596e) +ActivePokemonDescriptionText: ; 3d96e (f:596e) text "The Active Pokémon is the " line "Pokémon that is in the Arena." line "Only Active Pokémon can " line "attack." done -Text0312: ; 3d9c9 (f:59c9) +BenchPokemonDescriptionText: ; 3d9c9 (f:59c9) text "The Pokémon that are in play" line "but aren't actively fighting" line "are called Bench Pokémon." @@ -780,7 +780,7 @@ Text0312: ; 3d9c9 (f:59c9) line "Pokémon, you lose the game." done -Text0313: ; 3dad1 (f:5ad1) +PrizesDescriptionText: ; 3dad1 (f:5ad1) text "Prizes are the cards placed to" line "count the number of the opponent's" line "Pokémon you Knocked Out." @@ -791,7 +791,7 @@ Text0313: ; 3dad1 (f:5ad1) line "you win the game." done -Text0314: ; 3dbc5 (f:5bc5) +DamageCountersDescriptionText: ; 3dbc5 (f:5bc5) text "A Damage Counter represents the" line "amount of damage a certain Pokémon" line "has taken." @@ -803,7 +803,7 @@ Text0314: ; 3dbc5 (f:5bc5) line "HP is 0." done -Text0315: ; 3dcb2 (f:5cb2) +EnergyCardsDescriptionText: ; 3dcb2 (f:5cb2) text "Energy Cards are cards that power" line "your Pokémon, making them able" line "to Attack." @@ -816,7 +816,7 @@ Text0315: ; 3dcb2 (f:5cb2) line "from your Hand per turn." done -Text0316: ; 3ddbe (f:5dbe) +TrainerCardsDescriptionText: ; 3ddbe (f:5dbe) text "Trainer Cards are support cards." line "There are many Trainer Cards" line "with different effects." @@ -828,7 +828,7 @@ Text0316: ; 3ddbe (f:5dbe) line "as you like." done -Text0317: ; 3deb0 (f:5eb0) +BasicPokemonDescriptionText: ; 3deb0 (f:5eb0) text "Basic Pokémon are cards that " line "can be played directly from your " line "hand into the play area. Basic " @@ -838,7 +838,7 @@ Text0317: ; 3deb0 (f:5eb0) line "examples of Basic Pokémon." done -Text0318: ; 3df82 (f:5f82) +EvolutionCardsDescriptionText: ; 3df82 (f:5f82) text "Evolution Cards are cards you" line "play on top of a Basic Pokémon card" line "(or sometimes on top of another" @@ -853,7 +853,7 @@ Text0318: ; 3df82 (f:5f82) line "place the Stage 2 Evolution Card." done -Text0319: ; 3e10a (f:610a) +AttackingDescriptionText: ; 3e10a (f:610a) text "By choosing Attack, your Pokémon" line "will fight your opponent's Pokémon." line "Your Pokémon require Energy" @@ -864,7 +864,7 @@ Text0319: ; 3e10a (f:610a) line "Pokémon that can Attack." done -Text031a: ; 3e1f7 (f:61f7) +PokemonPowerDescriptionText: ; 3e1f7 (f:61f7) text "Unlike Attacks, Pokémon Power" line "can be used by Active or Benched" line "Pokémon. Some Pokémon Power are" @@ -874,14 +874,14 @@ Text031a: ; 3e1f7 (f:61f7) line "command, PKMN Power." done -Text031b: ; 3e2c5 (f:62c5) +WeaknessDescriptionText: ; 3e2c5 (f:62c5) text "Some Pokémon have a Weakness." line "If a Pokémon has a Weakness, it" line "takes double damage when attacked by" line "Pokémon of a certain type." done -Text031c: ; 3e344 (f:6344) +ResistanceDescriptionText: ; 3e344 (f:6344) text "Some Pokémon have Resistance." line "If a Pokémon has Resistance, it" line "takes 30 less damage whenever" @@ -889,7 +889,7 @@ Text031c: ; 3e344 (f:6344) line "a certain type." done -Text031d: ; 3e3c8 (f:63c8) +RetreatingDescriptionText: ; 3e3c8 (f:63c8) text "By choosing Retreat, you can" line "switch the Active Pokémon with" line "a Pokémon on your Bench." @@ -942,103 +942,103 @@ Text0322: ; 3e64c (f:664c) line "" done -Text0323: ; 3e660 (f:6660) +OverworldMapMasonLaboratoryText: ; 3e660 (f:6660) text " Mason Laboratory " done -Text0324: ; 3e676 (f:6676) +OverworldMapIshiharasHouseText: ; 3e676 (f:6676) text " ISHIHARA's House " done -Text0325: ; 3e68c (f:668c) +OverworldMapFightingClubText: ; 3e68c (f:668c) text " Fighting Club " done -Text0326: ; 3e6a2 (f:66a2) +OverworldMapRockClubText: ; 3e6a2 (f:66a2) text " Rock Club " done -Text0327: ; 3e6b8 (f:66b8) +OverworldMapWaterClubText: ; 3e6b8 (f:66b8) text " Water Club " done -Text0328: ; 3e6ce (f:66ce) +OverworldMapLightningClubText: ; 3e6ce (f:66ce) text " Lightning Club " done -Text0329: ; 3e6e4 (f:66e4) +OverworldMapGrassClubText: ; 3e6e4 (f:66e4) text " Grass Club " done -Text032a: ; 3e6fa (f:66fa) +OverworldMapPsychicClubText: ; 3e6fa (f:66fa) text " Psychic Club " done -Text032b: ; 3e710 (f:6710) +OverworldMapScienceClubText: ; 3e710 (f:6710) text " Science Club " done -Text032c: ; 3e726 (f:6726) +OverworldMapFireClubText: ; 3e726 (f:6726) text " Fire Club " done -Text032d: ; 3e73c (f:673c) +OverworldMapChallengeHallText: ; 3e73c (f:673c) text " Challenge Hall " done -Text032e: ; 3e752 (f:6752) +OverworldMapPokemonDomeText: ; 3e752 (f:6752) text " Pokémon Dome " done -Text032f: ; 3e768 (f:6768) +OverworldMapMysteryHouseText: ; 3e768 (f:6768) text " ??'s House " done -Text0330: ; 3e77e (f:677e) +MasonLaboratoryMapNameText: ; 3e77e (f:677e) text "Mason Laboratory" done -Text0331: ; 3e790 (f:6790) +MrIshiharasHouseMapNameText: ; 3e790 (f:6790) text "Mr Ishihara's House" done -Text0332: ; 3e7a5 (f:67a5) +FightingClubMapNameText: ; 3e7a5 (f:67a5) text "Fighting" done -Text0333: ; 3e7af (f:67af) +RockClubMapNameText: ; 3e7af (f:67af) text "Rock" done -Text0334: ; 3e7b5 (f:67b5) +WaterClubMapNameText: ; 3e7b5 (f:67b5) text "Water" done -Text0335: ; 3e7bc (f:67bc) +LightningClubMapNameText: ; 3e7bc (f:67bc) text "Lightning" done -Text0336: ; 3e7c7 (f:67c7) +GrassClubMapNameText: ; 3e7c7 (f:67c7) text "Grass" done -Text0337: ; 3e7ce (f:67ce) +PsychicClubMapNameText: ; 3e7ce (f:67ce) text "Psychic" done -Text0338: ; 3e7d7 (f:67d7) +ScienceClubMapNameText: ; 3e7d7 (f:67d7) text "Science" done -Text0339: ; 3e7e0 (f:67e0) +FireClubMapNameText: ; 3e7e0 (f:67e0) text "Fire" done -Text033a: ; 3e7e6 (f:67e6) +ChallengeHallMapNameText: ; 3e7e6 (f:67e6) text "Challenge Hall" done -Text033b: ; 3e7f6 (f:67f6) +PokemonDomeMapNameText: ; 3e7f6 (f:67f6) text "Pokémon Dome" done @@ -1046,7 +1046,7 @@ Text033c: ; 3e804 (f:6804) text "??'s House" done -Text033d: ; 3e810 (f:6810) +PauseMenuOptionsText: ; 3e810 (f:6810) text "Status" line "Diary" line "Deck" @@ -1055,7 +1055,7 @@ Text033d: ; 3e810 (f:6810) line "Exit" done -Text033e: ; 3e834 (f:6834) +DebugPauseMenuOptionsText: ; 3e834 (f:6834) text "Status" line "Diary" line "Deck" @@ -1860,96 +1860,96 @@ AaronNPCName: ; 3f823 (f:7823) text "Aaron" done -Text03e8: ; 3f82a (f:782a) +MewtwoTradeCardName: ; 3f82a (f:782a) text "<Lv>60 MEWTWO " done -Text03e9: ; 3f838 (f:7838) +MewTradeCardName: ; 3f838 (f:7838) text "<Lv>8 MEW " done -Text03ea: ; 3f842 (f:7842) +ArcanineTradeCardName: ; 3f842 (f:7842) text "<Lv>34 ARCANINE" done -Text03eb: ; 3f851 (f:7851) +PikachuTradeCardName: ; 3f851 (f:7851) text "<Lv>16 PIKACHU" done -Text03ec: ; 3f85f (f:785f) +SurfingPikachuTradeCardName: ; 3f85f (f:785f) text "<Lv>13 SURFING PIKACHU" done -Text03ed: ; 3f875 (f:7875) +ElectabuzzTradeCardName: ; 3f875 (f:7875) text "<Lv>20 ELECTABUZZ" done -Text03ee: ; 3f886 (f:7886) +SlowpokeTradeCardName: ; 3f886 (f:7886) text "<Lv>9 SLOWPOKE" done -Text03ef: ; 3f894 (f:7894) +JigglypuffTradeCardName: ; 3f894 (f:7894) text "<Lv>12 JIGGLYPUFF" done -Text03f0: ; 3f8a5 (f:78a5) +ZapdosLegendaryCardName: ; 3f8a5 (f:78a5) text "<Lv>68 ZAPDOS" done -Text03f1: ; 3f8b2 (f:78b2) +MoltresLegendaryCardName: ; 3f8b2 (f:78b2) text "<Lv>37 MOLTRES" done -Text03f2: ; 3f8c0 (f:78c0) +ArticunoLegendaryCardName: ; 3f8c0 (f:78c0) text "<Lv>37 ARTICUNO" done -Text03f3: ; 3f8cf (f:78cf) +DragoniteLegendaryCardName: ; 3f8cf (f:78cf) text "<Lv>41 DRAGONITE" done -Text03f4: ; 3f8df (f:78df) +SuperEnergyRetrievalTradeCardName: ; 3f8df (f:78df) text "Super Energy Retrieval" done -Text03f5: ; 3f8f7 (f:78f7) +FlyingPikachuTradeCardName: ; 3f8f7 (f:78f7) text "<Lv>12 FLYING PIKACHU" done -Text03f6: ; 3f90c (f:790c) +LightningAndFireDeckChoiceText: ; 3f90c (f:790c) text "Lightning & Fire Deck" done -Text03f7: ; 3f923 (f:7923) +WaterAndFightingDeckChoiceText: ; 3f923 (f:7923) text "Water & Fighting Deck" done -Text03f8: ; 3f93a (f:793a) +GrassAndPsychicDeckChoiceText: ; 3f93a (f:793a) text "Grass & Psychic Deck" done -Text03f9: ; 3f950 (f:7950) +SelectDeckToDuelText: ; 3f950 (f:7950) text "Please select the Deck" line "you wish to Duel against." done -Text03fa: ; 3f982 (f:7982) +CharmanderAndFriendsDeckChoiceText: ; 3f982 (f:7982) text "CHARMANDER & Friends Deck" done -Text03fb: ; 3f99d (f:799d) +SquirtleAndFriendsDeckChoiceText: ; 3f99d (f:799d) text "SQUIRTLE & Friends Deck" done -Text03fc: ; 3f9b6 (f:79b6) +BulbasaurAndFriendsDeckChoiceText: ; 3f9b6 (f:79b6) text "BULBASAUR & Friends Deck" done -Text03fd: ; 3f9d0 (f:79d0) +SelectDeckToTakeText: ; 3f9d0 (f:79d0) text "Please select the Deck you want." done -Text03fe: ; 3f9f2 (f:79f2) +HowCanIHelpText: ; 3f9f2 (f:79f2) text "Hi, <RAMNAME>." line "How can I help you?" done diff --git a/src/text/text4.asm b/src/text/text4.asm index 74bec46..b597fb6 100644 --- a/src/text/text4.asm +++ b/src/text/text4.asm @@ -320,11 +320,11 @@ Text0419: ; 41965 (10:5965) line "attached Booster Pack." done -Text041a: ; 4199b (10:599b) +PokemonTradingCards101Text: ; 4199b (10:599b) text "”Pokémon Trading Cards 101”" done -Text041b: ; 419b8 (10:59b8) +PlaceholderMessageText: ; 419b8 (10:59b8) text "This message is not in yet!" done @@ -338,7 +338,7 @@ Text041c: ; 419d5 (10:59d5) line "just to collect them." done -Text041d: ; 41a74 (10:5a74) +Gal1WantToTrade1Text: ; 41a74 (10:5a74) text "We don't use Fire Pokémon cards" line "here at the Water Club." line "I have this rare Arcanine, but" @@ -347,17 +347,17 @@ Text041d: ; 41a74 (10:5a74) line "mind trading it for my Arcanine?" done -Text041e: ; 41b1d (10:5b1d) +Gal1WantToTrade2Text: ; 41b1d (10:5b1d) text "Hi! We meet again!" line "Have you decided to trade your" line "Lapras for my rare Arcanine?" done -Text041f: ; 41b6d (10:5b6d) +Gal1WouldYouLikeToTradeText: ; 41b6d (10:5b6d) text "Would you like to trade?" done -Text0420: ; 41b87 (10:5b87) +Gal1DeclinedTradeText: ; 41b87 (10:5b87) text "Aw, you're not going to" line "trade with me?" line "Well, that's too bad..." @@ -365,13 +365,13 @@ Text0420: ; 41b87 (10:5b87) line "come look for me." done -Text0421: ; 41bf6 (10:5bf6) +Gal1DontOwnCardText: ; 41bf6 (10:5bf6) text "Hey! What are you trying to pull?" line "You don't have a Lapras!?!" line "Come see me when you get a Lapras." done -Text0422: ; 41c57 (10:5c57) +Gal1CardInDeckText: ; 41c57 (10:5c57) text "OK! Let's trade your Lapras" line "for my Arcanine..." line "Oh! I see your Lapras" @@ -382,23 +382,23 @@ Text0422: ; 41c57 (10:5c57) line "" done -Text0423: ; 41cf7 (10:5cf7) +Gal1LetsTradeText: ; 41cf7 (10:5cf7) text "OK then, let's trade your" line "Lapras for my Arcanine." done -Text0424: ; 41d2a (10:5d2a) +Gal1TradeCompleteText: ; 41d2a (10:5d2a) text "<RAMNAME> traded a Lapras" line "for an Arcanine!" done -Text0425: ; 41d4e (10:5d4e) +Gal1ThanksText: ; 41d4e (10:5d4e) text "Thanks, <RAMNAME>!" line "I'll take good care" line "of this Lapras." done -Text0426: ; 41d7e (10:5d7e) +Gal1AfterTradeText: ; 41d7e (10:5d7e) text "Hey! You're the one who" line "gave me your Lapras!" line "I'm taking good care of" diff --git a/src/text/text5.asm b/src/text/text5.asm index ba26ccb..809cb63 100644 --- a/src/text/text5.asm +++ b/src/text/text5.asm @@ -95,7 +95,7 @@ Text049e: ; 4437a (11:437a) line "Well, I hope I see you around!" done -Text049f: ; 443d6 (11:43d6) +WhatIsADeckText: ; 443d6 (11:43d6) text "What is a deck?" done diff --git a/src/text/text6.asm b/src/text/text6.asm index 901e9fe..eb045ea 100644 --- a/src/text/text6.asm +++ b/src/text/text6.asm @@ -932,12 +932,12 @@ Text05bc: ; 4ab23 (12:6b23) line " A new journey has just begun...”" done -Text05bd: ; 4ad20 (12:6d20) +ItsTheChallengeMachineText: ; 4ad20 (12:6d20) text "It's the Challenge Machine," line "created by Dr. Mason!" done -Text05be: ; 4ad53 (12:6d53) +Tech1MasterMedalExplanationText: ; 4ad53 (12:6d53) text "The 8 Club Masters each own a" line "Master Medal." line "The secret of each Club's deck is" @@ -949,7 +949,7 @@ Text05be: ; 4ad53 (12:6d53) line "different Decks!" done -Text05bf: ; 4ae4d (12:6e4d) +Tech1AutoDeckMachineExplanationText: ; 4ae4d (12:6e4d) text "You finally inherited the" line "Legendary Pokémon Cards!" line "Did you see the Legendary Auto" @@ -960,7 +960,7 @@ Text05bf: ; 4ae4d (12:6e4d) line "to a very powerful deck!" done -Text05c0: ; 4af26 (12:6f26) +Tech1FewEnergyCardsText: ; 4af26 (12:6f26) text "Excuse me, but you don't seem " line "to have many Energy cards." line "Building a deck must be difficult " @@ -968,17 +968,17 @@ Text05c0: ; 4af26 (12:6f26) line "Here, take these!" done -Text05c1: ; 4afb0 (12:6fb0) +Tech1ReceivedEnergyCardsText: ; 4afb0 (12:6fb0) text "<RAMNAME> received some " line "Energy cards!" done -Text05c2: ; 4afd0 (12:6fd0) +Tech1GoodbyeText: ; 4afd0 (12:6fd0) text "Goodbye!" line "Take care!" done -Text05c3: ; 4afe5 (12:6fe5) +Tech2LegendaryCardsExplanationText: ; 4afe5 (12:6fe5) text "Are you also hoping to inherit" line "the Legendary Pokémon Cards?" line "If you want the Legendary Cards," @@ -991,14 +991,14 @@ Text05c3: ; 4afe5 (12:6fe5) line "more about the Legendary Cards." done -Text05c4: ; 4b129 (12:7129) +Tech2LegendaryCardsCongratsText: ; 4b129 (12:7129) text "You finally inherited the" line "Legendary Pokémon Cards!" line "Amazing!" line "Congratulations, <RAMNAME>!!!" done -Text05c5: ; 4b17c (12:717c) +Tech3BoosterPackExplanationText: ; 4b17c (12:717c) text "When you defeat a Club Member," line "you'll receive a Booster Pack." line "Each Booster Pack has 10 cards." @@ -1009,7 +1009,7 @@ Text05c5: ; 4b17c (12:717c) line "so choose your opponents well." done -Text05c6: ; 4b274 (12:7274) +Tech3LegendaryCardsCongratsText: ; 4b274 (12:7274) text "Congratulations on inheriting " line "the Legendary Pokémon Cards," line "" @@ -1019,7 +1019,7 @@ Text05c6: ; 4b274 (12:7274) line "you'll have a good time!" done -Text05c7: ; 4b323 (12:7323) +Tech4ClubsExplanationText: ; 4b323 (12:7323) text "I'm sure you already know, but there" line "are 8 Clubs: the Fighting, Water," line "Lightning, Grass, Psychic, Fire," @@ -1028,14 +1028,14 @@ Text05c7: ; 4b323 (12:7323) line "are specific to that Club." done -Text05c8: ; 4b3e2 (12:73e2) +Tech4DefeatedTheGrandMastersText: ; 4b3e2 (12:73e2) text "Amazing! You beat the 8 Club " line "Masters!" line "And you even defeated the" line "4 Grand Masters! Amazing!" done -Text05c9: ; 4b43e (12:743e) +Tech5DiaryAndEmailExplanationText: ; 4b43e (12:743e) text "To save your game, press START" line "and choose Diary from the Menu." line "You can do all sorts of stuff with" @@ -1044,7 +1044,7 @@ Text05c9: ; 4b43e (12:743e) line "Dr. Mason on that PC, too!" done -Text05ca: ; 4b4ea (12:74ea) +Tech5ChallengeMachineExplanationText: ; 4b4ea (12:74ea) text "This is the Challenge Machine" line "created by Dr. Mason!" line "The Challenge Machine is a " diff --git a/src/text/text8.asm b/src/text/text8.asm index c76de49..6bd0fe6 100644 --- a/src/text/text8.asm +++ b/src/text/text8.asm @@ -205,7 +205,7 @@ Text06a1: ; 509f2 (14:49f2) line "Bye!" done -Text06a2: ; 50a9e (14:4a9e) +FoundLv9SlowpokeText: ; 50a9e (14:4a9e) text "<RAMNAME>" line "checked the wall!" line "" diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm index ff175e4..ff757fe 100644 --- a/src/text/text_offsets.asm +++ b/src/text/text_offsets.asm @@ -55,10 +55,10 @@ TextOffsets:: ; 34000 (d:4000) textpointer UsedText ; 0x0033 textpointer Text0034 ; 0x0034 textpointer PokemonsAttackText ; 0x0035 - textpointer ReceivedDamageDueToResistanceText ; 0x0036 - textpointer ReceivedDamageDueToWeaknessText ; 0x0037 - textpointer ReceivedDamageDueToWeaknessAltText ; 0x0038 - textpointer DidNotReceiveDamageResistanceText ; 0x0039 + textpointer ResistanceLessDamageText ; 0x0036 + textpointer WeaknessMoreDamageText ; 0x0037 + textpointer WeaknessMoreDamage2Text ; 0x0038 + textpointer ResistanceNoDamageText ; 0x0039 textpointer AttackDamageText ; 0x003a textpointer NoDamageText ; 0x003b textpointer NoSelectableAttackText ; 0x003c @@ -407,7 +407,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer ReceivedPromotionalSurfingPikachuText ; 0x0193 textpointer Text0194 ; 0x0194 textpointer Text0195 ; 0x0195 - textpointer Text0196 ; 0x0196 + textpointer BoosterPackText ; 0x0196 textpointer Text0197 ; 0x0197 textpointer Text0198 ; 0x0198 textpointer Text0199 ; 0x0199 @@ -538,7 +538,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer InchesText ; 0x0216 textpointer YourDiscardPileText ; 0x0217 textpointer OpponentsDiscardPileText ; 0x0218 - textpointer Text0219 ; 0x0219 + textpointer DeckText ; 0x0219 textpointer Text021a ; 0x021a textpointer Text021b ; 0x021b textpointer Text021c ; 0x021c @@ -546,8 +546,8 @@ TextOffsets:: ; 34000 (d:4000) textpointer WhatIsYourNameText ; 0x021e textpointer Text021f ; 0x021f textpointer Text0220 ; 0x0220 - textpointer Text0221 ; 0x0221 - textpointer NamingScreenKeyboardText ; 0x0222 + textpointer PlayerNameKeyboardText ; 0x0221 + textpointer DeckNameKeyboardText ; 0x0222 textpointer NewDeckText ; 0x0223 textpointer PleaseSelectDeckText ; 0x0224 textpointer Text0225 ; 0x0225 @@ -556,10 +556,10 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text0228 ; 0x0228 textpointer Text0229 ; 0x0229 textpointer ChosenAsDuelingDeckText ; 0x022a - textpointer Text022b ; 0x022b - textpointer Text022c ; 0x022c - textpointer Text022d ; 0x022d - textpointer Text022e ; 0x022e + textpointer Deck1Text ; 0x022b + textpointer Deck2Text ; 0x022c + textpointer Deck3Text ; 0x022d + textpointer Deck4Text ; 0x022e textpointer ThereIsNoDeckHereText ; 0x022f textpointer Text0230 ; 0x0230 textpointer Text0231 ; 0x0231 @@ -627,7 +627,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text026f ; 0x026f textpointer Text0270 ; 0x0270 textpointer Text0271 ; 0x0271 - textpointer Text0272 ; 0x0272 + textpointer OKIfFileDeletedText ; 0x0272 textpointer Text0273 ; 0x0273 textpointer Text0274 ; 0x0274 textpointer Text0275 ; 0x0275 @@ -763,75 +763,75 @@ TextOffsets:: ; 34000 (d:4000) textpointer GlossaryMenuPage1Text ; 0x02f7 textpointer GlossaryMenuPage2Text ; 0x02f8 textpointer ChooseWordAndPressAButtonText ; 0x02f9 - textpointer Text02fa ; 0x02fa - textpointer Text02fb ; 0x02fb - textpointer Text02fc ; 0x02fc - textpointer Text02fd ; 0x02fd - textpointer Text02fe ; 0x02fe - textpointer Text02ff ; 0x02ff - textpointer Text0300 ; 0x0300 - textpointer Text0301 ; 0x0301 - textpointer Text0302 ; 0x0302 - textpointer Text0303 ; 0x0303 - textpointer Text0304 ; 0x0304 - textpointer Text0305 ; 0x0305 - textpointer Text0306 ; 0x0306 - textpointer Text0307 ; 0x0307 - textpointer Text0308 ; 0x0308 - textpointer Text0309 ; 0x0309 - textpointer Text030a ; 0x030a - textpointer Text030b ; 0x030b - textpointer Text030c ; 0x030c - textpointer Text030d ; 0x030d - textpointer Text030e ; 0x030e - textpointer Text030f ; 0x030f - textpointer Text0310 ; 0x0310 - textpointer Text0311 ; 0x0311 - textpointer Text0312 ; 0x0312 - textpointer Text0313 ; 0x0313 - textpointer Text0314 ; 0x0314 - textpointer Text0315 ; 0x0315 - textpointer Text0316 ; 0x0316 - textpointer Text0317 ; 0x0317 - textpointer Text0318 ; 0x0318 - textpointer Text0319 ; 0x0319 - textpointer Text031a ; 0x031a - textpointer Text031b ; 0x031b - textpointer Text031c ; 0x031c - textpointer Text031d ; 0x031d + textpointer AboutTheDeckText ; 0x02fa + textpointer AboutTheDiscardPileText ; 0x02fb + textpointer AboutTheHandText ; 0x02fc + textpointer AboutTheArenaText ; 0x02fd + textpointer AboutTheBenchText ; 0x02fe + textpointer AboutTheActivePokemonText ; 0x02ff + textpointer AboutBenchPokemonText ; 0x0300 + textpointer AboutPrizesText ; 0x0301 + textpointer AboutDamageCountersText ; 0x0302 + textpointer AboutEnergyCardsText ; 0x0303 + textpointer AboutTrainerCardsText ; 0x0304 + textpointer AboutBasicPokemonText ; 0x0305 + textpointer AboutEvolutionCardsText ; 0x0306 + textpointer AboutAttackingText ; 0x0307 + textpointer AboutPokemonPowerText ; 0x0308 + textpointer AboutWeaknessText ; 0x0309 + textpointer AboutResistanceText ; 0x030a + textpointer AboutRetreatingText ; 0x030b + textpointer DeckDescriptionText ; 0x030c + textpointer DiscardPileDescriptionText ; 0x030d + textpointer HandDescriptionText ; 0x030e + textpointer ArenaDescriptionText ; 0x030f + textpointer BenchDescriptionText ; 0x0310 + textpointer ActivePokemonDescriptionText ; 0x0311 + textpointer BenchPokemonDescriptionText ; 0x0312 + textpointer PrizesDescriptionText ; 0x0313 + textpointer DamageCountersDescriptionText ; 0x0314 + textpointer EnergyCardsDescriptionText ; 0x0315 + textpointer TrainerCardsDescriptionText ; 0x0316 + textpointer BasicPokemonDescriptionText ; 0x0317 + textpointer EvolutionCardsDescriptionText ; 0x0318 + textpointer AttackingDescriptionText ; 0x0319 + textpointer PokemonPowerDescriptionText ; 0x031a + textpointer WeaknessDescriptionText ; 0x031b + textpointer ResistanceDescriptionText ; 0x031c + textpointer RetreatingDescriptionText ; 0x031d textpointer Text031e ; 0x031e textpointer Text031f ; 0x031f textpointer Text0320 ; 0x0320 textpointer Text0321 ; 0x0321 textpointer Text0322 ; 0x0322 - textpointer Text0323 ; 0x0323 - textpointer Text0324 ; 0x0324 - textpointer Text0325 ; 0x0325 - textpointer Text0326 ; 0x0326 - textpointer Text0327 ; 0x0327 - textpointer Text0328 ; 0x0328 - textpointer Text0329 ; 0x0329 - textpointer Text032a ; 0x032a - textpointer Text032b ; 0x032b - textpointer Text032c ; 0x032c - textpointer Text032d ; 0x032d - textpointer Text032e ; 0x032e - textpointer Text032f ; 0x032f - textpointer Text0330 ; 0x0330 - textpointer Text0331 ; 0x0331 - textpointer Text0332 ; 0x0332 - textpointer Text0333 ; 0x0333 - textpointer Text0334 ; 0x0334 - textpointer Text0335 ; 0x0335 - textpointer Text0336 ; 0x0336 - textpointer Text0337 ; 0x0337 - textpointer Text0338 ; 0x0338 - textpointer Text0339 ; 0x0339 - textpointer Text033a ; 0x033a - textpointer Text033b ; 0x033b + textpointer OverworldMapMasonLaboratoryText ; 0x0323 + textpointer OverworldMapIshiharasHouseText ; 0x0324 + textpointer OverworldMapFightingClubText ; 0x0325 + textpointer OverworldMapRockClubText ; 0x0326 + textpointer OverworldMapWaterClubText ; 0x0327 + textpointer OverworldMapLightningClubText ; 0x0328 + textpointer OverworldMapGrassClubText ; 0x0329 + textpointer OverworldMapPsychicClubText ; 0x032a + textpointer OverworldMapScienceClubText ; 0x032b + textpointer OverworldMapFireClubText ; 0x032c + textpointer OverworldMapChallengeHallText ; 0x032d + textpointer OverworldMapPokemonDomeText ; 0x032e + textpointer OverworldMapMysteryHouseText ; 0x032f + textpointer MasonLaboratoryMapNameText ; 0x0330 + textpointer MrIshiharasHouseMapNameText ; 0x0331 + textpointer FightingClubMapNameText ; 0x0332 + textpointer RockClubMapNameText ; 0x0333 + textpointer WaterClubMapNameText ; 0x0334 + textpointer LightningClubMapNameText ; 0x0335 + textpointer GrassClubMapNameText ; 0x0336 + textpointer PsychicClubMapNameText ; 0x0337 + textpointer ScienceClubMapNameText ; 0x0338 + textpointer FireClubMapNameText ; 0x0339 + textpointer ChallengeHallMapNameText ; 0x033a + textpointer PokemonDomeMapNameText ; 0x033b textpointer Text033c ; 0x033c - textpointer Text033d ; 0x033d - textpointer Text033e ; 0x033e + textpointer PauseMenuOptionsText ; 0x033d + textpointer DebugPauseMenuOptionsText ; 0x033e textpointer PlayerStatusNameText ; 0x033f textpointer PlayerStatusAlbumText ; 0x0340 textpointer PlayerStatusPlayTimeText ; 0x0341 @@ -1001,29 +1001,29 @@ TextOffsets:: ; 34000 (d:4000) textpointer GrannyNPCName ; 0x03e5 textpointer GuideNPCName ; 0x03e6 textpointer AaronNPCName ; 0x03e7 - textpointer Text03e8 ; 0x03e8 - textpointer Text03e9 ; 0x03e9 - textpointer Text03ea ; 0x03ea - textpointer Text03eb ; 0x03eb - textpointer Text03ec ; 0x03ec - textpointer Text03ed ; 0x03ed - textpointer Text03ee ; 0x03ee - textpointer Text03ef ; 0x03ef - textpointer Text03f0 ; 0x03f0 - textpointer Text03f1 ; 0x03f1 - textpointer Text03f2 ; 0x03f2 - textpointer Text03f3 ; 0x03f3 - textpointer Text03f4 ; 0x03f4 - textpointer Text03f5 ; 0x03f5 - textpointer Text03f6 ; 0x03f6 - textpointer Text03f7 ; 0x03f7 - textpointer Text03f8 ; 0x03f8 - textpointer Text03f9 ; 0x03f9 - textpointer Text03fa ; 0x03fa - textpointer Text03fb ; 0x03fb - textpointer Text03fc ; 0x03fc - textpointer Text03fd ; 0x03fd - textpointer Text03fe ; 0x03fe + textpointer MewtwoTradeCardName ; 0x03e8 + textpointer MewTradeCardName ; 0x03e9 + textpointer ArcanineTradeCardName ; 0x03ea + textpointer PikachuTradeCardName ; 0x03eb + textpointer SurfingPikachuTradeCardName ; 0x03ec + textpointer ElectabuzzTradeCardName ; 0x03ed + textpointer SlowpokeTradeCardName ; 0x03ee + textpointer JigglypuffTradeCardName ; 0x03ef + textpointer ZapdosLegendaryCardName ; 0x03f0 + textpointer MoltresLegendaryCardName ; 0x03f1 + textpointer ArticunoLegendaryCardName ; 0x03f2 + textpointer DragoniteLegendaryCardName ; 0x03f3 + textpointer SuperEnergyRetrievalTradeCardName ; 0x03f4 + textpointer FlyingPikachuTradeCardName ; 0x03f5 + textpointer LightningAndFireDeckChoiceText ; 0x03f6 + textpointer WaterAndFightingDeckChoiceText ; 0x03f7 + textpointer GrassAndPsychicDeckChoiceText ; 0x03f8 + textpointer SelectDeckToDuelText ; 0x03f9 + textpointer CharmanderAndFriendsDeckChoiceText ; 0x03fa + textpointer SquirtleAndFriendsDeckChoiceText ; 0x03fb + textpointer BulbasaurAndFriendsDeckChoiceText ; 0x03fc + textpointer SelectDeckToTakeText ; 0x03fd + textpointer HowCanIHelpText ; 0x03fe textpointer Text03ff ; 0x03ff textpointer Text0400 ; 0x0400 textpointer Text0401 ; 0x0401 @@ -1051,19 +1051,19 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text0417 ; 0x0417 textpointer Text0418 ; 0x0418 textpointer Text0419 ; 0x0419 - textpointer Text041a ; 0x041a - textpointer Text041b ; 0x041b + textpointer PokemonTradingCards101Text ; 0x041a + textpointer PlaceholderMessageText ; 0x041b textpointer Text041c ; 0x041c - textpointer Text041d ; 0x041d - textpointer Text041e ; 0x041e - textpointer Text041f ; 0x041f - textpointer Text0420 ; 0x0420 - textpointer Text0421 ; 0x0421 - textpointer Text0422 ; 0x0422 - textpointer Text0423 ; 0x0423 - textpointer Text0424 ; 0x0424 - textpointer Text0425 ; 0x0425 - textpointer Text0426 ; 0x0426 + textpointer Gal1WantToTrade1Text ; 0x041d + textpointer Gal1WantToTrade2Text ; 0x041e + textpointer Gal1WouldYouLikeToTradeText ; 0x041f + textpointer Gal1DeclinedTradeText ; 0x0420 + textpointer Gal1DontOwnCardText ; 0x0421 + textpointer Gal1CardInDeckText ; 0x0422 + textpointer Gal1LetsTradeText ; 0x0423 + textpointer Gal1TradeCompleteText ; 0x0424 + textpointer Gal1ThanksText ; 0x0425 + textpointer Gal1AfterTradeText ; 0x0426 textpointer Text0427 ; 0x0427 textpointer Text0428 ; 0x0428 textpointer Text0429 ; 0x0429 @@ -1184,7 +1184,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text049c ; 0x049c textpointer Text049d ; 0x049d textpointer Text049e ; 0x049e - textpointer Text049f ; 0x049f + textpointer WhatIsADeckText ; 0x049f textpointer Text04a0 ; 0x04a0 textpointer Text04a1 ; 0x04a1 textpointer Text04a2 ; 0x04a2 @@ -1470,20 +1470,20 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text05ba ; 0x05ba textpointer Text05bb ; 0x05bb textpointer Text05bc ; 0x05bc - textpointer Text05bd ; 0x05bd - textpointer Text05be ; 0x05be - textpointer Text05bf ; 0x05bf - textpointer Text05c0 ; 0x05c0 - textpointer Text05c1 ; 0x05c1 - textpointer Text05c2 ; 0x05c2 - textpointer Text05c3 ; 0x05c3 - textpointer Text05c4 ; 0x05c4 - textpointer Text05c5 ; 0x05c5 - textpointer Text05c6 ; 0x05c6 - textpointer Text05c7 ; 0x05c7 - textpointer Text05c8 ; 0x05c8 - textpointer Text05c9 ; 0x05c9 - textpointer Text05ca ; 0x05ca + textpointer ItsTheChallengeMachineText ; 0x05bd + textpointer Tech1MasterMedalExplanationText ; 0x05be + textpointer Tech1AutoDeckMachineExplanationText ; 0x05bf + textpointer Tech1FewEnergyCardsText ; 0x05c0 + textpointer Tech1ReceivedEnergyCardsText ; 0x05c1 + textpointer Tech1GoodbyeText ; 0x05c2 + textpointer Tech2LegendaryCardsExplanationText ; 0x05c3 + textpointer Tech2LegendaryCardsCongratsText ; 0x05c4 + textpointer Tech3BoosterPackExplanationText ; 0x05c5 + textpointer Tech3LegendaryCardsCongratsText ; 0x05c6 + textpointer Tech4ClubsExplanationText ; 0x05c7 + textpointer Tech4DefeatedTheGrandMastersText ; 0x05c8 + textpointer Tech5DiaryAndEmailExplanationText ; 0x05c9 + textpointer Tech5ChallengeMachineExplanationText ; 0x05ca textpointer Text05cb ; 0x05cb textpointer Text05cc ; 0x05cc textpointer Text05cd ; 0x05cd @@ -1699,7 +1699,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text069f ; 0x069f textpointer Text06a0 ; 0x06a0 textpointer Text06a1 ; 0x06a1 - textpointer Text06a2 ; 0x06a2 + textpointer FoundLv9SlowpokeText ; 0x06a2 textpointer Text06a3 ; 0x06a3 textpointer Text06a4 ; 0x06a4 textpointer Text06a5 ; 0x06a5 diff --git a/src/wram.asm b/src/wram.asm index aa6d106..7ea2def 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -404,7 +404,10 @@ wDuelTempList:: ; c510 ; this is kept updated with some default text that is used ; when the text printing functions are called with text id $0000 wDefaultText:: ; c590 - ds $70 + ds $2 + +wc592:: ; c592 + ds $6e SECTION "WRAM0 Text Engine", WRAM0 @@ -1622,6 +1625,7 @@ wce53:: ; ce53 wDuelInitialPrizesUpperBitsSet:: ; ce55 ds $1 +wce56:: ; ce56 ds $1 ; it's used for restore the position of cursor @@ -1638,7 +1642,10 @@ wInPlayAreaTemporaryPosition:: ; ce58 wce59:: ; ce59 ds $1 - ds $3 + ds $2 + +wce5c:: ; ce5c + ds $1 ; stores whether there are Pokemon in play area ; player arena Pokemon sets bit 0 @@ -1930,7 +1937,7 @@ wd0a5:: ; d0a5 wd0a6:: ; d0a6 ds $1 -dw0a7:: ; d0a7 +wd0a7:: ; d0a7 ds $2 wd0a9:: ; d0a9 @@ -2115,6 +2122,7 @@ wd237:: ; d237 wd238:: ; d238 ds $1 +wd239:: ; d239 ds $1 wd23a:: ; d23a @@ -2131,7 +2139,10 @@ wd23d:: ; d23d ; palette loaded from Palette* data wLoadedPalData:: ; d23e - ds $51 + ds $50 + +wd28e:: ; d28e + ds $1 wd28f:: ; d28f ds $1 @@ -2300,9 +2311,9 @@ wd3b9:: ; d3b9 ds $2 wd3bb:: ; d3bb - ds $1 + ds $a - ds $14 + ds $b wd3d0:: ; d3d0 ds $1 @@ -2690,7 +2701,7 @@ wd693:: ; d693 wMultichoiceTextboxResult_Sam:: ; d694 ds $1 - + UNION wMultichoiceTextboxResult_ChooseDeckToDuelAgainst:: ; d695 @@ -2711,7 +2722,19 @@ wd696:: ; d696 wd697:: ; d697 ds $1 - ds $6e8 +wd698:: ; d698 + ds $1 + +wd699:: ; d699 + ds $1 + +wd69a:: ; d69a + ds $1 + +wd69b:: ; d69b + ds $1 + + ds $6e4 SECTION "WRAM1 Audio", WRAMX |