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

@ -48,8 +48,8 @@ New areas
==== ====
- Celadon University is just north of Celadon. - Celadon University is just north of Celadon.
- This is a reference to a Magikarp event from July 1998, and includes the lore from it and other areas of Pokemon's early worldbuilding. - This is a reference to a Magikarp event from July 1998, and includes the lore from it and other areas of Pokemon's early worldbuilding.
- This area also contains a Trade-back NPC to let you get trade evolutions.
- New infinitely re-battleable trainers are accessible. - New infinitely re-battleable trainers are accessible.
- There's a Move Deleter and Move Relearner!
- Citrine City is a new island city that can be accessed in the postgame. - Citrine City is a new island city that can be accessed in the postgame.
- Underwater Tunnel connects Route 25 and Route 10. - Underwater Tunnel connects Route 25 and Route 10.
- Cinnabar Volcano is a new area that houses Moltres, allowing it to be obtained before Victory Road. - Cinnabar Volcano is a new area that houses Moltres, allowing it to be obtained before Victory Road.
@ -67,6 +67,7 @@ Improved areas
- The Route 5-6 underground path contains a shortcut to Celadon City. - The Route 5-6 underground path contains a shortcut to Celadon City.
- This allows you to skip Route 9 and Rock Tunnel, making them optional areas and opening up central Kanto. - This allows you to skip Route 9 and Rock Tunnel, making them optional areas and opening up central Kanto.
- Cinnabar Island is a lot bigger, and has a new location added to it. The mansion seems different too... - Cinnabar Island is a lot bigger, and has a new location added to it. The mansion seems different too...
- Cinnabar Lab's trade room features an NPC who'll trade you back your Pokemon for trade evolutions!
- Pokemon Tower was shortened, being less intensive and adding room for more maps. - Pokemon Tower was shortened, being less intensive and adding room for more maps.
- Silph Co's pathing was completely overhauled to make navigating it less tedious. - Silph Co's pathing was completely overhauled to make navigating it less tedious.
- Viridian Gym now has a new area once you make Giovanni leave. - Viridian Gym now has a new area once you make Giovanni leave.
@ -151,8 +152,6 @@ Known Bugs
==== ====
- Only portions of spinner tiles animate. - Only portions of spinner tiles animate.
- Occasionally, menu text sets itself to scroll. - Occasionally, menu text sets itself to scroll.
- Some sprites in the Celadon University area spawn bugged out on certain emulators; the more accurate it is, the more it seems to happen (eg. BGB).
- Battling multiple of the trainers in Celadon University causes a crash when attempting to go to Route 16
- The lone Rocket in Viridian Gym's basement needs to be directly spoken to to be battled - The lone Rocket in Viridian Gym's basement needs to be directly spoken to to be battled
Evolution Methods for new Pokemon Evolution Methods for new Pokemon
@ -253,6 +252,7 @@ Credits
* ZumiIsawhat? - Restorations of beta OST * ZumiIsawhat? - Restorations of beta OST
* Helix Chamber, RacieBeep, loumilouminosus, Orchid, GBCRetro, & catstorm26 - Prototype Pokémon sprites * Helix Chamber, RacieBeep, loumilouminosus, Orchid, GBCRetro, & catstorm26 - Prototype Pokémon sprites
* Vortyne - Reused a bit of code from their pureRGB hack, which was used to assist with making MissingNo. stable. Assisted in bug fixes. * Vortyne - Reused a bit of code from their pureRGB hack, which was used to assist with making MissingNo. stable. Assisted in bug fixes.
* jojobear13 & Mateo - Move deleter & move relearner functionality from Shin Pokered, followed [this guide](https://github.com/jojobear13/shinpokered/blob/master/how%20to%20guides/how%20to%20add%20the%20move%20relearner%26deleter.txt). Tweaks were made to make it compatible with the pokered version we worked off of.
* Rangi - Reused a bit of code from their Red* / Blue* hack to make HMs usable in the overworld! * Rangi - Reused a bit of code from their Red* / Blue* hack to make HMs usable in the overworld!
* 大吟醸 (Daiginjo) - Assistance in translating the Tamamushi University Student Book, allowing for an accurate adaptation of the location. * 大吟醸 (Daiginjo) - Assistance in translating the Tamamushi University Student Book, allowing for an accurate adaptation of the location.

View file

@ -6,18 +6,19 @@ CeladonUniversityInside_Object:
warp_event 11, 19, CELADON_UNIVERSITY_OUTSIDE, 1 warp_event 11, 19, CELADON_UNIVERSITY_OUTSIDE, 1
def_bg_events def_bg_events
bg_event 9, 3, 10 ; Magikarp bg_event 9, 3, 11 ; Magikarp
bg_event 19, 4, 11 ; PC Screen bg_event 19, 4, 12 ; PC Screen
def_object_events def_object_events
object_event 18, 5, SPRITE_MIDDLE_AGED_MAN, STAY, ANY_DIR, 1 ; person object_event 18, 5, SPRITE_MIDDLE_AGED_MAN, STAY, ANY_DIR, 1 ; person
object_event 4, 17, SPRITE_GAMEBOY_KID, STAY, DOWN, 2 ; person object_event 3, 15, SPRITE_PAPER, STAY, NONE, 2 ; person
object_event 3, 15, SPRITE_PAPER, STAY, NONE, 3 ; person object_event 17, 5, SPRITE_POKEDEX, STAY, NONE, 3 ; person
object_event 17, 5, SPRITE_POKEDEX, STAY, NONE, 4 ; person object_event 10, 5, SPRITE_SCIENTIST, STAY, NONE, 4 ; person
object_event 10, 5, SPRITE_SCIENTIST, STAY, NONE, 5 ; person object_event 3, 8, SPRITE_PAPER, STAY, NONE, 5 ; Book 1
object_event 3, 8, SPRITE_PAPER, STAY, NONE, 6 ; Book 1 object_event 5, 4, SPRITE_PAPER, STAY, NONE, 6 ; Book 2
object_event 5, 4, SPRITE_PAPER, STAY, NONE, 7 ; Book 2 object_event 1, 4, SPRITE_PAPER, STAY, NONE, 7 ; Book 3
object_event 1, 4, SPRITE_PAPER, STAY, NONE, 8 ; Book 3 object_event 20, 7, SPRITE_MONSTER, STAY, NONE, 8 ; Slowbro
object_event 20, 7, SPRITE_MONSTER, STAY, NONE, 9 ; Slowbro object_event 1, 17, SPRITE_GAMEBOY_KID, STAY, DOWN, 9
object_event 3, 17, SPRITE_GAMEBOY_KID, STAY, DOWN, 10
def_warps_to CELADON_UNIVERSITY_INSIDE def_warps_to CELADON_UNIVERSITY_INSIDE

View file

@ -11,5 +11,6 @@ CinnabarLabTradeRoom_Object:
object_event 3, 2, SPRITE_SUPER_NERD, STAY, DOWN, 1 ; person object_event 3, 2, SPRITE_SUPER_NERD, STAY, DOWN, 1 ; person
object_event 1, 4, SPRITE_GRAMPS, STAY, NONE, 2 ; person object_event 1, 4, SPRITE_GRAMPS, STAY, NONE, 2 ; person
object_event 5, 5, SPRITE_BEAUTY, STAY, UP, 3 ; person object_event 5, 5, SPRITE_BEAUTY, STAY, UP, 3 ; person
object_event 3, 5, SPRITE_GAMEBOY_KID, STAY, DOWN, 4 ; Trader
def_warps_to CINNABAR_LAB_TRADE_ROOM def_warps_to CINNABAR_LAB_TRADE_ROOM

View file

@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/eevee.pic", 0, 1 ; sprite dimensions INCBIN "gfx/pokemon/front/eevee.pic", 0, 1 ; sprite dimensions
dw EeveePicFront, EeveePicBack dw EeveePicFront, EeveePicBack
db TACKLE, SAND_ATTACK, NO_MOVE, NO_MOVE ; level 1 learnset db TACKLE, TAIL_WHIP, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset ; tm/hm learnset

View file

@ -7,7 +7,7 @@ MtMoon1FWildMons:
db 6, BITTYBAT db 6, BITTYBAT
db 10, SANDSHREW db 10, SANDSHREW
db 10, GEODUDE db 10, GEODUDE
db 8, PARAS db 8, PARA
db 11, BITTYBAT db 11, BITTYBAT
db 8, CLEFAIRY db 8, CLEFAIRY
end_grass_wildmons end_grass_wildmons

View file

@ -5,7 +5,7 @@ MtMoonB1FWildMons:
db 7, GEODUDE db 7, GEODUDE
db 8, GEODUDE db 8, GEODUDE
db 9, GEODUDE db 9, GEODUDE
db 10, PARAS db 10, PARA
db 10, BITTYBAT db 10, BITTYBAT
db 11, SANDSHREW db 11, SANDSHREW
db 9, CLEFAIRY db 9, CLEFAIRY

View file

@ -4,7 +4,7 @@ MtMoonB2FWildMons:
db 9, GEODUDE db 9, GEODUDE
db 10, BITTYBAT db 10, BITTYBAT
db 10, GEODUDE db 10, GEODUDE
db 11, BITTYBAT db 11, ZUBAT
db 10, PARAS db 10, PARAS
db 12, PARAS db 12, PARAS
db 10, CLEFAIRY db 10, CLEFAIRY

View file

@ -5,7 +5,7 @@ Route22WildMons:
db 4, PUDI db 4, PUDI
db 4, NIDORAN_M db 4, NIDORAN_M
db 2, RATTATA db 2, RATTATA
db 2, MANKEY db 4, MANKEY
db 3, SPEAROW db 3, SPEAROW
db 5, MIKON db 5, MIKON
db 3, NIDORAN_F db 3, NIDORAN_F

View file

@ -682,7 +682,7 @@ SetCursorPositionsFromOptions:
TextSpeedOptionData: TextSpeedOptionData:
db 14, TEXT_DELAY_SLOW db 14, TEXT_DELAY_SLOW
db 7, TEXT_DELAY_MEDIUM db 7, TEXT_DELAY_MEDIUM
db 0, TEXT_DELAY_FAST ; this increases the fast text speed by a frame per tick - PvK db 1, TEXT_DELAY_FAST
db 7, -1 ; end (default X coordinate) db 7, -1 ; end (default X coordinate)
CheckForPlayerNameInSRAM: CheckForPlayerNameInSRAM:

View file

@ -510,4 +510,196 @@ WriteMonMoves_ShiftMoveData:
Evolution_FlagAction: Evolution_FlagAction:
predef_jump FlagActionPredef predef_jump FlagActionPredef
; From here, Move Relearner-related code -PvK
;joenote - custom function by Mateo for move relearner
PrepareRelearnableMoveList:: ; I don't know how the fuck you're a single colon in shin pokered but it sure as shit doesn't work here - PvK
; Loads relearnable move list to wRelearnableMoves.
; Input: party mon index = [wWhichPokemon]
; Get mon id.
ld a, [wWhichPokemon]
ld c, a
ld b, 0
ld hl, wPartySpecies
add hl, bc
ld a, [hl] ; a = mon id
ld [wd0b5], a ;joenote - put mon id into wram for potential later usage of GetMonHeader
; Get pointer to evos moves data.
dec a
ld c, a
ld b, 0
ld hl, EvosMovesPointerTable
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a ; hl = pointer to evos moves data for our mon
push hl
; Get pointer to mon's currently-known moves.
ld a, [wWhichPokemon]
ld hl, wPartyMon1Level
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld a, [hl]
ld b, a
push bc
ld a, [wWhichPokemon]
ld hl, wPartyMon1Moves
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
pop bc
ld d, h
ld e, l
pop hl
; Skip over evolution data.
.skipEvoEntriesLoop
ld a, [hli]
and a
jr nz, .skipEvoEntriesLoop
; Write list of relearnable moves, while keeping count along the way.
; de = pointer to mon's currently-known moves
; hl = pointer to moves data for our mon
; b = mon's level
ld c, 0 ; c = count of relearnable moves
.loop
ld a, [hli]
and a
jr z, .done
cp b
jr c, .addMove
jr nz, .done
.addMove
push bc
ld a, [hli] ; move id
ld b, a
; Check if move is already known by our mon.
push de
ld a, [de]
cp b
jr z, .knowsMove
inc de
ld a, [de]
cp b
jr z, .knowsMove
inc de
ld a, [de]
cp b
jr z, .knowsMove
inc de
ld a, [de]
cp b
jr z, .knowsMove
.relearnableMove
pop de
push hl
; Add move to the list, and update the running count.
ld a, b
ld b, 0
ld hl, wMoveBuffer + 1
add hl, bc
ld [hl], a
pop hl
pop bc
inc c
jr .loop
.knowsMove
pop de
pop bc
jr .loop
.done
;joenote - start checking for level-0 moves
xor a
ld b, a ;b will act as a counter, as there can only be up to 4 level-0 moves
call GetMonHeader ;mon id already stored earlier in wd0b5
ld hl, wMonHMoves
.loop2
ld a, b ;get the current loop counter into a
cp $4
jr nc, .done2 ;if gone through 4 moves already, reached the end of the list. move to done2.
ld a, [hl] ;load move
and a
jr z, .done2 ;if move has id 0, list has reached the end early. move to done2.
;check if the move is already in the learnable move list
push bc
push hl
;c = buffer length
.buffer_loop
ld hl, wMoveBuffer
ld b, 0
add hl, bc ;move to buffer at current c value
ld b, a ;b = move id
ld a, [hl] ; move id at buffer point
cp b
ld a, b ;a = move id
jr z, .move_in_buffer
inc c
dec c
jr z, .end_buffer_loop ;jump out if start of buffer is reached
dec c ;else decrement c and loop again
jr .buffer_loop
.move_in_buffer
pop hl
pop bc
inc hl ;increment to the next level-0 move
inc b ;increment the loop counter
jr .loop2
.end_buffer_loop
pop hl
pop bc
;Check if move is already known by our mon.
push bc
ld a, [hl] ; move id
ld b, a
push de
ld a, [de]
cp b
jr z, .knowsMove2
inc de
ld a, [de]
cp b
jr z, .knowsMove2
inc de
ld a, [de]
cp b
jr z, .knowsMove2
inc de
ld a, [de]
cp b
jr z, .knowsMove2
;if the move is not already known, add it to the learnable move list
pop de
push hl
; Add move to the list, and update the running count.
ld a, b
ld b, 0
ld hl, wMoveBuffer + 1
add hl, bc
ld [hl], a
pop hl
pop bc
inc c
inc hl ;increment to the next level-0 move
inc b ;increment the loop counter
jr .loop2
.knowsMove2
pop de
pop bc
inc hl ;increment to the next level-0 move
inc b ;increment the loop counter
jr .loop2
.done2
ld b, 0
ld hl, wMoveBuffer + 1
add hl, bc
ld a, $ff
ld [hl], a
ld hl, wMoveBuffer
ld [hl], c
ret
INCLUDE "data/pokemon/evos_moves.asm" INCLUDE "data/pokemon/evos_moves.asm"

View file

@ -115,7 +115,7 @@ DisplayListMenuIDLoop::
jr nz, .skipMultiplying jr nz, .skipMultiplying
; if it's an item menu ; if it's an item menu
sla c ; item entries are 2 bytes long, so multiply by 2 sla c ; item entries are 2 bytes long, so multiply by 2
.skipMultiplying .skipMultiplying ; this function is modified using something from shin pokered; tldr it makes the move relearner/deleter work. it works and runs faster than my own solution, so I won't question it.
ld a, [wListPointer] ld a, [wListPointer]
ld l, a ld l, a
ld a, [wListPointer + 1] ld a, [wListPointer + 1]
@ -126,12 +126,17 @@ DisplayListMenuIDLoop::
ld a, [hl] ld a, [hl]
ld [wcf91], a ld [wcf91], a
ld a, [wListMenuID] ld a, [wListMenuID]
and a ; PCPOKEMONLISTMENU? and a ; is it a PC pokemon list?
jr z, .pokemonList jr z, .pokemonList
push hl push hl
call GetItemPrice call GetItemPrice
pop hl pop hl
ld a, [wListMenuID] ld a,[wListMenuID]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;needed to make Mateo's move deleter/relearner work
cp a, MOVESLISTMENU
jr z, .skipStoringItemName
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cp ITEMLISTMENU cp ITEMLISTMENU
jr nz, .skipGettingQuantity jr nz, .skipGettingQuantity
; if it's an item menu ; if it's an item menu
@ -143,8 +148,6 @@ DisplayListMenuIDLoop::
ld [wd0b5], a ld [wd0b5], a
ld a, BANK(ItemNames) ld a, BANK(ItemNames)
ld [wPredefBank], a ld [wPredefBank], a
ld a, ITEM_NAME
ld [wNameListType], a
call GetName call GetName
jr .storeChosenEntry jr .storeChosenEntry
.pokemonList .pokemonList
@ -159,13 +162,14 @@ DisplayListMenuIDLoop::
call GetPartyMonName call GetPartyMonName
.storeChosenEntry ; store the menu entry that the player chose and return .storeChosenEntry ; store the menu entry that the player chose and return
ld de, wcd6d ld de, wcd6d
call CopyToStringBuffer call CopyToStringBuffer ; copy name to wcf4b - finding the translation for CopyToC49 or whatever it was wasn't enjoyable
.skipStoringItemName ;skip here if skipping storing item name
ld a, CHOSE_MENU_ITEM ld a, CHOSE_MENU_ITEM
ld [wMenuExitMethod], a ld [wMenuExitMethod], a
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wChosenMenuItem], a ld [wChosenMenuItem], a
xor a xor a
ldh [hJoy7], a ; joypad state update flag ld [hJoy7], a ; joypad state update flag
ld hl, wd730 ld hl, wd730
res 6, [hl] ; turn on letter printing delay res 6, [hl] ; turn on letter printing delay
jp BankswitchBack jp BankswitchBack

