summaryrefslogtreecommitdiff
path: root/engine/learn_move.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/learn_move.asm')
-rwxr-xr-xengine/learn_move.asm90
1 files changed, 45 insertions, 45 deletions
diff --git a/engine/learn_move.asm b/engine/learn_move.asm
index 75056edb..c0ced4a0 100755
--- a/engine/learn_move.asm
+++ b/engine/learn_move.asm
@@ -4,25 +4,25 @@ LearnMove: ; 6e43 (1:6e43)
ld hl, wPartyMonNicks
call GetPartyMonName
ld hl, wcd6d
- ld de, wd036
- ld bc, $b
+ ld de, wLearnMoveMonName
+ ld bc, NAME_LENGTH
call CopyData
DontAbandonLearning: ; 6e5b (1:6e5b)
ld hl, wPartyMon1Moves
- ld bc, $2c
+ ld bc, wPartyMon2Moves - wPartyMon1Moves
ld a, [wWhichPokemon]
call AddNTimes
ld d, h
ld e, l
- ld b, $4
-.asm_6e6b
+ ld b, NUM_MOVES
+.findEmptyMoveSlotLoop
ld a, [hl]
and a
- jr z, .asm_6e8b
+ jr z, .next
inc hl
dec b
- jr nz, .asm_6e6b
+ jr nz, .findEmptyMoveSlotLoop
push de
call TryingToLearn
pop de
@@ -35,21 +35,21 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
call PrintText
pop de
pop hl
-.asm_6e8b
+.next
ld a, [wMoveNum]
ld [hl], a
- ld bc, $15
+ ld bc, wPartyMon1PP - wPartyMon1Moves
add hl, bc
push hl
push de
dec a
ld hl, Moves
- ld bc, $6
+ ld bc, MoveEnd - Moves
call AddNTimes
- ld de, wHPBarMaxHP
+ ld de, wBuffer
ld a, BANK(Moves)
call FarCopyData
- ld a, [wHPBarNewHP + 1]
+ ld a, [wBuffer + 5] ; a = move's max PP
pop de
pop hl
ld [hl], a
@@ -66,18 +66,18 @@ DontAbandonLearning: ; 6e5b (1:6e5b)
ld de, wBattleMonMoves
ld bc, NUM_MOVES
call CopyData
- ld bc, $11
+ ld bc, wPartyMon1PP - wPartyMon1OTID
add hl, bc
ld de, wBattleMonPP
- ld bc, $4
+ ld bc, NUM_MOVES
call CopyData
jp PrintLearnedMove
AbandonLearning: ; 6eda (1:6eda)
ld hl, AbandonLearningText
call PrintText
- hlCoord 14, 7
- ld bc, $80f
+ coord hl, 14, 7
+ lb bc, 8, 15
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
call DisplayTextBoxID ; yes/no menu
@@ -86,21 +86,21 @@ AbandonLearning: ; 6eda (1:6eda)
jp nz, DontAbandonLearning
ld hl, DidNotLearnText
call PrintText
- ld b, $0
+ ld b, 0
ret
PrintLearnedMove: ; 6efe (1:6efe)
ld hl, LearnedMove1Text
call PrintText
- ld b, $1
+ ld b, 1
ret
TryingToLearn: ; 6f07 (1:6f07)
push hl
ld hl, TryingToLearnText
call PrintText
- hlCoord 14, 7
- ld bc, $80f
+ coord hl, 14, 7
+ lb bc, 8, 15
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
call DisplayTextBoxID ; yes/no menu
@@ -108,7 +108,7 @@ TryingToLearn: ; 6f07 (1:6f07)
ld a, [wCurrentMenuItem]
rra
ret c
- ld bc, $fffc
+ ld bc, -NUM_MOVES
add hl, bc
push hl
ld de, wMoves
@@ -116,15 +116,15 @@ TryingToLearn: ; 6f07 (1:6f07)
call CopyData
callab FormatMovesString
pop hl
-.asm_6f39
+.loop
push hl
ld hl, WhichMoveToForgetText
call PrintText
- hlCoord 4, 7
- ld b, $4
- ld c, $e
+ coord hl, 4, 7
+ ld b, 4
+ ld c, 14
call TextBoxBorder
- hlCoord 6, 8
+ coord hl, 6, 8
ld de, wMovesString
ld a, [hFlags_0xFFF6]
set 2, a
@@ -134,18 +134,18 @@ TryingToLearn: ; 6f07 (1:6f07)
res 2, a
ld [hFlags_0xFFF6], a
ld hl, wTopMenuItemY
- ld a, $8
- ld [hli], a
- ld a, $5
- ld [hli], a
+ ld a, 8
+ ld [hli], a ; wTopMenuItemY
+ ld a, 5
+ ld [hli], a ; wTopMenuItemX
xor a
- ld [hli], a
+ ld [hli], a ; wCurrentMenuItem
inc hl
- ld a, [wcd6c]
- ld [hli], a
- ld a, $3
- ld [hli], a
- ld [hl], $0
+ ld a, [wNumMovesMinusOne]
+ ld [hli], a ; wMaxMenuItem
+ ld a, A_BUTTON | B_BUTTON
+ ld [hli], a ; wMenuWatchedKeys
+ ld [hl], 0 ; wLastMenuItem
ld hl, hFlags_0xFFF6
set 1, [hl]
call HandleMenuInput
@@ -155,12 +155,12 @@ TryingToLearn: ; 6f07 (1:6f07)
call LoadScreenTilesFromBuffer1
pop af
pop hl
- bit 1, a
- jr nz, .asm_6fab
+ bit 1, a ; pressed b
+ jr nz, .cancel
push hl
ld a, [wCurrentMenuItem]
ld c, a
- ld b, $0
+ ld b, 0
add hl, bc
ld a, [hl]
push af
@@ -169,17 +169,17 @@ TryingToLearn: ; 6f07 (1:6f07)
pop bc
pop de
ld a, d
- jr c, .asm_6fa2
+ jr c, .hm
pop hl
add hl, bc
and a
ret
-.asm_6fa2
+.hm
ld hl, HMCantDeleteText
call PrintText
pop hl
- jr .asm_6f39
-.asm_6fab
+ jr .loop
+.cancel
scf
ret
@@ -206,8 +206,8 @@ TryingToLearnText: ; 6fc3 (1:6fc3)
OneTwoAndText: ; 6fc8 (1:6fc8)
TX_FAR _OneTwoAndText
db $a
- db $8
- ld a, (SFX_02_58 - SFX_Headers_02) / 3
+ TX_ASM
+ ld a, SFX_SWAP
call PlaySoundWaitForCurrent
ld hl, PoofText
ret