2014-05-22 22:13:20 +00:00
|
|
|
LearnMove: ; 6e43 (1:6e43)
|
|
|
|
call SaveScreenTilesToBuffer1
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [wWhichPokemon]
|
|
|
|
ld hl, wPartyMonNicks
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetPartyMonName
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wcd6d
|
|
|
|
ld de, wd036
|
2015-08-05 21:20:29 +00:00
|
|
|
ld bc, 11
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
|
|
|
|
|
|
|
DontAbandonLearning: ; 6e5b (1:6e5b)
|
2015-02-07 20:27:36 +00:00
|
|
|
ld hl, wPartyMon1Moves
|
2015-07-24 08:49:33 +00:00
|
|
|
ld bc, wPartyMon2Moves - wPartyMon1Moves
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [wWhichPokemon]
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddNTimes
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2015-07-24 08:49:33 +00:00
|
|
|
ld b, NUM_MOVES
|
2014-05-22 22:13:20 +00:00
|
|
|
.asm_6e6b
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .asm_6e8b
|
|
|
|
inc hl
|
|
|
|
dec b
|
|
|
|
jr nz, .asm_6e6b
|
|
|
|
push de
|
|
|
|
call TryingToLearn
|
|
|
|
pop de
|
|
|
|
jp c, AbandonLearning
|
|
|
|
push hl
|
|
|
|
push de
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd11e], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetMoveName
|
|
|
|
ld hl, OneTwoAndText
|
|
|
|
call PrintText
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
.asm_6e8b
|
2015-02-08 08:17:03 +00:00
|
|
|
ld a, [wMoveNum]
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [hl], a
|
2015-07-24 08:49:33 +00:00
|
|
|
ld bc, wPartyMon1PP - wPartyMon1Moves
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
dec a
|
2015-02-07 20:27:36 +00:00
|
|
|
ld hl, Moves
|
2015-08-10 04:56:20 +00:00
|
|
|
ld bc, MoveEnd - Moves
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddNTimes
|
2015-07-25 03:27:59 +00:00
|
|
|
ld de, wBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, BANK(Moves)
|
|
|
|
call FarCopyData
|
2015-07-25 03:27:59 +00:00
|
|
|
ld a, [wBuffer + 5] ; a = move's max PP
|
2014-05-22 22:13:20 +00:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ld [hl], a
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [W_ISINBATTLE]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z, PrintLearnedMove
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [wWhichPokemon]
|
2014-05-22 22:13:20 +00:00
|
|
|
ld b, a
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [wPlayerMonNumber]
|
2014-05-22 22:13:20 +00:00
|
|
|
cp b
|
|
|
|
jp nz, PrintLearnedMove
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
2014-06-14 11:12:40 +00:00
|
|
|
ld de, wBattleMonMoves
|
2015-02-08 08:17:03 +00:00
|
|
|
ld bc, NUM_MOVES
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
2015-07-24 08:49:33 +00:00
|
|
|
ld bc, wPartyMon1PP - wPartyMon1OTID
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
2015-02-07 20:27:36 +00:00
|
|
|
ld de, wBattleMonPP
|
2015-07-24 08:49:33 +00:00
|
|
|
ld bc, NUM_MOVES
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
|
|
|
jp PrintLearnedMove
|
|
|
|
|
|
|
|
AbandonLearning: ; 6eda (1:6eda)
|
|
|
|
ld hl, AbandonLearningText
|
|
|
|
call PrintText
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 14, 7
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 8, 15
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, TWO_OPTION_MENU
|
2015-02-07 10:43:08 +00:00
|
|
|
ld [wTextBoxID], a
|
2015-02-07 20:27:36 +00:00
|
|
|
call DisplayTextBoxID ; yes/no menu
|
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp nz, DontAbandonLearning
|
|
|
|
ld hl, DidNotLearnText
|
|
|
|
call PrintText
|
|
|
|
ld b, $0
|
|
|
|
ret
|
|
|
|
|
|
|
|
PrintLearnedMove: ; 6efe (1:6efe)
|
|
|
|
ld hl, LearnedMove1Text
|
|
|
|
call PrintText
|
|
|
|
ld b, $1
|
|
|
|
ret
|
|
|
|
|
|
|
|
TryingToLearn: ; 6f07 (1:6f07)
|
|
|
|
push hl
|
|
|
|
ld hl, TryingToLearnText
|
|
|
|
call PrintText
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 14, 7
|
2015-08-05 21:20:29 +00:00
|
|
|
lb bc, 8, 15
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, TWO_OPTION_MENU
|
2015-02-07 10:43:08 +00:00
|
|
|
ld [wTextBoxID], a
|
2015-02-07 20:27:36 +00:00
|
|
|
call DisplayTextBoxID ; yes/no menu
|
2014-05-22 22:13:20 +00:00
|
|
|
pop hl
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-22 22:13:20 +00:00
|
|
|
rra
|
|
|
|
ret c
|
2015-07-24 08:49:33 +00:00
|
|
|
ld bc, - NUM_MOVES
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
|
|
|
push hl
|
2015-02-08 08:17:03 +00:00
|
|
|
ld de, wMoves
|
|
|
|
ld bc, NUM_MOVES
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
2015-02-08 08:17:03 +00:00
|
|
|
callab FormatMovesString
|
2014-05-22 22:13:20 +00:00
|
|
|
pop hl
|
|
|
|
.asm_6f39
|
|
|
|
push hl
|
|
|
|
ld hl, WhichMoveToForgetText
|
|
|
|
call PrintText
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 4, 7
|
2014-05-22 22:13:20 +00:00
|
|
|
ld b, $4
|
|
|
|
ld c, $e
|
|
|
|
call TextBoxBorder
|
2015-07-18 20:52:03 +00:00
|
|
|
coord hl, 6, 8
|
2015-02-08 08:17:03 +00:00
|
|
|
ld de, wMovesString
|
2015-02-08 00:24:16 +00:00
|
|
|
ld a, [hFlags_0xFFF6]
|
2014-05-22 22:13:20 +00:00
|
|
|
set 2, a
|
2015-02-08 00:24:16 +00:00
|
|
|
ld [hFlags_0xFFF6], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString
|
2015-02-08 00:24:16 +00:00
|
|
|
ld a, [hFlags_0xFFF6]
|
2014-05-22 22:13:20 +00:00
|
|
|
res 2, a
|
2015-02-08 00:24:16 +00:00
|
|
|
ld [hFlags_0xFFF6], a
|
2015-02-07 20:27:36 +00:00
|
|
|
ld hl, wTopMenuItemY
|
2015-07-15 06:16:06 +00:00
|
|
|
ld a, 8
|
|
|
|
ld [hli], a ; wTopMenuItemY
|
|
|
|
ld a, 5
|
|
|
|
ld [hli], a ; wTopMenuItemX
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2015-07-15 06:16:06 +00:00
|
|
|
ld [hli], a ; wCurrentMenuItem
|
2014-05-22 22:13:20 +00:00
|
|
|
inc hl
|
2015-07-15 06:16:06 +00:00
|
|
|
ld a, [wNumMovesMinusOne]
|
|
|
|
ld [hli], a ; wMaxMenuItem
|
|
|
|
ld a, A_BUTTON | B_BUTTON
|
|
|
|
ld [hli], a ; wMenuWatchedKeys
|
|
|
|
ld [hl], 0 ; wLastMenuItem
|
2015-02-08 00:24:16 +00:00
|
|
|
ld hl, hFlags_0xFFF6
|
2014-05-22 22:13:20 +00:00
|
|
|
set 1, [hl]
|
|
|
|
call HandleMenuInput
|
2015-02-08 00:24:16 +00:00
|
|
|
ld hl, hFlags_0xFFF6
|
2014-05-22 22:13:20 +00:00
|
|
|
res 1, [hl]
|
|
|
|
push af
|
|
|
|
call LoadScreenTilesFromBuffer1
|
|
|
|
pop af
|
|
|
|
pop hl
|
|
|
|
bit 1, a
|
|
|
|
jr nz, .asm_6fab
|
|
|
|
push hl
|
2015-02-07 20:27:36 +00:00
|
|
|
ld a, [wCurrentMenuItem]
|
2014-05-22 22:13:20 +00:00
|
|
|
ld c, a
|
|
|
|
ld b, $0
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
push bc
|
|
|
|
call IsMoveHM
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ld a, d
|
|
|
|
jr c, .asm_6fa2
|
|
|
|
pop hl
|
|
|
|
add hl, bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
.asm_6fa2
|
|
|
|
ld hl, HMCantDeleteText
|
|
|
|
call PrintText
|
|
|
|
pop hl
|
|
|
|
jr .asm_6f39
|
|
|
|
.asm_6fab
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
LearnedMove1Text: ; 6fb4 (1:6fb4)
|
|
|
|
TX_FAR _LearnedMove1Text
|
|
|
|
db $b,6,"@"
|
|
|
|
|
|
|
|
WhichMoveToForgetText: ; 6fb4 (1:6fb4)
|
|
|
|
TX_FAR _WhichMoveToForgetText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
AbandonLearningText: ; 6fb9 (1:6fb9)
|
|
|
|
TX_FAR _AbandonLearningText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
DidNotLearnText: ; 6fbe (1:6fbe)
|
|
|
|
TX_FAR _DidNotLearnText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
TryingToLearnText: ; 6fc3 (1:6fc3)
|
|
|
|
TX_FAR _TryingToLearnText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
OneTwoAndText: ; 6fc8 (1:6fc8)
|
|
|
|
TX_FAR _OneTwoAndText
|
|
|
|
db $a
|
2015-07-03 19:58:50 +00:00
|
|
|
TX_ASM
|
2015-07-19 08:46:12 +00:00
|
|
|
ld a, SFX_SWAP
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaySoundWaitForCurrent
|
|
|
|
ld hl, PoofText
|
|
|
|
ret
|
|
|
|
|
|
|
|
PoofText: ; 6fd7 (1:6fd7)
|
|
|
|
TX_FAR _PoofText
|
|
|
|
db $a
|
|
|
|
ForgotAndText: ; 6fdc (1:6fdc)
|
|
|
|
TX_FAR _ForgotAndText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
HMCantDeleteText: ; 6fe1 (1:6fe1)
|
|
|
|
TX_FAR _HMCantDeleteText
|
|
|
|
db "@"
|