View file

@ -1258,6 +1258,8 @@ INCLUDE "scripts/AgathasRoom.asm"
INCLUDE "data/maps/objects/AgathasRoom.asm" INCLUDE "data/maps/objects/AgathasRoom.asm"
AgathasRoom_Blocks: INCBIN "maps/AgathasRoom.blk" AgathasRoom_Blocks: INCBIN "maps/AgathasRoom.blk"
SECTION "Maps 22", ROMX ; Made this because the previous bank was filled to max.
INCLUDE "data/maps/headers/CeladonUniversityOutside.asm" INCLUDE "data/maps/headers/CeladonUniversityOutside.asm"
INCLUDE "scripts/CeladonUniversityOutside.asm" INCLUDE "scripts/CeladonUniversityOutside.asm"
INCLUDE "data/maps/objects/CeladonUniversityOutside.asm" INCLUDE "data/maps/objects/CeladonUniversityOutside.asm"
@ -1267,6 +1269,9 @@ INCLUDE "data/maps/headers/CeladonUniversityInside.asm"
INCLUDE "scripts/CeladonUniversityInside.asm" INCLUDE "scripts/CeladonUniversityInside.asm"
INCLUDE "data/maps/objects/CeladonUniversityInside.asm" INCLUDE "data/maps/objects/CeladonUniversityInside.asm"
CeladonUniversityInside_Blocks: INCBIN "maps/CeladonUniversityInside.blk" CeladonUniversityInside_Blocks: INCBIN "maps/CeladonUniversityInside.blk"
; Mateo's move relearner/deleter files
INCLUDE "scripts/move_deleter.asm"
INCLUDE "scripts/move_relearner.asm"
INCLUDE "data/maps/headers/CinnabarVolcano.asm" INCLUDE "data/maps/headers/CinnabarVolcano.asm"
INCLUDE "scripts/CinnabarVolcano.asm" INCLUDE "scripts/CinnabarVolcano.asm"

