diff options
author | dannye <corrnondacqb@yahoo.com> | 2016-08-08 15:35:13 -0500 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2016-08-08 15:35:13 -0500 |
commit | fe02309fe38d8be4f0a087c63ca7d63cc9cab859 (patch) | |
tree | 6722b75c0cb6e2477e67fb1976a40331ed365546 /engine/menu | |
parent | 33ea880aa4f408624b967d4ab811c477e6a76784 (diff) |
Add Devolve Stoneadding-pokemon
rolls back Pokemon to their pre-evolution without degenerating stats
Diffstat (limited to 'engine/menu')
-rwxr-xr-x | engine/menu/party_menu.asm | 91 | ||||
-rwxr-xr-x | engine/menu/start_sub_menus.asm | 1 |
2 files changed, 92 insertions, 0 deletions
diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index 5988f7e5..000aa613 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -7,6 +7,7 @@ ; 03: learn TM/HM menu ; 04: swap pokemon positions menu ; 05: use evolution stone on pokemon menu +; 06: use devolution stone on pokemon menu ; otherwise, it is a message ID ; f0: poison healed ; f1: burn healed @@ -36,6 +37,16 @@ RedrawPartyMenu_: ld c,a ld [hPartyMonIndex],a ld [wWhichPartyMenuHPBar],a + push hl + push bc + ld hl, wDevolveMons + ld b, 6 +.clearDevolveMons + ld [hli], a + dec b + jr nz, .clearDevolveMons + pop bc + pop hl .loop ld a,[de] cp a,$FF ; reached the terminator? @@ -80,6 +91,8 @@ RedrawPartyMenu_: jr z,.teachMoveMenu cp a,EVO_STONE_PARTY_MENU jr z,.evolutionStoneMenu + cp a,DEVO_STONE_PARTY_MENU + jp z,.devolutionStoneMenu push hl ld bc,14 ; 14 columns to the right add hl,bc @@ -187,6 +200,83 @@ RedrawPartyMenu_: db "ABLE@" .notAbleToEvolveText db "NOT ABLE@" + +.devolutionStoneMenu + push hl + xor a +.loadEvolutionDataLoop + push af + ld hl, EvosMovesPointerTable + ld b, 0 + add a + rl b + ld c, a + add hl, bc + ld de, wcd6d + ld a, BANK(EvosMovesPointerTable) + ld bc, 2 + call FarCopyData + ld hl, wcd6d + ld a, [hli] + ld h, [hl] + ld l, a + ld de, wEvolutionData + ld a, BANK(EvosMovesPointerTable) + ld bc, Mon133_EvosEnd - Mon133_EvosMoves + call FarCopyData + ld hl, wEvolutionData +; loop through the pokemon's evolution entries +.checkDevolutionsLoop + ld a, [hli] + and a ; reached terminator? + jr nz, .keepChecking + pop af + inc a + cp VICTREEBEL + ld de, .notAbleToDevolveText + jr z, .placeDevolutionStoneString + jr .loadEvolutionDataLoop +.keepChecking + inc hl + cp a, EV_ITEM + jr nz, .skipinc + inc hl +.skipinc + ld a, [wWhichPokemon] ; pokemon number + ld c, a + ld b, 0 + ld a, [hli] ; evolved mon id + push hl + ld hl, wPartySpecies + add hl, bc + ld b, a + ld a, [hl] + pop hl + cp b ; does the player's pokemon match this evolution entry's evolution? + jr nz, .checkDevolutionsLoop +; if it does match + ld hl, wDevolveMons + ld a, [wWhichPokemon] + ld e, a + ld d, 0 + add hl, de + pop af + inc a + ld [hl], a + ld de, .ableToDevolveText +.placeDevolutionStoneString + ld bc, SCREEN_WIDTH + 9 ; down 1 row and right 9 columns + pop hl + push hl + add hl, bc + call PlaceString + pop hl + jp .printLevel +.ableToDevolveText + db "ABLE@" +.notAbleToDevolveText + db "NOT ABLE@" + .afterDrawingMonEntries ld b, SET_PAL_PARTY_MENU call RunPaletteCommand @@ -252,6 +342,7 @@ PartyMenuMessagePointers: dw PartyMenuUseTMText dw PartyMenuSwapMonText dw PartyMenuItemUseText + dw PartyMenuItemUseText PartyMenuNormalText: TX_FAR _PartyMenuNormalText diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index d3baeb0e..21833383 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -485,6 +485,7 @@ UsableItems_PartyMenu: db ELIXER db MAX_ELIXER db ICE_STONE + db DEVOLVE_STONE db $ff ; items which close the item menu when used |