Label Card Dungeon progress, disassemble pop-up menus

This commit is contained in:
earthoul
2025-12-21 02:12:16 +09:00
parent e859c8d8fa
commit 96c65d2ab4
13 changed files with 421 additions and 275 deletions

View File

@@ -76,6 +76,20 @@
const GLOSSARY_SPECIAL_DUEL_RULES ; 3
const GLOSSARY_EXIT ; 4
; pop-up menu index
const_def
const POPUPMENU_SAM_RULES ; $0
const POPUPMENU_SAM ; $1
const POPUPMENU_AARON_1 ; $2
const POPUPMENU_AARON_2 ; $3
const POPUPMENU_AARON_3 ; $4
const POPUPMENU_AARON_4 ; $5
const POPUPMENU_CARD_DUNGEON_KNIGHT ; $6
const POPUPMENU_CARD_DUNGEON_BISHOP ; $7
const POPUPMENU_CARD_DUNGEON_ROOK ; $8
const POPUPMENU_CARD_DUNGEON_QUEEN ; $9
const POPUPMENU_CARD_DUNGEON_PAWN ; $a
; filter types for CardTypeFilters
; used to categorise the different cards
; i.e. in the deck building screen

View File

@@ -57,7 +57,7 @@
const VAR_37 ; $37
const VAR_38 ; $38
const VAR_39 ; $39
const VAR_3A ; $3a
const VAR_CARD_DUNGEON_PROGRESS ; $3a
const VAR_3B ; $3b
const VAR_NPC_DECK_ID ; $3c
const VAR_DUEL_START_THEME ; $3d

View File

@@ -2195,7 +2195,7 @@ GeneralVarMasks:
db $26, %11111111 ; VAR_37
db $27, %11111111 ; VAR_38
db $28, %11111111 ; VAR_39
db $29, %00000111 ; VAR_3A
db $29, %00000111 ; VAR_CARD_DUNGEON_PROGRESS
db $2a, %11111111 ; VAR_3B
db $2b, %11111111 ; VAR_NPC_DECK_ID
db $2c, %11111111 ; VAR_DUEL_START_THEME

View File

@@ -5269,17 +5269,19 @@ PrintCardAlbumProgress:
pop af
ret
Func_121e1:
; a = POPUPMENU_* constant
; b = cursor pos
HandlePopupMenu:
push bc
push de
push hl
ld hl, wdb17
ld hl, wPopupMenuCursorPosition
ld [hl], b
add a
add a
add a ; *4
ld c, a
ld b, $00
ld hl, $6214
ld b, 0
ld hl, .ParamItems
add hl, bc
ld e, [hl]
inc hl
@@ -5288,10 +5290,10 @@ Func_121e1:
ld a, [hli]
ld h, [hl]
ld l, a
ld b, $04
ld b, BANK(.ParamItems)
call LoadMenuBoxParams
farcall Func_1cacf
ld a, [wdb17]
ld a, [wPopupMenuCursorPosition]
farcall DrawMenuBox
farcall HandleMenuBox
farcall Func_1caf1
@@ -5299,7 +5301,125 @@ Func_121e1:
pop de
pop bc
ret
; 0x12214
.ParamItems
paramitem 0, 6, .SamRules ; POPUPMENU_SAM_RULES
paramitem 0, 10, .Sam ; POPUPMENU_SAM
paramitem 0, 0, .Aaron1 ; POPUPMENU_AARON_1
paramitem 0, 0, .Aaron2 ; POPUPMENU_AARON_2
paramitem 0, 0, .Aaron3 ; POPUPMENU_AARON_3
paramitem 0, 0, .Aaron4 ; POPUPMENU_AARON_4
paramitem 0, 13, .CardDungeonKnight ; POPUPMENU_CARD_DUNGEON_KNIGHT
paramitem 0, 13, .CardDungeonBishop ; POPUPMENU_CARD_DUNGEON_BISHOP
paramitem 0, 13, .CardDungeonRook ; POPUPMENU_CARD_DUNGEON_ROOK
paramitem 0, 13, .CardDungeonQueen ; POPUPMENU_CARD_DUNGEON_QUEEN
paramitem 0, 13, .CardDungeonPawn ; POPUPMENU_CARD_DUNGEON_PAWN
.SamRules
menubox_params TRUE, 14, 18, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, SamRulesEnergyText
textitem 2, 4, SamRulesAttackText
textitem 2, 6, SamRulesSwitchText
textitem 2, 8, SamRulesEvolutionText
textitem 2, 10, SamRulesPokemonPowerText
textitem 2, 12, SamRulesEndOfTurnText
textitem 2, 14, SamRulesDecisionText
textitem 2, 16, SamRulesQuitText
textitems_end
.Sam
menubox_params TRUE, 10, 10, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, MasonLabPracticeDuelText
textitem 2, 4, MasonLabRegularDuelText
textitem 2, 6, SamRulesText
textitem 2, 8, SamQuitText
textitems_end
.Aaron1
menubox_params TRUE, 10, 6, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, AaronStep1Text
textitem 2, 4, GiftCenterQuitText
textitems_end
.Aaron2
menubox_params TRUE, 10, 8, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, AaronStep1Text
textitem 2, 4, AaronStep2Text
textitem 2, 6, GiftCenterQuitText
textitems_end
.Aaron3
menubox_params TRUE, 10, 10, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, AaronStep1Text
textitem 2, 4, AaronStep2Text
textitem 2, 6, AaronStep3Text
textitem 2, 8, GiftCenterQuitText
textitems_end
.Aaron4
menubox_params TRUE, 10, 12, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, AaronStep1Text
textitem 2, 4, AaronStep2Text
textitem 2, 6, AaronStep3Text
textitem 2, 8, MasonLabRegularDuelText
textitem 2, 10, GiftCenterQuitText
textitems_end
.CardDungeonKnight
menubox_params TRUE, 7, 8, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, GameCenterCardDungeonBet10Text
textitem 2, 4, GameCenterCardDungeonBet20Text
textitem 2, 6, GameCenterCardDungeonBetCancelText
textitems_end
.CardDungeonBishop
menubox_params TRUE, 7, 8, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, GameCenterCardDungeonBet10Text
textitem 2, 4, GameCenterCardDungeonBet30Text
textitem 2, 6, GameCenterCardDungeonBetCancelText
textitems_end
.CardDungeonRook
menubox_params TRUE, 7, 8, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, GameCenterCardDungeonBet30Text
textitem 2, 4, GameCenterCardDungeonBet50Text
textitem 2, 6, GameCenterCardDungeonBetCancelText
textitems_end
.CardDungeonQueen
menubox_params TRUE, 7, 8, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, GameCenterCardDungeonBet50Text
textitem 2, 4, GameCenterCardDungeonBet100Text
textitem 2, 6, GameCenterCardDungeonBetCancelText
textitems_end
.CardDungeonPawn
menubox_params TRUE, 7, 6, \
SYM_CURSOR_R, SYM_SPACE, SYM_CURSOR_R, SYM_CURSOR_R, \
PAD_A, PAD_B, FALSE, 1, NULL, NULL
textitem 2, 2, GameCenterCardDungeonBet10Text
textitem 2, 4, GameCenterCardDungeonBetCancelText
textitems_end
SECTION "Bank 4@639b", ROMX[$639b], BANK[$4]

