2018-01-24 16:17:05 +00:00
|
|
|
MoveDeletion:
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .DeleterIntroText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
2015-12-19 19:48:30 +00:00
|
|
|
jr c, .declined
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .DeleterAskWhichMonText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall SelectMonFromParty
|
2015-12-19 19:48:30 +00:00
|
|
|
jr c, .declined
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-02-11 21:20:22 +00:00
|
|
|
cp EGG
|
2015-12-19 19:48:30 +00:00
|
|
|
jr z, .egg
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
|
|
|
ld hl, wPartyMon1Moves + 1
|
2015-11-04 16:19:58 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2015-02-11 21:20:22 +00:00
|
|
|
call AddNTimes
|
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-19 19:48:30 +00:00
|
|
|
jr z, .onlyonemove
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .DeleterAskWhichMoveText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
2018-01-23 21:08:43 +00:00
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ChooseMoveToDelete
|
2015-02-11 21:20:22 +00:00
|
|
|
push af
|
2015-12-19 01:07:09 +00:00
|
|
|
call ReturnToMapWithSpeechTextbox
|
2015-02-11 21:20:22 +00:00
|
|
|
pop af
|
2015-12-19 19:48:30 +00:00
|
|
|
jr c, .declined
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuCursorY]
|
2015-02-11 21:20:22 +00:00
|
|
|
push af
|
2018-07-29 20:04:38 +00:00
|
|
|
ld a, [wCurSpecies]
|
2018-07-28 23:27:34 +00:00
|
|
|
ld [wNamedObjectIndexBuffer], a
|
2015-02-11 21:20:22 +00:00
|
|
|
call GetMoveName
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .AskDeleteMoveText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
pop bc
|
2015-12-19 19:48:30 +00:00
|
|
|
jr c, .declined
|
|
|
|
call .DeleteMove
|
2015-02-11 21:20:22 +00:00
|
|
|
call WaitSFX
|
|
|
|
ld de, SFX_MOVE_DELETED
|
|
|
|
call PlaySFX
|
|
|
|
call WaitSFX
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .DeleterForgotMoveText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
2015-12-19 19:48:30 +00:00
|
|
|
.egg
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .MailEggText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
2015-12-19 19:48:30 +00:00
|
|
|
.declined
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .DeleterNoComeAgainText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
2015-12-19 19:48:30 +00:00
|
|
|
.onlyonemove
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .MoveKnowsOneText
|
2015-02-11 21:20:22 +00:00
|
|
|
call PrintText
|
|
|
|
ret
|
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.MoveKnowsOneText:
|
|
|
|
text_far _MoveKnowsOneText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.AskDeleteMoveText:
|
|
|
|
text_far _AskDeleteMoveText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.DeleterForgotMoveText:
|
|
|
|
text_far _DeleterForgotMoveText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.MailEggText:
|
|
|
|
text_far _DeleterEggText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.DeleterNoComeAgainText:
|
|
|
|
text_far _DeleterNoComeAgainText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.DeleterAskWhichMoveText:
|
|
|
|
text_far _DeleterAskWhichMoveText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.DeleterIntroText:
|
|
|
|
text_far _DeleterIntroText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.DeleterAskWhichMonText:
|
|
|
|
text_far _DeleterAskWhichMonText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.DeleteMove:
|
2015-02-11 21:20:22 +00:00
|
|
|
ld a, b
|
|
|
|
push bc
|
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMon1Moves
|
2015-02-11 21:20:22 +00:00
|
|
|
add hl, bc
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-04 16:19:58 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2015-02-11 21:20:22 +00:00
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
|
|
|
push bc
|
|
|
|
inc b
|
2015-12-19 19:48:30 +00:00
|
|
|
.loop
|
2015-02-11 21:20:22 +00:00
|
|
|
ld a, b
|
|
|
|
cp NUM_MOVES + 1
|
2015-12-19 19:48:30 +00:00
|
|
|
jr z, .okay
|
2015-02-11 21:20:22 +00:00
|
|
|
inc hl
|
|
|
|
ld a, [hld]
|
|
|
|
ld [hl], a
|
|
|
|
inc hl
|
|
|
|
inc b
|
2015-12-19 19:48:30 +00:00
|
|
|
jr .loop
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2015-12-19 19:48:30 +00:00
|
|
|
.okay
|
2015-02-11 21:20:22 +00:00
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
pop bc
|
|
|
|
|
|
|
|
ld a, b
|
|
|
|
push bc
|
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wPartyMon1PP
|
2015-02-11 21:20:22 +00:00
|
|
|
add hl, bc
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-04 16:19:58 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2015-02-11 21:20:22 +00:00
|
|
|
call AddNTimes
|
|
|
|
pop bc
|
|
|
|
inc b
|
2015-12-19 19:48:30 +00:00
|
|
|
.loop2
|
2015-02-11 21:20:22 +00:00
|
|
|
ld a, b
|
|
|
|
cp NUM_MOVES + 1
|
2015-12-19 19:48:30 +00:00
|
|
|
jr z, .done
|
2015-02-11 21:20:22 +00:00
|
|
|
inc hl
|
|
|
|
ld a, [hld]
|
|
|
|
ld [hl], a
|
|
|
|
inc hl
|
|
|
|
inc b
|
2015-12-19 19:48:30 +00:00
|
|
|
jr .loop2
|
2015-02-11 21:20:22 +00:00
|
|
|
|
2015-12-19 19:48:30 +00:00
|
|
|
.done
|
2015-02-11 21:20:22 +00:00
|
|
|
xor a
|
|
|
|
ld [hl], a
|
|
|
|
ret
|