View file

@ -256,7 +256,7 @@ wMenuWatchMovingOutOfBounds:: db
wTradeCenterPointerTableIndex:: db wTradeCenterPointerTableIndex:: db
ds 1 ds 1
; destination pointer for text output ; destination pointer for text output
; this variable is written to, but is never read from ; this variable is written to, but is never read from
@ -377,7 +377,15 @@ wSlotMachineSevenAndBarModeChance:: db
ds 2 ds 2
; ROM back to return to when the player is done with the slot machine ; ROM back to return to when the player is done with the slot machine
wSlotMachineSavedROMBank:: db wSlotMachineSavedROMBank:: db
ds 166
; Move Buffer stuff for Mateo's code
wMoveBuffer::
wRelearnableMoves::
ds 164
; Try not to use this stack.
; A good amount of space is needed to store data for the move relearner.
; If it's like, 2, it'll lag like crazy and show garbage from elsewhere.
wLuckySlotHiddenObjectIndex:: db wLuckySlotHiddenObjectIndex:: db
NEXTU NEXTU

View file

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

View file

@ -5,6 +5,7 @@ CinnabarLabTradeRoom_TextPointers:
dw Lab2Text1 dw Lab2Text1
dw Lab2Text2 dw Lab2Text2
dw Lab2Text3 dw Lab2Text3
dw CinnabarLabTrader
Lab2Text1: Lab2Text1:
text_far _Lab2Text1 text_far _Lab2Text1
@ -23,3 +24,10 @@ Lab2Text3:
Lab2DoTrade: Lab2DoTrade:
predef DoInGameTradeDialogue predef DoInGameTradeDialogue
jp TextScriptEnd 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