View File

@@ -926,7 +926,7 @@ CardDungeonQueen_NPCs:
db $ff
CardDungeonQueen_NPCInteractions:
npc_script NPC_QUEEN, Func_311d5
npc_script NPC_QUEEN, CardDungeonQueenScript
db $ff
CardDungeonQueen_MapScripts:
@@ -967,7 +967,7 @@ Func_311d0:
scf
ret
Func_311d5:
CardDungeonQueenScript:
ld a, NPC_QUEEN
ld [wScriptNPC], a
ldtx hl, DialogQueenText
@@ -980,47 +980,48 @@ Func_311d5:
script_command_01
game_center
check_event EVENT_TALKED_TO_QUEEN
script_jump_if_b0z .ows_311f8
script_jump_if_b0z .duel_repeat
set_event EVENT_TALKED_TO_QUEEN
print_npc_text QueenWantsToDuelInitialText
script_jump .ows_311fb
.ows_311f8
script_jump .duel_prompt
.duel_repeat
print_npc_text QueenWantsToDuelRepeatText
.ows_311fb
.duel_prompt
ask_question QueenDuelPromptText, TRUE
script_jump_if_b0z .ows_31268
.ows_31202
script_jump_if_b0z .quit_prompt
.bet_start
print_text GameCenterCardDungeonBetPromptText
quit_script
ld a, $09
ld b, $00
farcall Func_121e1
jr c, .asm_3121e
cp $01
jr z, .asm_3121a
jr nc, .asm_3121e
ld a, $32
jr .asm_31226
.asm_3121a
ld a, $64
jr .asm_31226
.asm_3121e
ld a, POPUPMENU_CARD_DUNGEON_QUEEN
ld b, 0
farcall HandlePopupMenu
jr c, .cancel
cp 1
jr z, .bet_100
jr nc, .cancel
; bet 50
ld a, CHIPS_BET_DUNGEON_50
jr .bet_check
.bet_100
ld a, CHIPS_BET_DUNGEON_100
jr .bet_check
.cancel
ld a, $01
start_script
script_jump .ows_31268
.asm_31226
ld h, $00
script_jump .quit_prompt
.bet_check
ld h, 0
ld l, a
ld [wd615], a
ld [wTempCardDungeonBet], a
call LoadTxRam3
farcall GetGameCenterChips
cp16bc_long hl
jr nc, .asm_31248
jr nc, .bet
ld a, $01
start_script
print_npc_text QueenNotEnoughChipsText
script_jump .ows_31202
.asm_31248
script_jump .bet_start
.bet
ld c, l
ld b, h
farcall DecreaseChipsSmoothly
@@ -1037,14 +1038,14 @@ Func_311d5:
start_duel POWERFUL_POKEMON_DECK_ID, MUSIC_MATCH_START_GR_LEADER
end_script
ret
.ows_31268
.quit_prompt
print_npc_text QueenDeclinedDuelText
ask_question QueenQuitDuelPromptText, TRUE
script_jump_if_b0nz .ows_31278
script_jump_if_b0nz .quit
print_npc_text QueenResumeDuelText
script_jump .ows_311fb
.ows_31278
set_var VAR_3A, $07
script_jump .duel_prompt
.quit
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text QueenPlayerQuitText
script_command_71
script_command_02
@@ -1059,14 +1060,14 @@ Func_31285:
start_script
script_command_01
check_event EVENT_SET_UNTIL_MAP_RELOAD_2
script_jump_if_b0nz .ows_312bb
set_var VAR_3A, $05
script_jump_if_b0nz .player_lost
set_var VAR_CARD_DUNGEON_PROGRESS, $05
print_npc_text QueenPlayerWon1Text
game_center
quit_script
ld a, [wd615]
ld a, [wTempCardDungeonBet]
sla a
ld h, $00
ld h, 0
ld l, a
call LoadTxRam3
ld c, l
@@ -1078,11 +1079,11 @@ Func_31285:
start_script
print_npc_text QueenPlayerWon2Text
script_command_71
script_jump .ows_312c1
.ows_312bb
set_var VAR_3A, $06
script_jump .done
.player_lost
set_var VAR_CARD_DUNGEON_PROGRESS, $06
print_npc_text QueenPlayerLostText
.ows_312c1
.done
script_command_02
end_script
jp Func_312c6

