2018-06-24 14:09:41 +00:00
|
|
|
MobileCheckOwnMonAnywhere:
|
2022-06-18 03:21:08 +00:00
|
|
|
; Like CheckOwnMonAnywhere, but only checks for species.
|
2015-12-07 03:36:09 +00:00
|
|
|
; OT/ID don't matter.
|
|
|
|
|
2022-06-18 03:21:08 +00:00
|
|
|
; inputs:
|
|
|
|
; [wScriptVar] should contain the species we're looking for.
|
|
|
|
|
|
|
|
; outputs:
|
|
|
|
; sets carry if monster matches species.
|
|
|
|
|
|
|
|
; If there are no monsters in the party,
|
|
|
|
; the player must not own any yet.
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
|
|
|
|
ld d, a
|
|
|
|
ld e, 0
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMon1Species
|
2021-03-17 20:16:02 +00:00
|
|
|
ld bc, wPartyMonOTs
|
2022-06-18 03:21:08 +00:00
|
|
|
|
|
|
|
; Run .CheckMatch on each Pokémon in the party.
|
|
|
|
|
|
|
|
.partymon
|
2015-12-07 03:36:09 +00:00
|
|
|
call .CheckMatch
|
|
|
|
ret c
|
2022-06-18 03:21:08 +00:00
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
push bc
|
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
2019-11-24 01:56:22 +00:00
|
|
|
call .AdvanceOTName
|
2015-12-07 03:36:09 +00:00
|
|
|
dec d
|
2022-06-18 03:21:08 +00:00
|
|
|
jr nz, .partymon
|
|
|
|
|
|
|
|
; Run .CheckMatch on each Pokémon in the PC.
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, BANK(sBoxCount)
|
2020-06-17 21:03:38 +00:00
|
|
|
call OpenSRAM
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [sBoxCount]
|
|
|
|
and a
|
2022-06-18 03:21:08 +00:00
|
|
|
jr z, .boxes
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
ld d, a
|
|
|
|
ld hl, sBoxMon1Species
|
2021-03-17 20:16:02 +00:00
|
|
|
ld bc, sBoxMonOTs
|
2022-06-18 03:21:08 +00:00
|
|
|
.openboxmon
|
2015-12-07 03:36:09 +00:00
|
|
|
call .CheckMatch
|
2022-06-18 03:21:08 +00:00
|
|
|
jr nc, .loop
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2022-06-18 03:21:08 +00:00
|
|
|
.loop
|
2015-12-07 03:36:09 +00:00
|
|
|
push bc
|
|
|
|
ld bc, BOXMON_STRUCT_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
2019-11-24 01:56:22 +00:00
|
|
|
call .AdvanceOTName
|
2015-12-07 03:36:09 +00:00
|
|
|
dec d
|
2022-06-18 03:21:08 +00:00
|
|
|
jr nz, .openboxmon
|
2015-12-07 03:36:09 +00:00
|
|
|
|
2022-06-18 03:21:08 +00:00
|
|
|
; Run .CheckMatch on each monster in the other 13 PC boxes.
|
|
|
|
|
|
|
|
.boxes
|
2015-12-07 03:36:09 +00:00
|
|
|
call CloseSRAM
|
2022-06-18 03:21:08 +00:00
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
ld c, 0
|
2022-06-18 03:21:08 +00:00
|
|
|
.box
|
|
|
|
; Don't search the current box again.
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [wCurBox]
|
|
|
|
and $f
|
|
|
|
cp c
|
2022-06-18 03:21:08 +00:00
|
|
|
jr z, .loopbox
|
|
|
|
|
|
|
|
; Load the box.
|
|
|
|
|
2021-03-21 21:47:53 +00:00
|
|
|
ld hl, .BoxAddresses
|
2015-12-07 03:36:09 +00:00
|
|
|
ld b, 0
|
|
|
|
add hl, bc
|
2016-05-10 16:31:49 +00:00
|
|
|
add hl, bc
|
|
|
|
add hl, bc
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [hli]
|
2020-06-17 21:03:38 +00:00
|
|
|
call OpenSRAM
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2022-06-18 03:21:08 +00:00
|
|
|
|
|
|
|
; Number of monsters in the box
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2022-06-18 03:21:08 +00:00
|
|
|
jr z, .loopbox
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
push bc
|
2022-06-18 03:21:08 +00:00
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
push hl
|
|
|
|
ld de, sBoxMons - sBoxCount
|
|
|
|
add hl, de
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
push de
|
2021-03-17 20:16:02 +00:00
|
|
|
ld de, sBoxMonOTs - sBoxCount
|
2015-12-07 03:36:09 +00:00
|
|
|
add hl, de
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
pop hl
|
2022-06-18 03:21:08 +00:00
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
ld d, a
|
2022-06-18 03:21:08 +00:00
|
|
|
|
|
|
|
.boxmon
|
2015-12-07 03:36:09 +00:00
|
|
|
call .CheckMatch
|
2022-06-18 03:21:08 +00:00
|
|
|
jr nc, .loopboxmon
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
pop bc
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
2022-06-18 03:21:08 +00:00
|
|
|
.loopboxmon
|
2015-12-07 03:36:09 +00:00
|
|
|
push bc
|
|
|
|
ld bc, BOXMON_STRUCT_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
2019-11-24 01:56:22 +00:00
|
|
|
call .AdvanceOTName
|
2015-12-07 03:36:09 +00:00
|
|
|
dec d
|
2022-06-18 03:21:08 +00:00
|
|
|
jr nz, .boxmon
|
2015-12-07 03:36:09 +00:00
|
|
|
pop bc
|
|
|
|
|
2022-06-18 03:21:08 +00:00
|
|
|
.loopbox
|
2015-12-07 03:36:09 +00:00
|
|
|
inc c
|
|
|
|
ld a, c
|
|
|
|
cp NUM_BOXES
|
2022-06-18 03:21:08 +00:00
|
|
|
jr c, .box
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
call CloseSRAM
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.CheckMatch:
|
2022-06-18 03:21:08 +00:00
|
|
|
; Check if a Pokémon is of a specific species.
|
|
|
|
; We compare the species we are looking for in
|
|
|
|
; [wScriptVar] to the species we have in [hl].
|
|
|
|
; Sets carry flag if species matches.
|
|
|
|
|
2015-12-07 03:36:09 +00:00
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
ld d, b
|
|
|
|
ld e, c
|
2022-06-18 03:21:08 +00:00
|
|
|
|
|
|
|
; check species
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-12-07 03:36:09 +00:00
|
|
|
ld b, [hl]
|
|
|
|
cp b
|
|
|
|
jr nz, .no_match
|
|
|
|
jr .match
|
|
|
|
|
|
|
|
.no_match
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.match
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2021-03-21 21:47:53 +00:00
|
|
|
.BoxAddresses:
|
|
|
|
table_width 3, MobileCheckOwnMonAnywhere.BoxAddresses
|
2022-08-31 22:03:49 +00:00
|
|
|
for n, 1, NUM_BOXES + 1
|
|
|
|
dba sBox{d:n}
|
|
|
|
endr
|
2021-03-21 21:47:53 +00:00
|
|
|
assert_table_length NUM_BOXES
|
2015-12-07 03:36:09 +00:00
|
|
|
|
2019-11-24 01:56:22 +00:00
|
|
|
.AdvanceOTName:
|
2015-12-07 03:36:09 +00:00
|
|
|
push hl
|
|
|
|
ld hl, NAME_LENGTH
|
|
|
|
add hl, bc
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
UnusedFindItemInPCOrBag:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
|
|
|
ld [wCurItem], a
|
2019-03-18 15:43:58 +00:00
|
|
|
ld hl, wNumPCItems
|
2015-12-07 03:36:09 +00:00
|
|
|
call CheckItem
|
|
|
|
jr c, .found
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
|
|
|
ld [wCurItem], a
|
|
|
|
ld hl, wNumItems
|
2015-12-07 03:36:09 +00:00
|
|
|
call CheckItem
|
|
|
|
jr c, .found
|
|
|
|
|
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
.found
|
|
|
|
ld a, 1
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4a94e:
|
2015-12-07 03:36:09 +00:00
|
|
|
call FadeToMenu
|
|
|
|
ld a, -1
|
|
|
|
ld hl, wd002
|
|
|
|
ld bc, 3
|
|
|
|
call ByteFill
|
|
|
|
xor a
|
|
|
|
ld [wd018], a
|
|
|
|
ld [wd019], a
|
2015-12-22 23:03:00 +00:00
|
|
|
ld b, SCGB_PACKPALS
|
2015-12-07 03:36:09 +00:00
|
|
|
call GetSGBLayout
|
|
|
|
call SetPalettes
|
|
|
|
call Function4aa22
|
|
|
|
jr c, .asm_4a985
|
|
|
|
jr z, .asm_4a9a1
|
|
|
|
jr .asm_4a97b
|
|
|
|
|
|
|
|
.asm_4a974
|
|
|
|
call Function4aa25
|
|
|
|
jr c, .asm_4a985
|
|
|
|
jr z, .asm_4a9a1
|
|
|
|
|
|
|
|
.asm_4a97b
|
|
|
|
call Function4ac58
|
|
|
|
ld hl, wd019
|
|
|
|
res 1, [hl]
|
|
|
|
jr .asm_4a974
|
|
|
|
|
|
|
|
.asm_4a985
|
|
|
|
ld a, [wd018]
|
|
|
|
and a
|
|
|
|
jr nz, .asm_4a990
|
|
|
|
call Function4aba8
|
|
|
|
jr c, .asm_4a974
|
|
|
|
|
|
|
|
.asm_4a990
|
|
|
|
call CloseSubmenu
|
|
|
|
ld hl, wd002
|
|
|
|
ld a, -1
|
|
|
|
ld bc, 3
|
|
|
|
call ByteFill
|
|
|
|
scf
|
|
|
|
jr .asm_4a9af
|
|
|
|
|
|
|
|
.asm_4a9a1
|
|
|
|
call Function4a9c3
|
|
|
|
jr c, .asm_4a9b0
|
|
|
|
call Function4a9d7
|
|
|
|
jr c, .asm_4a974
|
|
|
|
call CloseSubmenu
|
|
|
|
and a
|
|
|
|
|
|
|
|
.asm_4a9af
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4a9b0
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call PlaySFX
|
2021-02-05 17:44:21 +00:00
|
|
|
ld hl, MobilePickThreeMonForBattleText
|
2015-12-07 03:36:09 +00:00
|
|
|
call PrintText
|
|
|
|
jr .asm_4a974
|
|
|
|
|
2021-02-05 17:44:21 +00:00
|
|
|
MobilePickThreeMonForBattleText:
|
|
|
|
text_far _MobilePickThreeMonForBattleText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-12-07 03:36:09 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4a9c3:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld hl, wd002
|
|
|
|
ld a, $ff
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4a9d5
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4a9d5
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4a9d5
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4a9d5
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4a9d7:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [wd002]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMonNicknames
|
2021-03-17 20:16:02 +00:00
|
|
|
call GetNickname
|
2015-12-07 03:36:09 +00:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2020-04-01 01:26:59 +00:00
|
|
|
ld de, wMobileParticipant1Nickname
|
|
|
|
ld bc, NAME_LENGTH_JAPANESE
|
2015-12-07 03:36:09 +00:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wd003]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMonNicknames
|
2021-03-17 20:16:02 +00:00
|
|
|
call GetNickname
|
2015-12-07 03:36:09 +00:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2020-04-01 01:26:59 +00:00
|
|
|
ld de, wMobileParticipant2Nickname
|
|
|
|
ld bc, NAME_LENGTH_JAPANESE
|
2015-12-07 03:36:09 +00:00
|
|
|
call CopyBytes
|
|
|
|
ld a, [wd004]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMonNicknames
|
2021-03-17 20:16:02 +00:00
|
|
|
call GetNickname
|
2015-12-07 03:36:09 +00:00
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2020-04-01 01:26:59 +00:00
|
|
|
ld de, wMobileParticipant3Nickname
|
|
|
|
ld bc, NAME_LENGTH_JAPANESE
|
2015-12-07 03:36:09 +00:00
|
|
|
call CopyBytes
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, MobileUseTheseThreeMonText
|
2015-12-07 03:36:09 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
ret
|
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
MobileUseTheseThreeMonText:
|
|
|
|
text_far _MobileUseTheseThreeMonText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-12-07 03:36:09 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aa22:
|
2015-12-07 03:36:09 +00:00
|
|
|
call ClearBGPalettes
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aa25:
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall LoadPartyMenuGFX
|
|
|
|
farcall InitPartyMenuWithCancel
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4aad3
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aa34:
|
2017-11-30 19:27:25 +00:00
|
|
|
ld a, PARTYMENUACTION_MOBILE
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wPartyMenuActionText], a
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall WritePartyMenuTilemap
|
2015-12-07 03:36:09 +00:00
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wPartyMenuActionText], a
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PrintPartyMenuText
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4aab6
|
|
|
|
call WaitBGMap
|
|
|
|
call SetPalettes
|
|
|
|
call DelayFrame
|
|
|
|
call Function4ab1a
|
|
|
|
jr z, .asm_4aa66
|
|
|
|
push af
|
|
|
|
call Function4aafb
|
|
|
|
jr c, .asm_4aa67
|
|
|
|
call Function4ab06
|
|
|
|
jr c, .asm_4aa67
|
|
|
|
pop af
|
|
|
|
|
|
|
|
.asm_4aa66
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4aa67
|
|
|
|
ld hl, wd019
|
|
|
|
set 1, [hl]
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2020-10-26 19:45:57 +00:00
|
|
|
Function4aa6e: ; unreferenced
|
2015-12-07 03:36:09 +00:00
|
|
|
pop af
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
jr Function4aa34
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aa7a:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld hl, wd002
|
|
|
|
ld d, $3
|
|
|
|
.loop
|
|
|
|
ld e, PARTY_LENGTH
|
|
|
|
ld a, [hli]
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
cp -1
|
|
|
|
jr z, .done
|
|
|
|
ld hl, wSpriteAnimationStructs
|
|
|
|
inc a
|
|
|
|
ld d, a
|
|
|
|
.inner_loop
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .next
|
|
|
|
cp d
|
|
|
|
jr z, .same_as_d
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
ld a, $3
|
|
|
|
jr .proceed
|
|
|
|
|
|
|
|
.same_as_d
|
|
|
|
ld a, $2
|
|
|
|
|
|
|
|
.proceed
|
|
|
|
push hl
|
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
ld hl, $2
|
|
|
|
add hl, bc
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
|
|
|
|
.next
|
|
|
|
ld bc, $10
|
|
|
|
add hl, bc
|
|
|
|
dec e
|
|
|
|
jr nz, .inner_loop
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
dec d
|
|
|
|
jr nz, .loop
|
|
|
|
jr .finished
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
|
|
|
|
.finished
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aab6:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld hl, wd002
|
|
|
|
ld d, $3
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
cp -1
|
|
|
|
jr z, .done
|
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
hlcoord 0, 1
|
|
|
|
ld bc, $28
|
|
|
|
call AddNTimes
|
|
|
|
ld [hl], $ec
|
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
dec d
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aad3:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyCount
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [hli]
|
|
|
|
and a
|
|
|
|
ret z ; Nothing in your party
|
|
|
|
|
|
|
|
ld c, a
|
|
|
|
xor a
|
2020-12-23 21:54:28 +00:00
|
|
|
ldh [hObjectStructIndex], a
|
2015-12-07 03:36:09 +00:00
|
|
|
.loop
|
|
|
|
push bc
|
|
|
|
push hl
|
2018-07-28 23:27:34 +00:00
|
|
|
ld e, MONICON_PARTYMENU
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall LoadMenuMonIcon
|
2020-12-23 21:54:28 +00:00
|
|
|
ldh a, [hObjectStructIndex]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
2020-12-23 21:54:28 +00:00
|
|
|
ldh [hObjectStructIndex], a
|
2015-12-07 03:36:09 +00:00
|
|
|
pop hl
|
|
|
|
pop bc
|
|
|
|
dec c
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
call Function4aa7a
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PlaySpriteAnimations
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aafb:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp EGG
|
|
|
|
jr z, .egg
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.egg
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ab06:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-07 03:36:09 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMon1HP
|
2015-12-07 03:36:09 +00:00
|
|
|
call AddNTimes
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
ld a, [hl]
|
|
|
|
or b
|
|
|
|
jr nz, .NotFainted
|
|
|
|
scf
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.NotFainted:
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ab1a:
|
2015-12-07 03:36:09 +00:00
|
|
|
.asm_4ab1a
|
|
|
|
ld a, $fb
|
2015-12-20 17:54:08 +00:00
|
|
|
ld [wMenuJoypadFilter], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, $26
|
2015-12-21 19:10:16 +00:00
|
|
|
ld [w2DMenuCursorOffsets], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, $2
|
2015-12-19 19:48:30 +00:00
|
|
|
ld [w2DMenuNumCols], a
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4adf7
|
2015-12-15 23:59:49 +00:00
|
|
|
call StaticMenuJoypad
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4abc3
|
|
|
|
jr c, .asm_4ab1a
|
|
|
|
push af
|
|
|
|
call Function4ab99
|
2015-12-18 03:31:16 +00:00
|
|
|
call nc, PlaceHollowCursor
|
2015-12-07 03:36:09 +00:00
|
|
|
pop af
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_4ab6d
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
|
|
|
ld b, a
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wPartyMenuCursor], a
|
2015-12-07 03:36:09 +00:00
|
|
|
cp b
|
|
|
|
jr z, .asm_4ab7e
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-07 03:36:09 +00:00
|
|
|
dec a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurPartyMon], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld c, a
|
2020-11-09 20:17:03 +00:00
|
|
|
ld b, 0
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartySpecies
|
2015-12-07 03:36:09 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurPartySpecies], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
ld a, $1
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ab6d
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-23 19:00:29 +00:00
|
|
|
ld [wPartyMenuCursor], a
|
2015-12-07 03:36:09 +00:00
|
|
|
.asm_4ab73
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ab7e
|
|
|
|
ld a, $1
|
|
|
|
ld [wd018], a
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorX]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp $2
|
|
|
|
jr z, .asm_4ab73
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
|
|
|
xor a
|
|
|
|
ld [wd018], a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ab99:
|
2015-12-07 03:36:09 +00:00
|
|
|
bit 1, a
|
|
|
|
jr z, .asm_4aba6
|
|
|
|
ld a, [wd002]
|
|
|
|
cp $ff
|
|
|
|
jr z, .asm_4aba6
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4aba6
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4aba8:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld hl, wd004
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_4abbe
|
|
|
|
dec hl
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_4abbe
|
|
|
|
dec hl
|
|
|
|
ld a, [hl]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .asm_4abbe
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4abbe
|
|
|
|
ld a, $ff
|
|
|
|
ld [hl], a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4abc3:
|
2015-12-07 03:36:09 +00:00
|
|
|
bit 3, a
|
|
|
|
jr z, .asm_4abd5
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, $1
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-07 03:36:09 +00:00
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4abd5
|
|
|
|
bit 6, a
|
|
|
|
jr z, .asm_4abeb
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
|
|
|
ld [wMenuCursorY], a
|
2015-12-07 03:36:09 +00:00
|
|
|
and a
|
|
|
|
jr nz, .asm_4ac29
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-07 03:36:09 +00:00
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4abeb
|
|
|
|
bit 7, a
|
|
|
|
jr z, .asm_4ac08
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
|
|
|
ld [wMenuCursorY], a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
2016-05-04 15:46:23 +00:00
|
|
|
inc a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld b, a
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp b
|
|
|
|
jr nz, .asm_4ac29
|
|
|
|
ld a, $1
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-07 03:36:09 +00:00
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4ac08
|
|
|
|
bit 4, a
|
|
|
|
jr nz, .asm_4ac10
|
|
|
|
bit 5, a
|
|
|
|
jr z, .asm_4ac56
|
|
|
|
|
|
|
|
.asm_4ac10
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-07 03:36:09 +00:00
|
|
|
ld b, a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
|
|
|
cp b
|
|
|
|
jr nz, .asm_4ac29
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorX]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp $1
|
|
|
|
jr z, .asm_4ac26
|
|
|
|
ld a, $1
|
|
|
|
jr .asm_4ac29
|
|
|
|
|
|
|
|
.asm_4ac26
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-07 03:36:09 +00:00
|
|
|
|
|
|
|
.asm_4ac29
|
|
|
|
hlcoord 0, 1
|
|
|
|
lb bc, 13, 1
|
|
|
|
call ClearBox
|
|
|
|
call Function4aab6
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
hlcoord 6, 1
|
|
|
|
.asm_4ac3b
|
|
|
|
ld bc, $28
|
|
|
|
add hl, bc
|
|
|
|
dec a
|
|
|
|
jr nz, .asm_4ac3b
|
|
|
|
ld [hl], $7f
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-07 03:36:09 +00:00
|
|
|
ld b, a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
|
|
|
cp b
|
|
|
|
jr z, .asm_4ac54
|
|
|
|
ld a, $1
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-07 03:36:09 +00:00
|
|
|
|
|
|
|
.asm_4ac54
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ac56
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ac58:
|
2015-12-07 03:36:09 +00:00
|
|
|
lb bc, 2, 18
|
|
|
|
hlcoord 1, 15
|
|
|
|
call ClearBox
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall FreezeMonIcons
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, MenuHeader_0x4aca2
|
|
|
|
call LoadMenuHeader
|
2015-12-07 03:36:09 +00:00
|
|
|
ld hl, wd019
|
|
|
|
bit 1, [hl]
|
|
|
|
jr z, .asm_4ac89
|
|
|
|
hlcoord 11, 13
|
|
|
|
ld b, $3
|
|
|
|
ld c, $7
|
2019-04-08 12:15:10 +00:00
|
|
|
call Textbox
|
2015-12-07 03:36:09 +00:00
|
|
|
hlcoord 13, 14
|
|
|
|
ld de, String_4ada7
|
|
|
|
call PlaceString
|
|
|
|
jr .asm_4ac96
|
|
|
|
|
|
|
|
.asm_4ac89
|
|
|
|
hlcoord 11, 9
|
|
|
|
ld b, $7
|
|
|
|
ld c, $7
|
2019-04-08 12:15:10 +00:00
|
|
|
call Textbox
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4ad68
|
|
|
|
|
|
|
|
.asm_4ac96
|
|
|
|
ld a, $1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4acaa
|
|
|
|
call ExitMenu
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
MenuHeader_0x4aca2:
|
2018-01-14 10:59:56 +00:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 21:38:14 +00:00
|
|
|
menu_coords 11, 9, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
2015-12-07 03:36:09 +00:00
|
|
|
dw NULL
|
|
|
|
db 1 ; default option
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4acaa:
|
2015-12-07 03:36:09 +00:00
|
|
|
.asm_4acaa
|
|
|
|
ld a, $a0
|
2018-01-23 21:08:43 +00:00
|
|
|
ld [wMenuDataFlags], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [wd019]
|
|
|
|
bit 1, a
|
|
|
|
jr z, .asm_4acc2
|
|
|
|
ld a, $2
|
2018-01-23 21:08:43 +00:00
|
|
|
ld [wMenuDataItems], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, $c
|
|
|
|
ld [wMenuBorderTopCoord], a
|
|
|
|
jr .asm_4accc
|
|
|
|
|
|
|
|
.asm_4acc2
|
|
|
|
ld a, $4
|
2018-01-23 21:08:43 +00:00
|
|
|
ld [wMenuDataItems], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, $8
|
|
|
|
ld [wMenuBorderTopCoord], a
|
|
|
|
|
|
|
|
.asm_4accc
|
|
|
|
ld a, $b
|
|
|
|
ld [wMenuBorderLeftCoord], a
|
|
|
|
ld a, $1
|
2020-12-23 21:29:30 +00:00
|
|
|
ld [wMenuCursorPosition], a
|
2015-12-15 23:59:49 +00:00
|
|
|
call InitVerticalMenuCursor
|
2015-12-19 19:48:30 +00:00
|
|
|
ld hl, w2DMenuFlags1
|
2015-12-07 03:36:09 +00:00
|
|
|
set 6, [hl]
|
2015-12-15 23:59:49 +00:00
|
|
|
call StaticMenuJoypad
|
2015-12-07 03:36:09 +00:00
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hJoyPressed]
|
2015-12-07 03:36:09 +00:00
|
|
|
bit 0, a
|
|
|
|
jr nz, .asm_4acf4
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_4acf3
|
|
|
|
jr .asm_4acaa
|
|
|
|
|
|
|
|
.asm_4acf3
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4acf4
|
|
|
|
ld a, [wd019]
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_4ad0e
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp $1
|
|
|
|
jr z, Function4ad17
|
|
|
|
cp $2
|
|
|
|
jp z, Function4ad56
|
|
|
|
cp $3
|
|
|
|
jp z, Function4ad60
|
|
|
|
jr .asm_4acf3
|
|
|
|
|
|
|
|
.asm_4ad0e
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp $1
|
|
|
|
jr z, Function4ad56
|
|
|
|
jr .asm_4acf3
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ad17:
|
2015-12-07 03:36:09 +00:00
|
|
|
call Function4adb2
|
|
|
|
jr z, .asm_4ad4a
|
|
|
|
ld hl, wd002
|
|
|
|
ld a, $ff
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4ad39
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4ad39
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
jr z, .asm_4ad39
|
|
|
|
ld de, SFX_WRONG
|
|
|
|
call WaitPlaySFX
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, MobileOnlyThreeMonMayEnterText
|
2015-12-07 03:36:09 +00:00
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ad39
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-07 03:36:09 +00:00
|
|
|
ld [hl], a
|
|
|
|
call Function4a9c3
|
|
|
|
ret c
|
|
|
|
ld a, [wd019]
|
|
|
|
set 0, a
|
|
|
|
ld [wd019], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_4ad4a
|
|
|
|
ld a, $ff
|
|
|
|
ld [hl], a
|
|
|
|
call Function4adc2
|
|
|
|
ret
|
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
MobileOnlyThreeMonMayEnterText:
|
|
|
|
text_far _MobileOnlyThreeMonMayEnterText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-12-07 03:36:09 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ad56:
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall OpenPartyStats
|
2015-12-11 21:59:40 +00:00
|
|
|
call WaitBGMap2
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ad60:
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ManagePokemonMoves
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
2020-10-26 19:45:57 +00:00
|
|
|
Function4ad67: ; unreferenced
|
2015-12-07 03:36:09 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4ad68:
|
2015-12-07 03:36:09 +00:00
|
|
|
hlcoord 13, 12
|
|
|
|
ld de, String_4ad88
|
|
|
|
call PlaceString
|
|
|
|
call Function4adb2
|
|
|
|
jr c, .asm_4ad7e
|
|
|
|
hlcoord 13, 10
|
|
|
|
ld de, String_4ada0
|
|
|
|
jr .asm_4ad84
|
|
|
|
|
|
|
|
.asm_4ad7e
|
|
|
|
hlcoord 13, 10
|
|
|
|
ld de, String_4ad9a
|
|
|
|
|
|
|
|
.asm_4ad84
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
String_4ad88:
|
2015-12-07 03:36:09 +00:00
|
|
|
db "つよさをみる"
|
|
|
|
next "つかえるわざ"
|
|
|
|
next "もどる@"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
String_4ad9a:
|
2015-12-07 03:36:09 +00:00
|
|
|
db "さんかする@"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
String_4ada0:
|
2015-12-07 03:36:09 +00:00
|
|
|
db "さんかしない@"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
String_4ada7:
|
2015-12-07 03:36:09 +00:00
|
|
|
db "つよさをみる"
|
|
|
|
next "もどる@" ; BACK
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4adb2:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld hl, wd002
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
2015-12-07 03:36:09 +00:00
|
|
|
cp [hl]
|
|
|
|
ret z
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
ret z
|
|
|
|
inc hl
|
|
|
|
cp [hl]
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4adc2:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [wd002]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .skip
|
|
|
|
ld a, [wd003]
|
|
|
|
cp $ff
|
|
|
|
jr nz, .skip2
|
|
|
|
ld a, [wd004]
|
|
|
|
ld [wd002], a
|
|
|
|
ld a, $ff
|
|
|
|
ld [wd004], a
|
|
|
|
jr .skip
|
|
|
|
|
|
|
|
.skip2
|
|
|
|
ld [wd002], a
|
|
|
|
ld a, $ff
|
|
|
|
ld [wd003], a
|
|
|
|
|
|
|
|
.skip
|
|
|
|
ld a, [wd003]
|
|
|
|
cp $ff
|
|
|
|
ret nz
|
|
|
|
ld b, a
|
|
|
|
ld a, [wd004]
|
|
|
|
ld [wd003], a
|
|
|
|
ld a, b
|
|
|
|
ld [wd004], a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
Function4adf7:
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [wd019]
|
|
|
|
bit 0, a
|
|
|
|
ret z
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-12-07 03:36:09 +00:00
|
|
|
inc a
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorY], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, $1
|
2015-12-15 23:59:49 +00:00
|
|
|
ld [wMenuCursorX], a
|
2015-12-07 03:36:09 +00:00
|
|
|
ld a, [wd019]
|
|
|
|
res 0, a
|
|
|
|
ld [wd019], a
|
|
|
|
ret
|