diff --git a/README.md b/README.md index 3b49548f..1b148341 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ New areas ==== - 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 area also contains a Trade-back NPC to let you get trade evolutions. - 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. - 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. @@ -67,6 +67,7 @@ Improved areas - 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. - 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. - 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. @@ -151,8 +152,6 @@ Known Bugs ==== - Only portions of spinner tiles animate. - 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 Evolution Methods for new Pokemon @@ -253,6 +252,7 @@ Credits * ZumiIsawhat? - Restorations of beta OST * 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. +* 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! * 大吟醸 (Daiginjo) - Assistance in translating the Tamamushi University Student Book, allowing for an accurate adaptation of the location. diff --git a/data/maps/objects/CeladonUniversityInside.asm b/data/maps/objects/CeladonUniversityInside.asm index 1e39bae8..dc69f1aa 100644 --- a/data/maps/objects/CeladonUniversityInside.asm +++ b/data/maps/objects/CeladonUniversityInside.asm @@ -6,18 +6,19 @@ CeladonUniversityInside_Object: warp_event 11, 19, CELADON_UNIVERSITY_OUTSIDE, 1 def_bg_events - bg_event 9, 3, 10 ; Magikarp - bg_event 19, 4, 11 ; PC Screen + bg_event 9, 3, 11 ; Magikarp + bg_event 19, 4, 12 ; PC Screen def_object_events 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, 3 ; person - object_event 17, 5, SPRITE_POKEDEX, STAY, NONE, 4 ; person - object_event 10, 5, SPRITE_SCIENTIST, STAY, NONE, 5 ; person - object_event 3, 8, SPRITE_PAPER, STAY, NONE, 6 ; Book 1 - object_event 5, 4, SPRITE_PAPER, STAY, NONE, 7 ; Book 2 - object_event 1, 4, SPRITE_PAPER, STAY, NONE, 8 ; Book 3 - object_event 20, 7, SPRITE_MONSTER, STAY, NONE, 9 ; Slowbro + object_event 3, 15, SPRITE_PAPER, STAY, NONE, 2 ; person + object_event 17, 5, SPRITE_POKEDEX, STAY, NONE, 3 ; person + object_event 10, 5, SPRITE_SCIENTIST, STAY, NONE, 4 ; person + object_event 3, 8, SPRITE_PAPER, STAY, NONE, 5 ; Book 1 + object_event 5, 4, SPRITE_PAPER, STAY, NONE, 6 ; Book 2 + object_event 1, 4, SPRITE_PAPER, STAY, NONE, 7 ; Book 3 + object_event 20, 7, SPRITE_MONSTER, STAY, NONE, 8 ; 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 \ No newline at end of file diff --git a/data/maps/objects/CinnabarLabTradeRoom.asm b/data/maps/objects/CinnabarLabTradeRoom.asm index 11702821..4304951c 100644 --- a/data/maps/objects/CinnabarLabTradeRoom.asm +++ b/data/maps/objects/CinnabarLabTradeRoom.asm @@ -11,5 +11,6 @@ CinnabarLabTradeRoom_Object: object_event 3, 2, SPRITE_SUPER_NERD, STAY, DOWN, 1 ; person object_event 1, 4, SPRITE_GRAMPS, STAY, NONE, 2 ; 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 diff --git a/data/pokemon/base_stats/eevee.asm b/data/pokemon/base_stats/eevee.asm index bff0c68c..dc11b9e3 100644 --- a/data/pokemon/base_stats/eevee.asm +++ b/data/pokemon/base_stats/eevee.asm @@ -10,7 +10,7 @@ INCBIN "gfx/pokemon/front/eevee.pic", 0, 1 ; sprite dimensions 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 ; tm/hm learnset diff --git a/data/wild/maps/MtMoon1F.asm b/data/wild/maps/MtMoon1F.asm index 403094db..0ccd87e8 100644 --- a/data/wild/maps/MtMoon1F.asm +++ b/data/wild/maps/MtMoon1F.asm @@ -7,7 +7,7 @@ MtMoon1FWildMons: db 6, BITTYBAT db 10, SANDSHREW db 10, GEODUDE - db 8, PARAS + db 8, PARA db 11, BITTYBAT db 8, CLEFAIRY end_grass_wildmons diff --git a/data/wild/maps/MtMoonB1F.asm b/data/wild/maps/MtMoonB1F.asm index 9bf56d53..e5e7f947 100644 --- a/data/wild/maps/MtMoonB1F.asm +++ b/data/wild/maps/MtMoonB1F.asm @@ -5,7 +5,7 @@ MtMoonB1FWildMons: db 7, GEODUDE db 8, GEODUDE db 9, GEODUDE - db 10, PARAS + db 10, PARA db 10, BITTYBAT db 11, SANDSHREW db 9, CLEFAIRY diff --git a/data/wild/maps/MtMoonB2F.asm b/data/wild/maps/MtMoonB2F.asm index 1e5f32e2..39a751ff 100644 --- a/data/wild/maps/MtMoonB2F.asm +++ b/data/wild/maps/MtMoonB2F.asm @@ -4,7 +4,7 @@ MtMoonB2FWildMons: db 9, GEODUDE db 10, BITTYBAT db 10, GEODUDE - db 11, BITTYBAT + db 11, ZUBAT db 10, PARAS db 12, PARAS db 10, CLEFAIRY diff --git a/data/wild/maps/Route22.asm b/data/wild/maps/Route22.asm index 693a83b7..093b9d48 100644 --- a/data/wild/maps/Route22.asm +++ b/data/wild/maps/Route22.asm @@ -5,7 +5,7 @@ Route22WildMons: db 4, PUDI db 4, NIDORAN_M db 2, RATTATA - db 2, MANKEY + db 4, MANKEY db 3, SPEAROW db 5, MIKON db 3, NIDORAN_F diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 017d21fe..619ffc36 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -682,7 +682,7 @@ SetCursorPositionsFromOptions: TextSpeedOptionData: db 14, TEXT_DELAY_SLOW 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) CheckForPlayerNameInSRAM: diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 7e41d58d..bf2a5d0b 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -510,4 +510,196 @@ WriteMonMoves_ShiftMoveData: Evolution_FlagAction: 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" diff --git a/home/list_menu.asm b/home/list_menu.asm index 154c7eba..09c73154 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -115,7 +115,7 @@ DisplayListMenuIDLoop:: jr nz, .skipMultiplying ; if it's an item menu 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 l, a ld a, [wListPointer + 1] @@ -126,12 +126,17 @@ DisplayListMenuIDLoop:: ld a, [hl] ld [wcf91], a ld a, [wListMenuID] - and a ; PCPOKEMONLISTMENU? + and a ; is it a PC pokemon list? jr z, .pokemonList push hl call GetItemPrice 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 jr nz, .skipGettingQuantity ; if it's an item menu @@ -143,8 +148,6 @@ DisplayListMenuIDLoop:: ld [wd0b5], a ld a, BANK(ItemNames) ld [wPredefBank], a - ld a, ITEM_NAME - ld [wNameListType], a call GetName jr .storeChosenEntry .pokemonList @@ -159,13 +162,14 @@ DisplayListMenuIDLoop:: call GetPartyMonName .storeChosenEntry ; store the menu entry that the player chose and return 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 [wMenuExitMethod], a ld a, [wCurrentMenuItem] ld [wChosenMenuItem], a xor a - ldh [hJoy7], a ; joypad state update flag + ld [hJoy7], a ; joypad state update flag ld hl, wd730 res 6, [hl] ; turn on letter printing delay jp BankswitchBack diff --git a/maps.asm b/maps.asm index db7a4c87..f1bdbf3f 100644 --- a/maps.asm +++ b/maps.asm @@ -1258,6 +1258,8 @@ INCLUDE "scripts/AgathasRoom.asm" INCLUDE "data/maps/objects/AgathasRoom.asm" 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 "scripts/CeladonUniversityOutside.asm" INCLUDE "data/maps/objects/CeladonUniversityOutside.asm" @@ -1267,6 +1269,9 @@ INCLUDE "data/maps/headers/CeladonUniversityInside.asm" INCLUDE "scripts/CeladonUniversityInside.asm" INCLUDE "data/maps/objects/CeladonUniversityInside.asm" 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 "scripts/CinnabarVolcano.asm" diff --git a/ram/wram.asm b/ram/wram.asm index 87f93b36..53f87b4f 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -256,7 +256,7 @@ wMenuWatchMovingOutOfBounds:: db wTradeCenterPointerTableIndex:: db - ds 1 +ds 1 ; destination pointer for text output ; this variable is written to, but is never read from @@ -377,7 +377,15 @@ wSlotMachineSevenAndBarModeChance:: db ds 2 ; ROM back to return to when the player is done with the slot machine 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 NEXTU diff --git a/scripts/CeladonUniversityInside.asm b/scripts/CeladonUniversityInside.asm index 024e459e..e0f119fc 100644 --- a/scripts/CeladonUniversityInside.asm +++ b/scripts/CeladonUniversityInside.asm @@ -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 diff --git a/scripts/CinnabarLabTradeRoom.asm b/scripts/CinnabarLabTradeRoom.asm index 1f8710be..dce927b4 100644 --- a/scripts/CinnabarLabTradeRoom.asm +++ b/scripts/CinnabarLabTradeRoom.asm @@ -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 \ No newline at end of file diff --git a/scripts/move_deleter.asm b/scripts/move_deleter.asm new file mode 100644 index 00000000..f993f58c --- /dev/null +++ b/scripts/move_deleter.asm @@ -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 \ No newline at end of file diff --git a/scripts/move_relearner.asm b/scripts/move_relearner.asm new file mode 100644 index 00000000..3ac26738 --- /dev/null +++ b/scripts/move_relearner.asm @@ -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 diff --git a/text.asm b/text.asm index 5cc04d30..4aa9a2a9 100644 --- a/text.asm +++ b/text.asm @@ -278,6 +278,8 @@ INCLUDE "text/CinnabarVolcano.asm" INCLUDE "text/FarawayIslandOutside.asm" INCLUDE "text/PokemonMansionB2F.asm" INCLUDE "text/ViridianPreGym.asm" +INCLUDE "text/move_deleter.asm" +INCLUDE "text/move_relearner.asm" SECTION "Pokédex Text", ROMX diff --git a/text/move_deleter.asm b/text/move_deleter.asm new file mode 100644 index 00000000..6534f4a3 --- /dev/null +++ b/text/move_deleter.asm @@ -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 \ No newline at end of file diff --git a/text/move_relearner.asm b/text/move_relearner.asm new file mode 100644 index 00000000..4daf9289 --- /dev/null +++ b/text/move_relearner.asm @@ -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 \ No newline at end of file