summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemy Oukaour <remy.oukaour@gmail.com>2018-05-05 21:43:57 -0400
committerRemy Oukaour <remy.oukaour@gmail.com>2018-05-05 21:43:57 -0400
commitcebf0e6524b36f80e466cee1a6791d6a3db4f8ff (patch)
tree7e70bd31c38a3f986966160614642e14143c83dd
parentbc02c9b76669b24158ed2c1f998e07d9d5a983a5 (diff)
Town Map
-rw-r--r--Add-different-kinds-of-new-items.md25
-rw-r--r--screenshots/town-map.pngbin0 -> 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).
+
+![Screenshot](screenshots/town-map.png)
### Held effect: TODO
diff --git a/screenshots/town-map.png b/screenshots/town-map.png
new file mode 100644
index 0000000..e32fa72
--- /dev/null
+++ b/screenshots/town-map.png
Binary files differ