summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2021-01-09 23:57:21 -0600
committerdannye <33dannye@gmail.com>2021-01-10 18:24:08 -0600
commitc8c78a2213f23ca6425feea875be596c8019e8eb (patch)
treebb207af77274a45bbcf3b7cebae98b0638e505fc /src
parent62de45a387eb955c730aa08400cd1895e35ce2d7 (diff)
Add Script_Sam
Diffstat (limited to 'src')
-rw-r--r--src/engine/bank03.asm176
-rw-r--r--src/engine/bank04.asm27
-rw-r--r--src/engine/bank07.asm2
-rw-r--r--src/engine/effect_functions.asm4
-rw-r--r--src/macros/scripts.asm14
-rw-r--r--src/text/text3.asm16
-rw-r--r--src/text/text6.asm12
-rw-r--r--src/text/text_offsets.asm28
-rw-r--r--src/wram.asm2
9 files changed, 212 insertions, 69 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index d94963d..3608d97 100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -2425,7 +2425,11 @@ Func_cfd4: ; cfd4 (3:4fd4)
jp IncreaseScriptPointerBy1
Data_d006: ; d006 (3:5006)
- INCROM $d006, $d00b
+ db GRAVELER
+ db OMASTAR
+ db PARASECT
+ db RAPIDASH
+ db WEEZING
Func_d00b: ; d00b (3:500b)
sla c
@@ -2813,16 +2817,16 @@ ScriptCommand_ChooseDeckToDuelAgainstMultichoice: ; d24c (3:524c)
.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
dw NULL
@@ -2834,16 +2838,16 @@ ScriptCommand_ChooseStarterDeckMultichoice: ; d271 (3:5271)
.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 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
@@ -3395,28 +3399,156 @@ Script_Tech2: ; d5ca (3:55ca)
quit_script_fully
Script_Tech3: ; d5d5 (3:55d5)
- INCROM $d5d5, $d5e0
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech3BoosterPackExplanationText, Tech3LegendaryCardsCongratsText
+ quit_script_fully
Script_Tech4: ; d5e0 (3:55e0)
- INCROM $d5e0, $d5eb
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech4ClubsExplanationText, Tech4DefeatedTheGrandMastersText
+ quit_script_fully
Preload_Tech5: ; d5eb (3:55eb)
- INCROM $d5eb, $d5f9
+ get_flag_value EVENT_RECEIVED_LEGENDARY_CARD
+ or a
+ jr z, .skip
+ ld hl, wLoadNPCXPos
+ inc [hl]
+ inc [hl]
+.skip
+ scf
+ ret
Script_Tech5: ; d5f9 (3:55f9)
- INCROM $d5f9, $d604
+ start_script
+ jump_if_flag_zero_2 EVENT_RECEIVED_LEGENDARY_CARD, NULL
+ print_variable_text Tech5DiaryAndEmailExplanationText, Tech5ChallengeMachineExplanationText
+ quit_script_fully
Preload_Sam: ; d604 (3:5604)
- INCROM $d604, $d61d
+ get_flag_value EVENT_FLAG_3E
+ 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, $d68a
+ start_script
+ show_sam_normal_multichoice
+ close_text_box
+ jump_if_flag_equal EVENT_FLAG_75, $00, .ows_d63b
+ jump_if_flag_equal EVENT_FLAG_75, $02, Script_d6b0
+ jump_if_flag_equal EVENT_FLAG_75, $03, .ows_d637
+ print_text_string Text05cb
+ ask_question_jump Text05cc, .ows_d647
+.ows_d637
+ print_text_string Text05cd
+ quit_script_fully
+
+.ows_d63b
+ print_text_string Text05ce
+ ask_question_jump Text05cf, .ows_d647
+ print_text_string 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_FLAG_75, $00, .ows_d685
+ start_battle PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1
+ quit_script_fully
+
+.ows_d685
+ start_battle PRIZES_2, SAMS_NORMAL_DECK_ID, MUSIC_DUEL_THEME_1
+ quit_script_fully
Script_BeatSam: ; d68a (3:568a)
- INCROM $d68a, $d69f
+ start_script
+ jump_if_flag_equal EVENT_FLAG_3E, $01, Script_d82d
+ jump_if_flag_equal EVENT_FLAG_75, $01, Script_d6ad
+ print_text_string Text05d1
+ give_booster_packs BOOSTER_ENERGY_RANDOM, NO_BOOSTER, NO_BOOSTER
+ print_text_quit_fully Text05d2
Script_LostToSam: ; d69f (3:569f)
- INCROM $d69f, $d710
+ start_script
+ jump_if_flag_equal EVENT_FLAG_3E, $01, Script_d82d
+ jump_if_flag_equal EVENT_FLAG_75, $01, Script_d6ad
+ print_text_quit_fully Text05d3
+
+Script_d6ad:
+ print_text_quit_fully Text05d4
+
+Script_d6b0:
+ print_text_string Text05d5
+.ows_d6b3
+ close_text_box
+ show_sam_tutorial_multichoice
+ close_text_box
+ jump_if_flag_equal EVENT_FLAG_75, $07, Script_Sam.ows_d637
+ jump_if_flag_equal EVENT_FLAG_75, $01, .ows_d6df
+ jump_if_flag_equal EVENT_FLAG_75, $02, .ows_d6e5
+ jump_if_flag_equal EVENT_FLAG_75, $03, .ows_d6eb
+ jump_if_flag_equal EVENT_FLAG_75, $04, .ows_d6f1
+ jump_if_flag_equal EVENT_FLAG_75, $05, .ows_d6f7
+ jump_if_flag_equal EVENT_FLAG_75, $06, .ows_d6fd
+ print_text_string Text05d6
+ script_jump .ows_d6b3
+.ows_d6df
+ print_text_string Text05d7
+ script_jump .ows_d6b3
+.ows_d6e5
+ print_text_string Text05d8
+ script_jump .ows_d6b3
+.ows_d6eb
+ print_text_string Text05d9
+ script_jump .ows_d6b3
+.ows_d6f1
+ print_text_string Text05da
+ script_jump .ows_d6b3
+.ows_d6f7
+ print_text_string Text05db
+ script_jump .ows_d6b3
+.ows_d6fd
+ print_text_string Text05dc
+ script_jump .ows_d6b3
+
+Func_d703: ; d703 (3:5703)
+ get_flag_value EVENT_RECEIVED_LEGENDARY_CARD
+ or a
+ ret z
+ ld a, $0a
+ farcall Func_80ba4
+ ret
Preload_DrMason: ; d710 (3:5710)
INCROM $d710, $d727
@@ -3532,9 +3664,12 @@ Script_d827: ; d827 (3:5827)
start_script
start_battle PRIZES_2, SAMS_PRACTICE_DECK_ID, MUSIC_DUEL_THEME_1
quit_script_fully
-; 0xd82d
- INCROM $d82d, $d834
+Script_d82d:
+ close_advanced_text_box
+ set_next_npc_and_script $01, AfterTutorialBattleScript
+ end_script_loop
+ ret
AfterTutorialBattleScript: ; d834 (3:5834)
start_script
@@ -3590,6 +3725,7 @@ NPCMovement_d882: ; d882 (3:5882)
db WEST
db WEST
db SOUTH
+NPCMovement_d889: ; d889 (3:5889)
db EAST | NO_MOVE
db $ff
@@ -3887,7 +4023,7 @@ Script_Imakuni: ; dd0d (3:5d0d)
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
+ 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
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index 8759551..db3ae26 100644
--- a/src/engine/bank04.asm
+++ b/src/engine/bank04.asm
@@ -74,7 +74,7 @@ Medal_1029e: ; 1029e (4:429e)
add a
ld c, a
ld b, $0
- ld hl, Unknown_1030b
+ ld hl, MasterMedalNames
add hl, bc
ld a, [hli]
ld [wTxRam2], a
@@ -104,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
@@ -1105,11 +1112,11 @@ 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
@@ -1122,11 +1129,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
@@ -1142,7 +1149,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
diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm
index 1430c81..ea6e432 100644
--- a/src/engine/bank07.asm
+++ b/src/engine/bank07.asm
@@ -1160,7 +1160,7 @@ Func_1cc03: ; 1cc03 (7:4c03)
ret
; 0x1cc2f
-.Func_1cc2f
+.Func_1cc2f
ld a, $4e
.loop
inc a
diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm
index 0fc94d4..1394815 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
@@ -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/macros/scripts.asm b/src/macros/scripts.asm
index 54f78e9..5884ffc 100644
--- a/src/macros/scripts.asm
+++ b/src/macros/scripts.asm
@@ -477,22 +477,22 @@ zero_out_flag_value: MACRO
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
+; 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)
dw \2 ; Script Label
ENDM
-; Jumps to a script position if a flag is nonzero
-jump_if_flag_nonzero_2: MACRO
- run_command ScriptCommand_JumpIfFlagNonzero2
+; 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
ENDM
; Increments given flags value (truncates the new value)
-script_increment_flag_value: MACRO
+increment_flag_value: MACRO
run_command ScriptCommand_IncrementFlagValue
db \1 ; flag (ex EVENT_FLAG_11)
ENDM
diff --git a/src/text/text3.asm b/src/text/text3.asm
index a0cf867..e7dadf6 100644
--- a/src/text/text3.asm
+++ b/src/text/text3.asm
@@ -1916,36 +1916,36 @@ 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
diff --git a/src/text/text6.asm b/src/text/text6.asm
index 3c70229..eb045ea 100644
--- a/src/text/text6.asm
+++ b/src/text/text6.asm
@@ -998,7 +998,7 @@ Tech2LegendaryCardsCongratsText: ; 4b129 (12:7129)
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/text_offsets.asm b/src/text/text_offsets.asm
index ccaa251..50838e6 100644
--- a/src/text/text_offsets.asm
+++ b/src/text/text_offsets.asm
@@ -1015,14 +1015,14 @@ TextOffsets:: ; 34000 (d:4000)
textpointer DragoniteLegendaryCardName ; 0x03f3
textpointer SuperEnergyRetrievalTradeCardName ; 0x03f4
textpointer FlyingPikachuTradeCardName ; 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 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
@@ -1478,12 +1478,12 @@ TextOffsets:: ; 34000 (d:4000)
textpointer Tech1GoodbyeText ; 0x05c2
textpointer Tech2LegendaryCardsExplanationText ; 0x05c3
textpointer Tech2LegendaryCardsCongratsText ; 0x05c4
- textpointer Text05c5 ; 0x05c5
- textpointer Text05c6 ; 0x05c6
- textpointer Text05c7 ; 0x05c7
- textpointer Text05c8 ; 0x05c8
- textpointer Text05c9 ; 0x05c9
- textpointer Text05ca ; 0x05ca
+ 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
diff --git a/src/wram.asm b/src/wram.asm
index c8956d9..238c36f 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -2677,7 +2677,7 @@ wd693:: ; d693
wMultichoiceTextboxResult_Sam:: ; d694
ds $1
-
+
UNION
wMultichoiceTextboxResult_ChooseDeckToDuelAgainst:: ; d695