View File

@@ -2002,7 +2002,7 @@ GameCenterCardDungeonAttendantScript_Enter:
print_npc_text GameCenterCardDungeonAttendantNotEnoughChipsText
script_jump .quit
.start
set_var VAR_3A, $00
set_var VAR_CARD_DUNGEON_PROGRESS, $00
print_npc_text GameCenterCardDungeonAttendantReadDescriptionText
quit_script
ld a, $01
@@ -2038,7 +2038,7 @@ GameCenterCardDungeonAttendantScript_Exit:
start_script
script_command_01
set_active_npc_direction WEST
get_var VAR_3A
get_var VAR_CARD_DUNGEON_PROGRESS
compare_loaded_var $06
script_jump_if_b0nz .player_lost
script_jump_if_b1z .player_quit
@@ -2149,12 +2149,12 @@ CardDungeonBishop_NPCs:
db $ff
CardDungeonBishop_NPCInteractions:
npc_script NPC_BISHOP, Func_3512c
npc_script NPC_BISHOP, CardDungeonBishopScript
db $ff
CardDungeonBishop_OWInteractions:
ow_script 4, 1, Func_35273
ow_script 5, 1, Func_35273
ow_script 4, 1, CardDungeonBishopDoorsScript
ow_script 5, 1, CardDungeonBishopDoorsScript
db $ff
CardDungeonBishop_MapScripts:
@@ -2208,7 +2208,7 @@ Func_35127:
scf
ret
Func_3512c:
CardDungeonBishopScript:
ld a, NPC_BISHOP
ld [wScriptNPC], a
ldtx hl, DialogBishopText
@@ -2219,52 +2219,53 @@ Func_3512c:
xor a
start_script
script_command_01
get_var VAR_3A
get_var VAR_CARD_DUNGEON_PROGRESS
compare_loaded_var $02
script_jump_if_b0z Script_351d7
script_jump_if_b0z Script_CardDungeonBishopProceedRepeat
game_center
check_event EVENT_TALKED_TO_BISHOP
script_jump_if_b0z .ows_35156
script_jump_if_b0z .duel_repeat
set_event EVENT_TALKED_TO_BISHOP
print_npc_text BishopWantsToDuelInitialText
script_jump .ows_35159
.ows_35156
script_jump .duel_prompt
.duel_repeat
print_npc_text BishopWantsToDuelRepeatText
.ows_35159
.duel_prompt
ask_question BishopDuelPromptText, TRUE
script_jump_if_b0z .ows_351bb
.ows_35160
script_jump_if_b0z .quit_prompt
.bet_start
print_text GameCenterCardDungeonBetPromptText
quit_script
ld a, $07
ld b, $00
farcall Func_121e1
jr c, .asm_3517c
cp $01
jr z, .asm_35178
jr nc, .asm_3517c
ld a, $0a
jr .asm_35184
.asm_35178
ld a, $1e
jr .asm_35184
.asm_3517c
ld a, POPUPMENU_CARD_DUNGEON_BISHOP
ld b, 0
farcall HandlePopupMenu
jr c, .cancel
cp 1 ; cursor pos
jr z, .bet_30
jr nc, .cancel
; bet 10
ld a, CHIPS_BET_DUNGEON_10
jr .bet_check
.bet_30
ld a, CHIPS_BET_DUNGEON_30
jr .bet_check
.cancel
ld a, $01
start_script
script_jump .ows_351bb
.asm_35184
ld h, $00
script_jump .quit_prompt
.bet_check
ld h, 0
ld l, a
ld [wd615], a
ld [wTempCardDungeonBet], a
call LoadTxRam3
farcall GetGameCenterChips
cp16bc_long hl
jr nc, .asm_351a6
jr nc, .bet
ld a, $01
start_script
print_npc_text BishopNotEnoughChipsText
script_jump .ows_35160
.asm_351a6
script_jump .bet_start
.bet
ld c, l
ld b, h
farcall DecreaseChipsSmoothly
@@ -2276,14 +2277,14 @@ Func_3512c:
start_duel TEXTURE_TUNER7_DECK_ID, MUSIC_MATCH_START_MEMBER
end_script
ret
.ows_351bb
.quit_prompt
print_npc_text BishopDeclinedDuelText
ask_question BishopQuitDuelPromptText, TRUE
script_jump_if_b0nz .ows_351cb
script_jump_if_b0nz .quit
print_npc_text BishopResumeDuelText
script_jump .ows_35159
.ows_351cb
set_var VAR_3A, $07
script_jump .duel_prompt
.quit
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text BishopPlayerQuitText
script_command_71
script_command_02
@@ -2292,7 +2293,7 @@ Func_3512c:
Func_351d4:
jp Func_3524f
Script_351d7:
Script_CardDungeonBishopProceedRepeat:
print_npc_text BishopProceedRepeatText
script_command_02
end_script
@@ -2303,13 +2304,13 @@ Func_351dd:
start_script
script_command_01
check_event EVENT_SET_UNTIL_MAP_RELOAD_2
script_jump_if_b0nz .ows_35210
script_jump_if_b0nz .player_lost
print_npc_text BishopPlayerWon1Text
game_center
quit_script
ld a, [wd615]
ld a, [wTempCardDungeonBet]
sla a
ld h, $00
ld h, 0
ld l, a
call LoadTxRam3
ld c, l
@@ -2321,33 +2322,33 @@ Func_351dd:
start_script
print_npc_text BishopPlayerWon2Text
script_command_71
script_jump .ows_3521b
.ows_35210
set_var VAR_3A, $06
script_jump .proceed
.player_lost
set_var VAR_CARD_DUNGEON_PROGRESS, $06
print_npc_text BishopPlayerLostText
script_command_02
end_script
jp Func_3524f
.ows_3521b
.proceed
ask_question BishopProceedWithCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_35237
set_var VAR_3A, $03
script_jump_if_b0z .declined
set_var VAR_CARD_DUNGEON_PROGRESS, $03
print_npc_text BishopProceedInitial1Text
set_active_npc_direction NORTH
play_sfx SFX_DOORS
load_tilemap TILEMAP_04A, $04, $00
print_npc_text BishopProceedInitial2Text
script_jump .ows_3524c
.ows_35237
script_jump .done
.declined
print_npc_text BishopDeclinedProceedingText
ask_question BishopWithdrawFromCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3521b
set_var VAR_3A, $07
script_jump_if_b0z .proceed
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text BishopPlayerWithdrewText
script_command_02
end_script
jp Func_3524f
.ows_3524c
.done
script_command_02
end_script
ret
@@ -2371,18 +2372,18 @@ Func_3525b:
ld [wd582], a
ret
Func_35273:
ld a, VAR_3A
CardDungeonBishopDoorsScript:
ld a, VAR_CARD_DUNGEON_PROGRESS
farcall GetVarValue
cp $02
jr nz, .asm_35287
jr nz, .done
xor a
start_script
script_command_01
print_text DoorsAreShutText
script_command_02
end_script
.asm_35287
.done
ret
GrChallengeHallLobby_MapHeader:

