summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine/bank03.asm62
-rw-r--r--src/engine/bank04.asm2
-rw-r--r--src/macros/scripts.asm9
-rwxr-xr-xtools/script_extractor2.py2
4 files changed, 53 insertions, 22 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index 489468f..b97d49f 100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -2421,7 +2421,7 @@ Data_d006: ; d006 (3:5006)
db RAPIDASH
db WEEZING
-ScriptCommand_GetMan1RequestedCardNameText: ; d00b (3:500b)
+ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot: ; d00b (3:500b)
sla c
ld b, $0
ld hl, wTxRam2
@@ -4359,27 +4359,57 @@ Script_Man1: ; dc76 (3:5c76)
jump_if_flag_nonzero_2 EVENT_FLAG_29, .ows_dc91
max_out_flag_value EVENT_FLAG_29
pick_next_man1_requested_card
- get_man1_requested_card_name_text
- end_script
-; 0xdc89
-
- INCROM $dc89, $dc91
+ load_man1_requested_card_into_txram_slot $00
+ print_npc_text Text045b
+ max_out_flag_value EVENT_FLAG_2A
+ script_jump .ows_dca5
.ows_dc91
jump_if_flag_zero_2 EVENT_FLAG_2A, .ows_dc9d
- get_man1_requested_card_name_text
- end_script
-; 0xdc97
-
- INCROM $dc97, $dc9d
+ load_man1_requested_card_into_txram_slot $00
+ print_npc_text Text045c
+ script_jump .ows_dca5
.ows_dc9d
pick_next_man1_requested_card
- get_man1_requested_card_name_text
- end_script
-; 0xdca0
-
- INCROM $dca0, $dce5
+ load_man1_requested_card_into_txram_slot $00
+ print_npc_text Text045d
+ max_out_flag_value EVENT_FLAG_2A
+.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_FLAG_01
+ zero_out_flag_value EVENT_FLAG_2A
+ increment_flag_value EVENT_FLAG_2C
+ jump_if_flag_equal EVENT_FLAG_2C, $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_FLAG_2C, $06
+ quit_script_fully
.ows_dce5
print_text_quit_fully Text0465
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index 04e1e85..4e92876 100644
--- a/src/engine/bank04.asm
+++ b/src/engine/bank04.asm
@@ -1028,7 +1028,7 @@ OverworldScriptTable: ; 1217b (4:617b)
dw ScriptCommand_JumpBasedOnFightingClubPupilStatus
dw ScriptCommand_SetActiveNPCDirection
dw ScriptCommand_PickNextMan1RequestedCard
- dw ScriptCommand_GetMan1RequestedCardNameText
+ dw ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot
dw ScriptCommand_JumpIfMan1RequestedCardOwned
dw ScriptCommand_JumpIfMan1RequestedCardInCollection
dw ScriptCommand_RemoveMan1RequestedCardFromCollection
diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm
index 91ca3bb..25c2ae1 100644
--- a/src/macros/scripts.asm
+++ b/src/macros/scripts.asm
@@ -28,7 +28,7 @@ ENDM
const ScriptCommand_JumpBasedOnFightingClubPupilStatus_index ; $14
const ScriptCommand_SetActiveNPCDirection_index ; $15
const ScriptCommand_PickNextMan1RequestedCard_index ; $16
- const ScriptCommand_GetMan1RequestedCardNameText_index ; $17
+ const ScriptCommand_LoadMan1RequestedCardIntoTxRamSlot_index ; $17
const ScriptCommand_JumpIfMan1RequestedCardOwned_index ; $18
const ScriptCommand_JumpIfMan1RequestedCardInCollection_index ; $19
const ScriptCommand_RemoveMan1RequestedCardFromCollection_index ; $1a
@@ -265,9 +265,10 @@ pick_next_man1_requested_card: MACRO
run_command ScriptCommand_PickNextMan1RequestedCard
ENDM
-; Loads the name text for the card gift requested by NPC_MAN1
-get_man1_requested_card_name_text: MACRO
- run_command ScriptCommand_GetMan1RequestedCardNameText
+; 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
diff --git a/tools/script_extractor2.py b/tools/script_extractor2.py
index 1b7aaf7..912c16d 100755
--- a/tools/script_extractor2.py
+++ b/tools/script_extractor2.py
@@ -47,7 +47,7 @@ script_commands = {
0x14: { "name": "fight_club_pupil_jump", "params": [ "label", "label", "label", "label", "label" ] },
0x15: { "name": "set_active_npc_direction", "params": [ "direction" ] },
0x16: { "name": "pick_next_man1_requested_card", "params": [] },
- 0x17: { "name": "get_man1_requested_card_name_text", "params": [] },
+ 0x17: { "name": "load_man1_requested_card_into_txram_slot", "params": [ "byte" ] },
0x18: { "name": "jump_if_man1_requested_card_owned", "params": [ "label" ] },
0x19: { "name": "jump_if_man1_requested_card_in_collection", "params": [ "label" ] },
0x1a: { "name": "remove_man1_requested_card_from_collection", "params": [] },