View file

@ -278,6 +278,8 @@ INCLUDE "text/CinnabarVolcano.asm"
INCLUDE "text/FarawayIslandOutside.asm" INCLUDE "text/FarawayIslandOutside.asm"
INCLUDE "text/PokemonMansionB2F.asm" INCLUDE "text/PokemonMansionB2F.asm"
INCLUDE "text/ViridianPreGym.asm" INCLUDE "text/ViridianPreGym.asm"
INCLUDE "text/move_deleter.asm"
INCLUDE "text/move_relearner.asm"
SECTION "Pokédex Text", ROMX SECTION "Pokédex Text", ROMX

45
text/move_deleter.asm Normal file
View file

@ -0,0 +1,45 @@
_MoveDeleterGreetingText::
text "Mom says I'm so"
line "forgetful that it"
cont "is contagious."
para "Want me to make a"
line "#MON forget a"
cont "move?"
done
_MoveDeleterSaidYesText::
text "Which #MON"
line "should forget a"
cont "move?"
prompt
_MoveDeleterWhichMoveText::
text "Which move should"
line "it forget, then?"
done
_MoveDeleterConfirmText::
text "Make it forget"
line "@"
text_ram wStringBuffer
text "?"
prompt
_MoveDeleterForgotText::
text "@"
text_ram wStringBuffer
text " was"
line "forgotten!"
prompt
_MoveDeleterByeText::
text "Come visit me"
line "again!"
done
_MoveDeleterOneMoveText::
text "That #mon"
line "has one move."
cont "Pick another?"
done

42
text/move_relearner.asm Normal file
View file

@ -0,0 +1,42 @@
_MoveRelearnerGreetingText::
text "I tutor children,"
line "but I also tutor"
cont "#MON."
para "I teach them to"
line "remember moves"
cont "they forgot."
para "¥1000 per lesson."
line "How about it?"
done
_MoveRelearnerSaidYesText::
text "Which #MON"
line "should I tutor?"
prompt
_MoveRelearnerNotEnoughMoneyText::
text "Hmmm..."
para "You don't have"
line "enough money!"
done
_MoveRelearnerWhichMoveText::
text "Which move should"
line "it learn?"
done
_MoveRelearnerByeText::
text "If any of your"
line "#MON need to"
cont "remember a move,"
cont "come visit me!"
done
_MoveRelearnerNoMovesText::
text "This #MON"
line "hasn't forgotten"
cont "any moves."
done