diff options
-rw-r--r-- | Add-a-new-Pack-pocket.md | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/Add-a-new-Pack-pocket.md b/Add-a-new-Pack-pocket.md index 6041928..4595c3f 100644 --- a/Add-a-new-Pack-pocket.md +++ b/Add-a-new-Pack-pocket.md @@ -13,7 +13,8 @@ This tutorial is for how to add a new Pack pocket. As an example, we'll add a Be 8. [Update standard inventory routines](#8-update-standard-inventory-routines) 9. [Update the Pack engine](#9-update-the-pack-engine) 10. [Update the Crystal-only Pack engine](#10-update-the-crystal-only-pack-engine) -11. [Fix build errors](#11-fix-build-errors) +11. [Update Kurt Apricorn Script](#11-Update-Kurt-Apricorn-Script) +12. [Fix build errors](#12-fix-build-errors) ## 1. Define pocket-related constants @@ -859,8 +860,59 @@ Edit [engine/items/pack_kris.asm](../blob/master/engine/items/pack_kris.asm): This is just like `PackGFXPointers`, but for the Crystal-only girl's Pack. +## 11. Update Kurt Apricorn Script -## 11. Fix build errors +Because we're changing where the Apricorn type items are stored, if we would try to make custom Poke Balls with Kurt right now, the game would glitch up. This is because the game would still look for Apricorns on the Items pocket when they are no longer there. Fixing this is thankfully quick and easy. + +Edit [engine/events/kurt.asm](../blob/master/engine/events/kurt.asm): + +```diff +Kurt_GetQuantityOfApricorn: + push bc +- ld hl, wNumItems ++ ld hl, wNumBerries + ld a, [wCurItem] + +... + +; Initialize the search. + push de + push bc +- ld hl, wNumItems ++ ld hl, wNumBerries + ld a, [wCurItem] + +... + +Kurt_GetAddressOfApricornQuantity: + push hl + push bc +- ld hl, wNumItems ++ ld hl, wNumBerries + inc hl + +... + +Kurt_GetRidOfItem: + push bc +- ld hl, wNumItems ++ ld hl, wNumBerries + ld a, [wCurItemQuantity] + +... + +.okay + push bc +- ld hl, wNumItems ++ ld hl, wNumBerries + ld a, b + +``` +It only takes to replace `wNumItems` for `wNumBerries` throughout the file. With this simple change, whenever you talk to Kurt, the game will look at the correct pocket and will also apply any changes to the number of Apricorns you hold (taking it from your pocket in order to turn them in Balls) as intended. + +Just remember, this step only needs to be made if you change the Apricorn's pocket. + +## 12. Fix build errors We're almost finished, but if you run `make` now, it gives an error: |