Add Script_Tech1

and fix play_song script command
This commit is contained in:
dannye
2021-01-07 00:21:51 -06:00
parent 6370bdeaee
commit 62de45a387
7 changed files with 86 additions and 29 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -11331,7 +11331,7 @@ DivideBCbyDE: ; 3c5a (0:3c5a)
jr nz, .asm_3c63
ret
CallPlaySong: ; 3c83 (0:3c83)
ScriptPlaySong: ; 3c83 (0:3c83)
call PlaySong
ret

View File

@@ -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

View File

@@ -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!"

View File

@@ -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

View File

@@ -86,9 +86,9 @@ def decodeLine(scriptList, game_data, loc, ignore_broken, locList):
wordLoc = (game_data[loc] + (game_data[loc+1]<<8))
if wordLoc == 0000:
if macroMode:
ret += "NO_JUMP, "
ret += "NULL, "
else:
ret += "\tdw NO_JUMP\n"
ret += "\tdw NULL\n"
else:
if macroMode:
ret += ".ows_" + format(wordLoc+0x8000,"04x") + ", "
@@ -285,7 +285,7 @@ def createList(): # this is a func just so all this can go at the bottom
("Func_d3e0", "", DO_NOT_QUIT,""),
("Func_d3fe", "q", DO_NOT_QUIT,""),
("Func_d408", "b", DO_NOT_QUIT,""),
("Func_d40f", "q", DO_NOT_QUIT,""),
("ScriptCommand_PlaySong", "b", DO_NOT_QUIT,"play_song"),
("ScriptCommand_PlaySFX", "b", DO_NOT_QUIT,"play_sfx"),
("ScriptCommand_PauseSong", "", DO_NOT_QUIT,"pause_song"),
("ScriptCommand_ResumeSong", "", DO_NOT_QUIT,"resume_song"),