View File

@@ -1086,7 +1086,7 @@ Func_3c84c:
quit_script
ld a, $02
ld b, $00
farcall Func_121e1
farcall HandlePopupMenu
jr c, .asm_3c90a
or a
jp z, Func_3c917
@@ -1096,7 +1096,7 @@ Func_3c84c:
quit_script
ld a, $03
ld b, $00
farcall Func_121e1
farcall HandlePopupMenu
jr c, .asm_3c90a
or a
jp z, Func_3c917
@@ -1108,7 +1108,7 @@ Func_3c84c:
quit_script
ld a, $04
ld b, $00
farcall Func_121e1
farcall HandlePopupMenu
jr c, .asm_3c90a
or a
jp z, Func_3c917
@@ -1124,7 +1124,7 @@ Func_3c84c:
quit_script
ld a, $05
ld b, $00
farcall Func_121e1
farcall HandlePopupMenu
jr c, .asm_3c90a
cp $01
jp c, Func_3c917
@@ -6217,12 +6217,12 @@ CardDungeonPawn_NPCs:
db $ff
CardDungeonPawn_NPCInteractions:
npc_script NPC_PAWN, Func_3f0d9
npc_script NPC_PAWN, CardDungeonPawnScript
db $ff
CardDungeonPawn_OWInteractions:
ow_script 4, 1, Func_3f1de
ow_script 5, 1, Func_3f1de
ow_script 4, 1, CardDungeonPawnDoorsScript
ow_script 5, 1, CardDungeonPawnDoorsScript
db $ff
CardDungeonPawn_MapScripts:
@@ -6276,7 +6276,7 @@ Func_3f0d4:
scf
ret
Func_3f0d9:
CardDungeonPawnScript:
ld a, NPC_PAWN
ld [wScriptNPC], a
ldtx hl, DialogPawnText
@@ -6287,57 +6287,57 @@ Func_3f0d9:
xor a
start_script
script_command_01
get_var VAR_3A
get_var VAR_CARD_DUNGEON_PROGRESS
compare_loaded_var $00
script_jump_if_b0z .ows_3f157
script_jump_if_b0z .proceed
game_center
check_event EVENT_TALKED_TO_PAWN
script_jump_if_b0z .ows_3f103
script_jump_if_b0z .duel_repeat
set_event EVENT_TALKED_TO_PAWN
print_npc_text PawnWantsToDuelInitialText
script_jump .ows_3f106
.ows_3f103
script_jump .duel_prompt
.duel_repeat
print_npc_text PawnWantsToDuelRepeatText
.ows_3f106
.duel_prompt
ask_question PawnDuelPromptText, TRUE
script_jump_if_b0z .ows_3f13b
script_jump_if_b0z .quit_prompt
print_text GameCenterCardDungeonBetPromptText
quit_script
ld a, $0a
ld b, $00
farcall Func_121e1
jr c, .asm_3f126
ld a, POPUPMENU_CARD_DUNGEON_PAWN
ld b, 0
farcall HandlePopupMenu
jr c, .cancel
or a
jr nz, .asm_3f126
jr nz, .cancel
ld a, $01
start_script
script_jump .ows_3f12e
.asm_3f126
script_jump .bet_start
.cancel
ld a, $01
start_script
script_jump .ows_3f13b
.ows_3f12e
take_chips 10
script_jump .quit_prompt
.bet_start
take_chips CHIPS_BET_DUNGEON_10
print_npc_text PawnDuelStartText
script_command_71
script_command_02
start_duel TEST_YOUR_LUCK_DECK_ID, MUSIC_MATCH_START_MEMBER
end_script
ret
.ows_3f13b
.quit_prompt
print_npc_text PawnDeclinedDuelText
ask_question PawnQuitDuelPromptText, TRUE
script_jump_if_b0nz .ows_3f14b
script_jump_if_b0nz .quit
print_npc_text PawnResumeDuelText
script_jump .ows_3f106
.ows_3f14b
set_var VAR_3A, $07
script_jump .duel_prompt
.quit
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text PawnPlayerQuitText
script_command_71
script_command_02
end_script
jp Func_3f1ba
.ows_3f157:
.proceed
print_npc_text PawnProceedRepeatText
script_command_02
end_script
@@ -6348,41 +6348,41 @@ Func_3f15d:
start_script
script_command_01
check_event EVENT_SET_UNTIL_MAP_RELOAD_2
script_jump_if_b0nz .ows_3f17b
script_jump_if_b0nz .player_lost
print_npc_text PawnPlayerWon1Text
game_center
set_text_ram3 20
set_text_ram3 CHIPS_BET_DUNGEON_10 * 2
print_text ReceivedXChipsText
give_chips 20
give_chips CHIPS_BET_DUNGEON_10 * 2
print_npc_text PawnPlayerWon2Text
script_command_71
script_jump .ows_3f186
.ows_3f17b
set_var VAR_3A, $06
script_jump .proceed
.player_lost
set_var VAR_CARD_DUNGEON_PROGRESS, $06
print_npc_text PawnPlayerLostText
script_command_02
end_script
jp Func_3f1ba
.ows_3f186
.proceed
ask_question PawnProceedWithCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3f1a2
set_var VAR_3A, $01
script_jump_if_b0z .declined
set_var VAR_CARD_DUNGEON_PROGRESS, $01
print_npc_text PawnProceedInitial1Text
set_active_npc_direction NORTH
play_sfx SFX_DOORS
load_tilemap TILEMAP_044, $04, $00
print_npc_text PawnProceedInitial2Text
script_jump .ows_3f1b7
.ows_3f1a2
script_jump .done
.declined
print_npc_text PawnDeclinedProceedingText
ask_question PawnWithdrawFromCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3f186
set_var VAR_3A, $07
script_jump_if_b0z .proceed
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text PawnPlayerWithdrewText
script_command_02
end_script
jp Func_3f1ba
.ows_3f1b7
.done
script_command_02
end_script
ret
@@ -6406,18 +6406,18 @@ Func_3f1c6:
ld [wd582], a
ret
Func_3f1de:
ld a, VAR_3A
CardDungeonPawnDoorsScript:
ld a, VAR_CARD_DUNGEON_PROGRESS
farcall GetVarValue
or a
jr nz, .asm_3f1f1
jr nz, .done
xor a
start_script
script_command_01
print_text DoorsAreShutText
script_command_02
end_script
.asm_3f1f1
.done
ret
CardDungeonKnight_MapHeader:
@@ -6435,12 +6435,12 @@ CardDungeonKnight_NPCs:
db $ff
CardDungeonKnight_NPCInteractions:
npc_script NPC_KNIGHT, Func_3f27f
npc_script NPC_KNIGHT, CardDungeonKnightScript
db $ff
CardDungeonKnight_OWInteractions:
ow_script 4, 1, Func_3f3ad
ow_script 5, 1, Func_3f3ad
ow_script 4, 1, CardDungeonKnightDoorsScript
ow_script 5, 1, CardDungeonKnightDoorsScript
db $ff
CardDungeonKnight_MapScripts:
@@ -6494,7 +6494,7 @@ Func_3f27a:
scf
ret
Func_3f27f:
CardDungeonKnightScript:
ld a, NPC_KNIGHT
ld [wScriptNPC], a
ldtx hl, DialogKnightText
@@ -6505,42 +6505,43 @@ Func_3f27f:
xor a
start_script
script_command_01
get_var VAR_3A
get_var VAR_CARD_DUNGEON_PROGRESS
compare_loaded_var $01
script_jump_if_b0z .ows_3f311
script_jump_if_b0z .proceed_repeat
game_center
check_event EVENT_TALKED_TO_KNIGHT
script_jump_if_b0z .ows_3f2a9
script_jump_if_b0z .duel_repeat
set_event EVENT_TALKED_TO_KNIGHT
print_npc_text KnightWantsToDuelInitialText
script_jump .ows_3f2ac
.ows_3f2a9
script_jump .duel_prompt
.duel_repeat
print_npc_text KnightWantsToDuelRepeatText
.ows_3f2ac
.duel_prompt
ask_question KnightDuelPromptText, TRUE
script_jump_if_b0z .ows_3f2f5
script_jump_if_b0z .quit_prompt
print_text GameCenterCardDungeonBetPromptText
quit_script
ld a, $06
ld b, $00
farcall Func_121e1
jr c, .asm_3f2cf
cp $01
jr z, .asm_3f2cb
jr nc, .asm_3f2cf
ld a, $0a
jr .asm_3f2d7
.asm_3f2cb
ld a, $14
jr .asm_3f2d7
.asm_3f2cf
ld a, POPUPMENU_CARD_DUNGEON_KNIGHT
ld b, 0
farcall HandlePopupMenu
jr c, .cancel
cp 1
jr z, .bet_20
jr nc, .cancel
; bet 10
ld a, CHIPS_BET_DUNGEON_10
jr .bet
.bet_20
ld a, CHIPS_BET_DUNGEON_20
jr .bet
.cancel
ld a, $01
start_script
script_jump .ows_3f2f5
.asm_3f2d7
ld h, $00
script_jump .quit_prompt
.bet
ld h, 0
ld l, a
ld [wd615], a
ld [wTempCardDungeonBet], a
call LoadTxRam3
ld c, l
ld b, h
@@ -6553,20 +6554,20 @@ Func_3f27f:
start_duel PROTOHISTORIC_DECK_ID, MUSIC_MATCH_START_MEMBER
end_script
ret
.ows_3f2f5
.quit_prompt
print_npc_text KnightDeclinedDuelText
ask_question KnightQuitDuelPromptText, TRUE
script_jump_if_b0nz .ows_3f305
script_jump_if_b0nz .quit
print_npc_text KnightResumeDuelText
script_jump .ows_3f2ac
.ows_3f305
set_var VAR_3A, $07
script_jump .duel_prompt
.quit
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text KnightPlayerQuitText
script_command_71
script_command_02
end_script
jp Func_3f389
.ows_3f311
.proceed_repeat
print_npc_text KnightProceedRepeatText
script_command_02
end_script
@@ -6577,13 +6578,13 @@ Func_3f317:
start_script
script_command_01
check_event EVENT_SET_UNTIL_MAP_RELOAD_2
script_jump_if_b0nz .ows_3f34a
script_jump_if_b0nz .player_lost
print_npc_text KnightPlayerWon1Text
game_center
quit_script
ld a, [wd615]
ld a, [wTempCardDungeonBet]
sla a
ld h, $00
ld h, 0
ld l, a
call LoadTxRam3
ld c, l
@@ -6595,33 +6596,33 @@ Func_3f317:
start_script
print_npc_text KnightPlayerWon2Text
script_command_71
script_jump .ows_3f355
.ows_3f34a
set_var VAR_3A, $06
script_jump .proceed
.player_lost
set_var VAR_CARD_DUNGEON_PROGRESS, $06
print_npc_text KnightPlayerLostText
script_command_02
end_script
jp Func_3f389
.ows_3f355
.proceed
ask_question KnightProceedWithCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3f371
set_var VAR_3A, $02
script_jump_if_b0z .declined
set_var VAR_CARD_DUNGEON_PROGRESS, $02
print_npc_text KnightProceedInitial1Text
set_active_npc_direction NORTH
play_sfx SFX_DOORS
load_tilemap TILEMAP_047, $04, $00
print_npc_text KnightProceedInitial2Text
script_jump .ows_3f386
.ows_3f371
script_jump .done
.declined
print_npc_text KnightDeclinedProceedingText
ask_question KnightWithdrawFromCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3f355
set_var VAR_3A, $07
script_jump_if_b0z .proceed
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text KnightPlayerWithdrewText
script_command_02
end_script
jp Func_3f389
.ows_3f386
.done
script_command_02
end_script
ret
@@ -6645,18 +6646,18 @@ Func_3f395:
ld [wd582], a
ret
Func_3f3ad:
ld a, VAR_3A
CardDungeonKnightDoorsScript:
ld a, VAR_CARD_DUNGEON_PROGRESS
farcall GetVarValue
cp $01
jr nz, .asm_3f3c1
jr nz, .done
xor a
start_script
script_command_01
print_text DoorsAreShutText
script_command_02
end_script
.asm_3f3c1
.done
ret
CardDungeonRook_MapHeader:
@@ -6674,12 +6675,12 @@ CardDungeonRook_NPCs:
db $ff
CardDungeonRook_NPCInteractions:
npc_script NPC_ROOK, Func_3f44f
npc_script NPC_ROOK, CardDungeonRookScript
db $ff
CardDungeonRook_OWInteractions:
ow_script 4, 1, Func_3f596
ow_script 5, 1, Func_3f596
ow_script 4, 1, CardDungeonRookDoorsScript
ow_script 5, 1, CardDungeonRookDoorsScript
db $ff
CardDungeonRook_MapScripts:
@@ -6733,7 +6734,7 @@ Func_3f44a:
scf
ret
Func_3f44f:
CardDungeonRookScript:
ld a, NPC_ROOK
ld [wScriptNPC], a
ldtx hl, DialogRookText
@@ -6744,52 +6745,53 @@ Func_3f44f:
xor a
start_script
script_command_01
get_var VAR_3A
get_var VAR_CARD_DUNGEON_PROGRESS
compare_loaded_var $03
script_jump_if_b0z .ows_3f4fa
script_jump_if_b0z .proceed_repeat
game_center
check_event EVENT_TALKED_TO_ROOK
script_jump_if_b0z .ows_3f479
script_jump_if_b0z .duel_repeat
set_event EVENT_TALKED_TO_ROOK
print_npc_text RookWantsToDuelInitialText
script_jump .ows_3f47c
.ows_3f479
script_jump .duel_prompt
.duel_repeat
print_npc_text RookWantsToDuelRepeatText
.ows_3f47c
.duel_prompt
ask_question RookDuelPromptText, TRUE
script_jump_if_b0z .ows_3f4de
.ows_3f483
script_jump_if_b0z .quit_prompt
.bet_start
print_text GameCenterCardDungeonBetPromptText
quit_script
ld a, $08
ld b, $00
farcall Func_121e1
jr c, .asm_3f49f
cp $01
jr z, .asm_3f49b
jr nc, .asm_3f49f
ld a, $1e
jr .asm_3f4a7
.asm_3f49b
ld a, $32
jr .asm_3f4a7
.asm_3f49f
ld a, POPUPMENU_CARD_DUNGEON_ROOK
ld b, 0
farcall HandlePopupMenu
jr c, .cancel
cp 1
jr z, .bet_50
jr nc, .cancel
; bet 30
ld a, CHIPS_BET_DUNGEON_30
jr .bet_check
.bet_50
ld a, CHIPS_BET_DUNGEON_50
jr .bet_check
.cancel
ld a, $01
start_script
script_jump .ows_3f4de
.asm_3f4a7
ld h, $00
script_jump .quit_prompt
.bet_check
ld h, 0
ld l, a
ld [wd615], a
ld [wTempCardDungeonBet], a
call LoadTxRam3
farcall GetGameCenterChips
cp16bc_long hl
jr nc, .asm_3f4c9
jr nc, .bet
ld a, $01
start_script
print_npc_text RookNotEnoughChipsText
script_jump .ows_3f483
.asm_3f4c9
script_jump .bet_start
.bet
ld c, l
ld b, h
farcall DecreaseChipsSmoothly
@@ -6801,20 +6803,20 @@ Func_3f44f:
start_duel COLORLESS_ENERGY_DECK_ID, MUSIC_MATCH_START_GR_LEADER
end_script
ret
.ows_3f4de
.quit_prompt
print_npc_text RookDeclinedDuelText
ask_question RookQuitDuelPromptText, TRUE
script_jump_if_b0nz .ows_3f4ee
script_jump_if_b0nz .quit
print_npc_text RookResumeDuelText
script_jump .ows_3f47c
.ows_3f4ee
set_var VAR_3A, $07
script_jump .duel_prompt
.quit
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text RookPlayerQuitText
script_command_71
script_command_02
end_script
jp Func_3f572
.ows_3f4fa
.proceed_repeat
print_npc_text RookProceedRepeatText
script_command_02
end_script
@@ -6825,13 +6827,13 @@ Func_3f500:
start_script
script_command_01
check_event EVENT_SET_UNTIL_MAP_RELOAD_2
script_jump_if_b0nz .ows_3f533
script_jump_if_b0nz .player_lost
print_npc_text RookPlayerWon1Text
game_center
quit_script
ld a, [wd615]
ld a, [wTempCardDungeonBet]
sla a
ld h, $00
ld h, 0
ld l, a
call LoadTxRam3
ld c, l
@@ -6843,33 +6845,33 @@ Func_3f500:
start_script
print_npc_text RookPlayerWon2Text
script_command_71
script_jump .ows_3f53e
.ows_3f533
set_var VAR_3A, $06
script_jump .proceed
.player_lost
set_var VAR_CARD_DUNGEON_PROGRESS, $06
print_npc_text RookPlayerLostText
script_command_02
end_script
jp Func_3f572
.ows_3f53e
.proceed
ask_question RookProceedWithCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3f55a
set_var VAR_3A, $04
script_jump_if_b0z .declined
set_var VAR_CARD_DUNGEON_PROGRESS, $04
print_npc_text RookProceedInitial1Text
set_active_npc_direction NORTH
play_sfx SFX_DOORS
load_tilemap TILEMAP_04D, $04, $00
print_npc_text RookProceedInitial2Text
script_jump .ows_3f56f
.ows_3f55a
script_jump .done
.declined
print_npc_text RookDeclinedProceedingText
ask_question RookWithdrawFromCardDungeonPromptText, TRUE
script_jump_if_b0z .ows_3f53e
set_var VAR_3A, $07
script_jump_if_b0z .proceed
set_var VAR_CARD_DUNGEON_PROGRESS, $07
print_npc_text RookPlayerWithdrewText
script_command_02
end_script
jp Func_3f572
.ows_3f56f
.done
script_command_02
end_script
ret
@@ -6893,18 +6895,18 @@ Func_3f57e:
ld [wd582], a
ret
Func_3f596:
ld a, VAR_3A
CardDungeonRookDoorsScript:
ld a, VAR_CARD_DUNGEON_PROGRESS
farcall GetVarValue
cp $03
jr nz, .asm_3f5aa
jr nz, .done
xor a
start_script
script_command_01
print_text DoorsAreShutText
script_command_02
end_script
.asm_3f5aa
.done
ret
WaterFortLobby_MapHeader:

