summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2021-01-16 14:11:08 -0600
committerdannye <33dannye@gmail.com>2021-01-16 14:11:08 -0600
commit5ca3f85df5cd0601f810797ee19a5086a0bf24c1 (patch)
tree9e84d9a7c45c045e89afd60e93ea6de1e304df6c /src
parent5af59b450677468d315e130678562ce922ba1a95 (diff)
Fix script command 0x17 argument list
Diffstat (limited to 'src')
-rw-r--r--src/engine/bank03.asm62
-rw-r--r--src/engine/bank04.asm2
-rw-r--r--src/macros/scripts.asm9
3 files changed, 52 insertions, 21 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