Many, many tweaks (Move Relearner!)

- Move Deleter and Move Relearner are added, featuring updated code from Shin Pokered, which took the code from Mateo's Red++ hack. They replace the Trader in Celadon University. The code has been updated quite a bit to fit the modern standards of pokered.
- The Trader has been moved to the trade room in Cinnabar Lab, which is thematically appropriate.
- Eevee's L1 learnset now appropriately features Tail Whip; this was a mistake made by Martha when porting Yellow learnsets.
- Fast Text cursor slot is fixed
- New ROM Bank stores the new maps as it got full when adding the move relearner/deleter - Maps 21 will still have space though.
- WRAM has been fiddled with, please please read the notes if you edit the Move Relearner area, it needs quite a bit of space.
- Wild data for Mt. Moon and Route 22 has been tweaked a little bit.
This commit is contained in:
May Evans 2023-04-02 19:56:44 +01:00
parent 67132fefcb
commit bd23dfa61e
20 changed files with 647 additions and 36 deletions

View file

@ -3,7 +3,6 @@ CeladonUniversityInside_Script:
CeladonUniversityInside_TextPointers:
dw CeladonUniversityInsideText1
dw CeladonUniversityTrader
dw CeladonUniversityInsideText2
dw CeladonUniversityInsideText3
dw CeladonUniversityInsideText4
@ -11,6 +10,8 @@ CeladonUniversityInside_TextPointers:
dw CeladonUniversityInsideBookcaseText2
dw CeladonUniversityInsideBookcaseText3
dw SlowbroCry
dw MoveDeleterText1
dw MoveRelearnerText1
dw CeladonUniversityInsideText5
dw CeladonUniversityPCScreen
@ -18,13 +19,6 @@ CeladonUniversityInsideText1:
text_far _CeladonUniversityInsideText1
text_end
CeladonUniversityTrader:
text_asm
ld a, TRADE_WITH_SELF
ld [wWhichTrade], a
predef DoInGameTradeDialogue
jp TextScriptEnd
CeladonUniversityInsideText2:
text_far _CeladonUniversityInsideText2
text_end

View file

@ -5,6 +5,7 @@ CinnabarLabTradeRoom_TextPointers:
dw Lab2Text1
dw Lab2Text2
dw Lab2Text3
dw CinnabarLabTrader
Lab2Text1:
text_far _Lab2Text1
@ -23,3 +24,10 @@ Lab2Text3:
Lab2DoTrade:
predef DoInGameTradeDialogue
jp TextScriptEnd
CinnabarLabTrader:
text_asm
ld a, TRADE_WITH_SELF
ld [wWhichTrade], a
predef DoInGameTradeDialogue
jp TextScriptEnd

178
scripts/move_deleter.asm Normal file
View file

@ -0,0 +1,178 @@
MoveDeleterText1:
text_asm
ld hl, MoveDeleterGreetingText
call PrintText
.jumpback
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jp nz, .exit
ld hl, MoveDeleterSaidYesText
call PrintText
; Select pokemon from party.
call SaveScreenTilesToBuffer2
xor a
ld [wListScrollOffset], a
ld [wPartyMenuTypeOrMessageID], a
ld [wUpdateSpritesEnabled], a
ld [wMenuItemToSwap], a
call DisplayPartyMenu
push af
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
call LoadGBPal
pop af
jp c, .exit
ld a, [wWhichPokemon]
ld b, a
push bc
call PrepareDeletableMoveList
pop bc
ld a, [wMoveBuffer]
cp 2
jr nc, .chooseMove
ld hl, MoveDeleterOneMoveText
call PrintText
jr .jumpback
.chooseMove
push bc
xor a
ld [wListScrollOffset], a
ld [wCurrentMenuItem], a
ld hl, MoveDeleterWhichMoveText
call PrintText
ld a, MOVESLISTMENU
ld [wListMenuID], a
ld de, wMoveBuffer
ld hl, wListPointer
ld [hl], e
inc hl
ld [hl], d
xor a
ld [wPrintItemPrices], a ; don't print prices
call DisplayListMenuID
pop bc
jr c, .exit ; exit if player chose cancel
; Save the selected move id.
ld a, [wcf91]
ld d, a
push de
push bc
ld [wMoveNum], a
ld [wd11e],a
call GetMoveName
call CopyToStringBuffer ; copy name to wcf4b
ld hl, MoveDeleterConfirmText
call PrintText
call YesNoChoice
pop bc
pop de
ld a, [wCurrentMenuItem]
and a
jr nz, .chooseMove
push de
ld a, b ; a = mon index
ld hl, wPartyMon1Moves
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
; hl = pointer to mon's moves
; Search for the move, and set it to 0.
pop de ; d = move id
call DeleteMove
ld hl, MoveDeleterForgotText
call PrintText
.exit
ld hl, MoveDeleterByeText
call PrintText
jp TextScriptEnd
DeleteMove:
; d = move id
ld b, 0
.searchLoop
ld a, [hli]
cp d
jr z, .foundMoveLoop
inc b
jr .searchLoop
.foundMoveLoop
ld a, b
cp 3
jr z, .zeroLastMove
ld a, [hl]
dec hl
ld [hli], a
push hl
ld de, wPartyMon1PP - wPartyMon1Moves
add hl, de
ld a, [hld]
ld [hl], a ; copy move's PP
pop hl
inc hl
inc b
jr .foundMoveLoop
.zeroLastMove
dec hl
xor a
ld [hl], a
ld de, wPartyMon1PP - wPartyMon1Moves
add hl, de
ld [hl], a ; clear last move's PP
ret
PrepareDeletableMoveList:
; Places a list of the selected pokemon's moves at wMoveBuffer.
; First byte is count, and last byte is $ff.
; Input: party mon index = [wWhichPokemon]
ld a, [wWhichPokemon]
ld hl, wPartyMon1Moves
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
; hl = pointer to mon's 4 moves
ld b, 0 ; count of moves
ld c, 4 + 1 ; 4 moves
ld de, wMoveBuffer + 1
.loop
dec c
jr z, .done
ld a, [hli]
and a
jr z, .loop
ld [de], a
inc de
inc b
jr .loop
.done
ld a, $ff ; terminate the list
ld [de], a
ld a, b ; store number of moves
ld [wMoveBuffer], a
ret
MoveDeleterGreetingText:
text_far _MoveDeleterGreetingText
text_end
MoveDeleterSaidYesText:
text_far _MoveDeleterSaidYesText
text_end
MoveDeleterWhichMoveText:
text_far _MoveDeleterWhichMoveText
text_end
MoveDeleterConfirmText:
text_far _MoveDeleterConfirmText
text_end
MoveDeleterForgotText:
text_far _MoveDeleterForgotText
text_end
MoveDeleterByeText:
text_far _MoveDeleterByeText
text_end
MoveDeleterOneMoveText:
text_far _MoveDeleterOneMoveText
text_end

