diff options
author | dannye <33dannye@gmail.com> | 2021-01-07 00:21:51 -0600 |
---|---|---|
committer | dannye <33dannye@gmail.com> | 2021-01-07 00:21:51 -0600 |
commit | 62de45a387eb955c730aa08400cd1895e35ce2d7 (patch) | |
tree | 46622e8cb412565d7b58b41a664c5a5153062fd4 /src | |
parent | 6370bdeaeea201c215c1c667f06d72218c6da6a7 (diff) |
Add Script_Tech1
and fix play_song script command
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/bank03.asm | 65 | ||||
-rw-r--r-- | src/engine/bank04.asm | 2 | ||||
-rw-r--r-- | src/engine/home.asm | 2 | ||||
-rw-r--r-- | src/macros/scripts.asm | 8 | ||||
-rw-r--r-- | src/text/text6.asm | 16 | ||||
-rw-r--r-- | src/text/text_offsets.asm | 16 |
6 files changed, 83 insertions, 26 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index 071ee2d..d94963d 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -3086,9 +3086,9 @@ Func_d408: ; d408 (3:5408) 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) @@ -3332,15 +3332,67 @@ ChallengeMachineObjectTable: ; d572 (3:5572) Script_ChallengeMachine: ; d57d (3:557d) start_script run_command Func_ccdc - tx Text05bd + tx ItsTheChallengeMachineText run_command Func_d43d quit_script_fully Script_Tech1: ; d583 (3:5583) - INCROM $d583, $d5ca + lb bc, 0, EnergyCardListEnd - 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_CARD, NULL + print_variable_text Tech1MasterMedalExplanationText, Tech1AutoDeckMachineExplanationText + quit_script_fully + +.low_on_energies + ld c, EnergyCardListEnd - 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_text_string Tech1FewEnergyCardsText + pause_song + play_song MUSIC_BOOSTER_PACK + print_text_string 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 +EnergyCardListEnd: Script_Tech2: ; d5ca (3:55ca) - INCROM $d5ca, $d5d5 + start_script + jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL + print_variable_text Tech2LegendaryCardsExplanationText, Tech2LegendaryCardsCongratsText + quit_script_fully Script_Tech3: ; d5d5 (3:55d5) INCROM $d5d5, $d5e0 @@ -3513,8 +3565,7 @@ AfterTutorialBattleScript: ; d834 (3:5834) print_text_string Text05f4 close_text_box pause_song - run_command Func_d40f - try_give_medal_pc_packs + play_song MUSIC_BOOSTER_PACK run_command Func_ccdc tx Text05f5 wait_for_song_to_finish diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm index 4815618..8759551 100644 --- a/src/engine/bank04.asm +++ b/src/engine/bank04.asm @@ -1067,7 +1067,7 @@ OverworldScriptTable: ; 1217b (4:617b) dw Func_d3e0 dw Func_d3fe dw Func_d408 - dw Func_d40f + dw ScriptCommand_PlaySong dw ScriptCommand_PlaySFX dw ScriptCommand_PauseSong dw ScriptCommand_ResumeSong diff --git a/src/engine/home.asm b/src/engine/home.asm index 7a3714d..f255bb4 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -11331,7 +11331,7 @@ DivideBCbyDE: ; 3c5a (0:3c5a) jr nz, .asm_3c63 ret -CallPlaySong: ; 3c83 (0:3c83) +ScriptPlaySong: ; 3c83 (0:3c83) call PlaySong ret diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm index 6836b4d..54f78e9 100644 --- a/src/macros/scripts.asm +++ b/src/macros/scripts.asm @@ -77,7 +77,7 @@ ENDM const Func_d3e0_index ; $45 const Func_d3fe_index ; $46 const Func_d408_index ; $47 - const Func_d40f_index ; $48 + const ScriptCommand_PlaySong_index ; $48 const ScriptCommand_PlaySFX_index ; $49 const ScriptCommand_PauseSong_index ; $4a const ScriptCommand_ResumeSong_index ; $4b @@ -346,6 +346,12 @@ script_nop: MACRO run_command ScriptCommand_nop 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 diff --git a/src/text/text6.asm b/src/text/text6.asm index 901e9fe..3c70229 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,7 +991,7 @@ 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!" diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm index 3e9e463..ccaa251 100644 --- a/src/text/text_offsets.asm +++ b/src/text/text_offsets.asm @@ -1470,14 +1470,14 @@ 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 ItsTheChallengeMachineText ; 0x05bd + textpointer Tech1MasterMedalExplanationText ; 0x05be + textpointer Tech1AutoDeckMachineExplanationText ; 0x05bf + textpointer Tech1FewEnergyCardsText ; 0x05c0 + textpointer Tech1ReceivedEnergyCardsText ; 0x05c1 + textpointer Tech1GoodbyeText ; 0x05c2 + textpointer Tech2LegendaryCardsExplanationText ; 0x05c3 + textpointer Tech2LegendaryCardsCongratsText ; 0x05c4 textpointer Text05c5 ; 0x05c5 textpointer Text05c6 ; 0x05c6 textpointer Text05c7 ; 0x05c7 |