diff options
-rw-r--r-- | Add-different-kinds-of-new-items.md | 25 | ||||
-rw-r--r-- | screenshots/town-map.png | bin | 0 -> 2474 bytes |
2 files changed, 24 insertions, 1 deletions
diff --git a/Add-different-kinds-of-new-items.md b/Add-different-kinds-of-new-items.md index 55b9735..96de0fb 100644 --- a/Add-different-kinds-of-new-items.md +++ b/Add-different-kinds-of-new-items.md @@ -383,7 +383,30 @@ Edit [data/pokemon/evos_attacks.asm](../blob/master/data/pokemon/evos_attacks.as ### `TownMapEffect`: Town Map -TODO +The Town Map was present in Gen 1 but replaced in Gen 2 by the Pokégear's Map Card; however, it still exists in the code. Its `TownMapEffect` implementation is buggy, but can be fixed. + +First, add the essential data. The `TOWN_MAP` item constant already exists, but it needs a proper name, description, and attributes (`0, HELD_NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE`). + +Now fix the effect. Edit [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm): + +```diff + TownMapEffect: ; ee01 +- farcall PokegearMap ++ call FadeToMenu ++ farcall _TownMap ++ call Call_ExitMenu ++ xor a ++ ld [hBGMapMode], a ++ farcall Pack_InitGFX ++ farcall WaitBGMap_DrawPackGFX ++ farcall Pack_InitColors + ret + ; ee08 +``` + +This code is based on how items with `ITEMMENU_PARTY` work, as written in `UseItem.Party` in [engine/items/pack.asm](../blob/master/engine/items/pack.asm). + + ### Held effect: TODO diff --git a/screenshots/town-map.png b/screenshots/town-map.png Binary files differnew file mode 100644 index 0000000..e32fa72 --- /dev/null +++ b/screenshots/town-map.png |