131
scripts/move_relearner.asm Normal file
View file

@ -0,0 +1,131 @@
MoveRelearnerText1:
text_asm
; Display the list of moves to the player.
ld hl, MoveRelearnerGreetingText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jp nz, .exit
xor a
;charge 1000 money
ld [hMoney], a
ld [hMoney + 2], a
ld a, $0A
ld [hMoney + 1], a
call HasEnoughMoney
jr nc, .enoughMoney
; not enough money
ld hl, MoveRelearnerNotEnoughMoneyText
call PrintText
jp TextScriptEnd
.enoughMoney
ld hl, MoveRelearnerSaidYesText
call PrintText
; Select pokemon from party.
call SaveScreenTilesToBuffer2
xor a
ld [wListScrollOffset], a
ld [wPartyMenuTypeOrMessageID], a
ld [wUpdateSpritesEnabled], a
ld [wMenuItemToSwap], a
call DisplayPartyMenu
push af
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
call LoadGBPal
pop af
jp c, .exit
ld a, [wWhichPokemon]
ld b, a
push bc
ld hl, PrepareRelearnableMoveList
ld b, Bank(PrepareRelearnableMoveList)
call Bankswitch
ld a, [wMoveBuffer]
and a
jr nz, .chooseMove
pop bc
ld hl, MoveRelearnerNoMovesText
call PrintText
jp TextScriptEnd
.chooseMove
ld hl, MoveRelearnerWhichMoveText
call PrintText
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld a, MOVESLISTMENU
ld [wListMenuID], a
ld de, wMoveBuffer
ld hl, wListPointer
ld [hl], e
inc hl
ld [hl], d
xor a
ld [wPrintItemPrices], a ; don't print prices
call DisplayListMenuID
pop bc
jr c, .exit ; exit if player chose cancel
push bc
; Save the selected move id.
ld a, [wcf91]
ld [wMoveNum], a
ld [wd11e],a
call GetMoveName
call CopyToStringBuffer ; copy name to wcf4b
pop bc
ld a, b
ld [wWhichPokemon], a
ld a, [wLetterPrintingDelayFlags]
push af
xor a
ld [wLetterPrintingDelayFlags], a
predef LearnMove
pop af
ld [wLetterPrintingDelayFlags], a
ld a, b
and a
jr z, .exit
; Charge 1000 money
xor a
ld [wPriceTemp], a
ld [wPriceTemp + 2], a
ld a, $0A
ld [wPriceTemp + 1], a
ld hl, wPriceTemp + 2
ld de, wPlayerMoney + 2
ld c, $3
predef SubBCDPredef
ld hl, MoveRelearnerByeText
call PrintText
jp TextScriptEnd
.exit
ld hl, MoveRelearnerByeText
call PrintText
jp TextScriptEnd
MoveRelearnerGreetingText:
text_far _MoveRelearnerGreetingText
text_end
MoveRelearnerSaidYesText:
text_far _MoveRelearnerSaidYesText
text_end
MoveRelearnerNotEnoughMoneyText:
text_far _MoveRelearnerNotEnoughMoneyText
text_end
MoveRelearnerWhichMoveText:
text_far _MoveRelearnerWhichMoveText
text_end
MoveRelearnerByeText:
text_far _MoveRelearnerByeText
text_end
MoveRelearnerNoMovesText:
text_far _MoveRelearnerNoMovesText
text_end