View File

@@ -1866,7 +1866,7 @@ Func_41233:
end_script
ld a, $01
ld b, $00
farcall Func_121e1
farcall HandlePopupMenu
jr c, .asm_41264
or a
jr z, .asm_4126b
@@ -2110,7 +2110,7 @@ Script_41408:
ld b, $00
.asm_4140c
xor a
farcall Func_121e1
farcall HandlePopupMenu
jr c, .asm_41428
or a
jr z, .asm_4142f

View File

@@ -160,6 +160,14 @@ MACRO? textitems_end
db $ff
ENDM
; \1 = x
; \2 = y
; \3 = param addr
MACRO? paramitem
db \1, \2
dw \3
ENDM
; cursor x / cursor y / attribute / idx-up / idx-down / idx-right / idx-left
; idx-[direction] means the index to get when the input is in the direction.
; its attribute is used for drawing a flipped cursor.

View File

@@ -2242,11 +2242,11 @@ SamRulesQuitText:
textfw "きくことは ない"
done
SamPracticeDuelText:
MasonLabPracticeDuelText:
textfw "れんしゅう対戦"
done
SamRegularDuelText:
MasonLabRegularDuelText:
textfw "ふつうに対戦"
done

View File

@@ -1866,8 +1866,8 @@ TextOffsets::
textpointer SamRulesEndOfTurnText ; 0x0741
textpointer SamRulesDecisionText ; 0x0742
textpointer SamRulesQuitText ; 0x0743
textpointer SamPracticeDuelText ; 0x0744
textpointer SamRegularDuelText ; 0x0745
textpointer MasonLabPracticeDuelText ; 0x0744
textpointer MasonLabRegularDuelText ; 0x0745
textpointer SamRulesText ; 0x0746
textpointer SamQuitText ; 0x0747
textpointer AaronStep1Text ; 0x0748

View File

@@ -2469,7 +2469,7 @@ wScriptNPCName:: ; d60f
wSentMailBitfield:: ; d611
ds (NUM_UNIQUE_MAILS_IN_GAME + 7) / 8
wd615:: ; d615
wTempCardDungeonBet:: ; d615
ds $1
; sometimes treated as 8-bit, sometimes treated as 16-bit
@@ -3036,7 +3036,7 @@ wTotalNumCardsToCollect:: ; db13
wTotalNumCardsCollected:: ; db15
ds $2
wdb17:: ; db17
wPopupMenuCursorPosition:: ; db17
ds $1
wdb18:: ; db18

View File

@@ -3014,7 +3014,7 @@ vars = [
"VAR_37",
"VAR_38",
"VAR_39",
"VAR_3A",
"VAR_CARD_DUNGEON_PROGRESS",
"VAR_3B",
"VAR_NPC_DECK_ID",
"VAR_DUEL_START_THEME",