summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-06-24 22:48:58 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-06-24 22:48:58 -0400
commitcd7e915b044213918291bc9d26ce6f6682405737 (patch)
tree9d8d958b719591e37209bba292b2e2b80bec187b
parent662cd29ce7cd56e419cde80480b656799ed47780 (diff)
Remove address comments
-rw-r--r--Add-a-new-Fairy-type.md15
-rw-r--r--Add-a-new-Mart.md20
-rw-r--r--Add-a-new-Pack-pocket.md82
-rw-r--r--Add-a-new-Pokémon.md24
-rw-r--r--Add-a-new-TM.md2
-rw-r--r--Add-a-new-fishing-rod.md27
-rw-r--r--Add-a-new-map-and-landmark.md12
-rw-r--r--Add-a-new-move-effect.md17
-rw-r--r--Add-a-new-move.md23
-rw-r--r--Add-a-new-music-song.md11
-rw-r--r--Add-a-new-overworld-sprite.md8
-rw-r--r--Add-a-new-party-menu-icon.md12
-rw-r--r--Add-a-new-radio-channel.md2
-rw-r--r--Add-a-new-sprite-movement-behavior.md4
-rw-r--r--Add-a-new-trainer-class.md20
-rw-r--r--Add-a-new-wild-Pokémon-slot.md6
-rw-r--r--Add-different-kinds-of-new-items.md50
-rw-r--r--Allow-map-tiles-to-appear-above-sprites-(so-NPCs-can-walk-behind-tiles)-with-PRIORITY-colors.md4
-rw-r--r--Automatically-reuse-Repel.md21
-rw-r--r--Colored-trainer-card-badges.md9
-rw-r--r--Expand-tilesets-from-192-to-255-tiles.md50
-rw-r--r--Hard-coded-logic.md17
-rw-r--r--Infinitely-reusable-TMs.md25
-rw-r--r--Physical-Special-split.md22
-rw-r--r--Remove-the-25%-failure-chance-for-AI-status-moves.md2
-rw-r--r--Running-Shoes.md5
26 files changed, 191 insertions, 299 deletions
diff --git a/Add-a-new-Fairy-type.md b/Add-a-new-Fairy-type.md
index 57fcdd2..9ae2d25 100644
--- a/Add-a-new-Fairy-type.md
+++ b/Add-a-new-Fairy-type.md
@@ -40,7 +40,7 @@ Edit [constants/type_constants.asm](../blob/master/constants/type_constants.asm)
Edit [data/types/names.asm](../blob/master/data/types/names.asm):
```diff
- TypeNames: ; 5097b
+ TypeNames:
; entries correspond to types (see constants/type_constants.asm)
dw Normal
...
@@ -59,7 +59,7 @@ Edit [data/types/names.asm](../blob/master/data/types/names.asm):
Edit [data/types/type_matchups.asm](../blob/master/data/types/type_matchups.asm):
```diff
- TypeMatchups: ; 34bb1
+ TypeMatchups:
; attacker, defender, *=
db NORMAL, ROCK, NOT_VERY_EFFECTIVE
db NORMAL, STEEL, NOT_VERY_EFFECTIVE
@@ -105,26 +105,24 @@ These tables are used for the Pokédex's type search feature.
Edit [data/types/search_types.asm](../blob/master/data/types/search_types.asm):
```diff
- PokedexTypeSearchConversionTable: ; 410f6
+ PokedexTypeSearchConversionTable:
; entries correspond with PokedexTypeSearchStrings (see data/types/search_strings.asm)
db NORMAL
...
db STEEL
+ db FAIRY
- ; 41107
```
Edit [data/types/search_strings.asm](../blob/master/data/types/search_strings.asm):
```diff
- PokedexTypeSearchStrings: ; 40fe4
+ PokedexTypeSearchStrings:
; entries correspond with PokedexTypeSearchConversionTable (see data/types/search_types.asm)
db " ---- @"
db " NORMAL @"
...
db " STEEL @"
+ db " FAIRY @"
- ; 41086
```
@@ -173,20 +171,19 @@ Edit [constants/item_data_constants.asm](../blob/master/constants/item_data_cons
Edit [data/types/type_boost_items.asm](../blob/master/data/types/type_boost_items.asm):
```diff
- TypeBoostItems: ; 35703
+ TypeBoostItems:
- db HELD_NORMAL_BOOST, NORMAL ; PINK_BOW/POLKADOT_BOW
+ db HELD_NORMAL_BOOST, NORMAL ; PINK_BOW
...
db HELD_STEEL_BOOST, STEEL ; METAL_COAT
+ db HELD_FAIRY_BOOST, FAIRY ; POLKADOT_BOW
db -1
- ; 35726
```
Edit [data/items/attributes.asm](../blob/master/data/items/attributes.asm):
```diff
- ItemAttributes: ; 67c1
+ ItemAttributes:
; entries correspond to constants/item_constants.asm
...
; POLKADOT_BOW
diff --git a/Add-a-new-Mart.md b/Add-a-new-Mart.md
index cd6e22d..3ac5c20 100644
--- a/Add-a-new-Mart.md
+++ b/Add-a-new-Mart.md
@@ -40,7 +40,7 @@ Edit [constants/mart_constants.asm](../blob/master/constants/mart_constants.asm)
Edit [data/items/marts.asm](../blob/master/data/items/marts.asm):
```diff
- Marts: ; 160a9
+ Marts:
; entries correspond to MART_* constants
dw MartCherrygrove
dw MartCherrygroveDex
@@ -58,11 +58,10 @@ Edit [data/items/marts.asm](../blob/master/data/items/marts.asm):
dw MartGoldenrod5F4
...
.End
- ; 160ed
...
- MartGoldenrod3F: ; 1612b
+ MartGoldenrod3F:
db 7 ; # items
db X_SPEED
db X_SPECIAL
@@ -72,7 +71,6 @@ Edit [data/items/marts.asm](../blob/master/data/items/marts.asm):
db GUARD_SPEC
db X_ACCURACY
db -1 ; end
- ; 16134
+
+MartGoldenrod3F2:
+ db 6 ; # items
@@ -159,7 +157,7 @@ Edit [constants/mart_constants.asm](../blob/master/constants/mart_constants.asm)
Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
```diff
- OpenMartDialog:: ; 15a45
+ OpenMartDialog::
...
.dialogs
@@ -169,11 +167,10 @@ Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
dw Pharmacist
dw RooftopSale
+ dw ShadyShop
- ; 15a61
...
- Pharmacist: ; 15aae
+ Pharmacist:
call FarReadMart
call LoadStandardMenuHeader
ld hl, Text_Pharmacist_Intro
@@ -182,7 +179,6 @@ Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
ld hl, Text_Pharmacist_ComeAgain
call MartTextBox
ret
- ; 15ac4
+
+ShadyShop:
+ call FarReadMart
@@ -196,21 +192,20 @@ Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
...
- GetMartDialogGroup: ; 15ca3
+ GetMartDialogGroup:
...
- .MartTextFunctionPointers: ; 15cb0
+ .MartTextFunctionPointers:
dwb .StandardMartPointers, 0
dwb .HerbShopPointers, 0
dwb .BargainShopPointers, 1
dwb .PharmacyPointers, 0
dwb .StandardMartPointers, 2
+ dwb .ShadyPointers, 0
- ; 15cbf
...
- .PharmacyPointers: ; 15ce3
+ .PharmacyPointers:
dw Text_Pharmacy_HowMany
dw Text_Pharmacy_CostsThisMuch
dw Text_Pharmacy_InsufficientFunds
@@ -225,7 +220,6 @@ Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
+ dw Text_ShadyShop_BagFull
+ dw Text_ShadyShop_HereYouGo
+ dw BuyMenuLoop
- ; 15cef
...
+
diff --git a/Add-a-new-Pack-pocket.md b/Add-a-new-Pack-pocket.md
index 97efc9b..4b3f0ff 100644
--- a/Add-a-new-Pack-pocket.md
+++ b/Add-a-new-Pack-pocket.md
@@ -202,7 +202,7 @@ As the `.InitList` comment explains, this "loads 0 in the count and −1 in the
Edit [engine/menus/start_menu.asm](../blob/master/engine/menus/start_menu.asm):
```diff
- HasNoItems: ; 129d5
+ HasNoItems:
ld a, [wNumItems]
and a
ret nz
@@ -272,10 +272,10 @@ Edit [engine/items/items.asm](../blob/master/engine/items/items.asm). Four routi
Edit `_ReceiveItem`:
```diff
- _ReceiveItem:: ; d1d5
+ _ReceiveItem::
...
- .Pockets: ; d1e9
+ .Pockets:
; entries correspond to item types
dw .Item
dw .KeyItem
@@ -285,7 +285,7 @@ Edit `_ReceiveItem`:
...
- .Ball: ; d1fb
+ .Ball:
ld hl, wNumBalls
jp PutItemInPocket
+
@@ -297,7 +297,7 @@ Edit `_ReceiveItem`:
Edit `_TossItem`:
```diff
- _TossItem:: ; d20d
+ _TossItem::
...
.Pockets:
@@ -308,7 +308,7 @@ Edit `_TossItem`:
dw .TMHM
+ dw .Berry
- .Ball: ; d228
+ .Ball:
ld hl, wNumBalls
jp RemoveItemFromPocket
+
@@ -320,7 +320,7 @@ Edit `_TossItem`:
Edit `_CheckItem`:
```diff
- _CheckItem:: ; d244
+ _CheckItem::
...
.Pockets:
@@ -331,7 +331,7 @@ Edit `_CheckItem`:
dw .TMHM
+ dw .Berry
- .Ball: ; d25f
+ .Ball:
ld hl, wNumBalls
jp CheckTheItem
+
@@ -343,7 +343,7 @@ Edit `_CheckItem`:
And edit `GetPocketCapacity`:
```diff
- GetPocketCapacity: ; d283
+ GetPocketCapacity:
ld c, MAX_ITEMS
ld a, e
cp LOW(wNumItems)
@@ -405,10 +405,10 @@ These are jumptable indexes. Jumptables are a common design pattern you'll see f
Notice the pattern to this table: for each pocket, there's a `PACKSTATE_INIT*POCKET` state followed by a `PACKSTATE_*POCKETMENU` state. They happen to be in the same order as the `*_POCKET` constants, although that isn't actually significant; all that matters is that the default pocket be the first one (since the `PACKSTATE_INITGFX` state increments `wJumptableIndex` and advances to the next state, which should thus be the default pocket's `INIT` state).
```diff
- Pack: ; 10000
+ Pack:
...
- .Jumptable: ; 10030 (4:4030)
+ .Jumptable:
; entries correspond to PACKSTATE_* constants
dw .InitGFX ; 0
dw .InitItemsPocket ; 1
@@ -428,7 +428,7 @@ Notice the pattern to this table: for each pocket, there's a `PACKSTATE_INIT*POC
Here's the first jumptable corresponding to those constants. It's the "core" jumptable for when you enter the Pack via the Start Menu.
```diff
- .KeyItemsPocketMenu: ; 100a6 (4:40a6)
+ .KeyItemsPocketMenu:
...
- ld b, PACKSTATE_INITBALLSPOCKET ; left
+ ld b, PACKSTATE_INITBERRYPOCKET ; left
@@ -440,7 +440,7 @@ Here's the first jumptable corresponding to those constants. It's the "core" jum
...
- .InitBallsPocket: ; 10186 (4:4186)
+ .InitBallsPocket:
ld a, BALL_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -449,7 +449,7 @@ Here's the first jumptable corresponding to those constants. It's the "core" jum
call Pack_JumptableNext
ret
- .BallsPocketMenu: ; 10198 (4:4198)
+ .BallsPocketMenu:
ld hl, BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
@@ -505,10 +505,10 @@ One, we insert the Berry pocket in-between the Ball and Key Item pockets. Origin
Two, we actually write the subroutines that we just added pointers to in the jumptable. Really they're just copy+pasted from the Ball pocket's subroutines, but with "Berry" substituted for "Ball". (As we discussed earlier, the Ball pocket is safe to use as a base, since it stores regular items and isn't a default like the Items pocket.)
```diff
- BattlePack: ; 10493
+ BattlePack:
...
- .Jumptable: ; 104c3 (4:44c3)
+ .Jumptable:
; entries correspond to PACKSTATE_* constants
dw .InitGFX ; 0
dw .InitItemsPocket ; 1
@@ -528,7 +528,7 @@ Two, we actually write the subroutines that we just added pointers to in the jum
This is another jumptable, but for using the Pack during battle. Again, we add pointers for the Berry pocket, and will next have to define them.
```diff
- .KeyItemsPocketMenu: ; 10539 (4:4539)
+ .KeyItemsPocketMenu:
...
- ld b, PACKSTATE_INITBALLSPOCKET ; left
+ ld b, PACKSTATE_INITBERRYPOCKET ; left
@@ -540,7 +540,7 @@ This is another jumptable, but for using the Pack during battle. Again, we add p
...
- .InitBallsPocket: ; 10594 (4:4594)
+ .InitBallsPocket:
ld a, BALL_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -549,7 +549,7 @@ This is another jumptable, but for using the Pack during battle. Again, we add p
call Pack_JumptableNext
ret
- .BallsPocketMenu: ; 105a6 (4:45a6)
+ .BallsPocketMenu:
ld hl, BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
@@ -601,10 +601,10 @@ This is another jumptable, but for using the Pack during battle. Again, we add p
Just like before, we insert the Berry pocket between the Ball and Key Item pockets, and base the Berry pocket's subroutines on the pre-existing Ball pocket ones.
```diff
- DepositSellPack: ; 106be
+ DepositSellPack:
...
- .Jumptable: ; 106d1 (4:46d1)
+ .Jumptable:
; entries correspond to *_POCKET constants
dw .ItemsPocket
dw .BallsPocket
@@ -614,7 +614,7 @@ Just like before, we insert the Berry pocket between the Ball and Key Item pocke
...
- .BallsPocket: ; 1073b (4:473b)
+ .BallsPocket:
ld a, BALL_POCKET
call InitPocket
ld hl, PC_Mart_BallsPocketMenuHeader
@@ -686,10 +686,10 @@ Here's a jumptable for when the Pack is opened to deposit or sell an item; it ha
This is somewhat tricky to notice. Here the code is decrementing or incrementing `wJumptableIndex` (that is, subtracting or adding 1) when you press Left or Right. But doing that can go beyond the valid range, since it might decrement the minimum or increment the maximum. When there were only four pockets, they neatly took up two bits, so a bitmask could be used to efficiently clamp them within the valid range. But five pockets requires more explicit checks so that the minimum and maximum values (0 and `NUM_POCKETS` − 1) wrap around.
```diff
- TutorialPack: ; 107bb
+ TutorialPack:
...
- .dw ; 107e1 (4:47e1)
+ .dw
; entries correspond to *_POCKET constants
dw .Items
dw .Balls
@@ -699,20 +699,18 @@ This is somewhat tricky to notice. Here the code is decrementing or incrementing
...
- .Balls: ; 1083b (4:483b)
+ .Balls:
ld a, BALL_POCKET
ld hl, .BallsMenuHeader
jr .DisplayPocket
- ; 10842 (4:4842)
- .BallsMenuHeader: ; 0x10842
+ .BallsMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
dw .BallsMenuData
db 1 ; default option
- ; 0x1084a
- .BallsMenuData: ; 0x1084a
+ .BallsMenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -720,7 +718,6 @@ This is somewhat tricky to notice. Here the code is decrementing or incrementing
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
- ; 1085a
+
+.Berries:
+ ld a, BERRY_POCKET
@@ -732,7 +729,6 @@ This is somewhat tricky to notice. Here the code is decrementing or incrementing
+ menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
+ dw .BerriesMenuData
+ db 1 ; default option
-+; 0x107f7
+
+.BerriesMenuData:
+ db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
@@ -747,19 +743,18 @@ This is somewhat tricky to notice. Here the code is decrementing or incrementing
Another jumptable, this time used by the catch tutorial dude. Once again, we just add an entry to the jumptable for the Berry pocket and base its code and data on whatever the Ball pocket does.
```diff
- PackGFXPointers: ; 108cc
+ PackGFXPointers:
dw PackGFX + (15 tiles) * 1 ; ITEM_POCKET
dw PackGFX + (15 tiles) * 3 ; BALL_POCKET
dw PackGFX + (15 tiles) * 0 ; KEY_ITEM_POCKET
dw PackGFX + (15 tiles) * 2 ; TM_HM_POCKET
+ dw PackGFX + (15 tiles) * 4 ; BERRY_POCKET
- ; 108d4
```
This is a table of pointers to the individual highlighted pocket pictures in pack.png and pack_f.png. Remember how they were out of order compared to the constants? That's why this table is necessary. For example, the first (#0) picture was of the Key Item pocket, and `KEY_ITEM_POCKET` is 2, so the third (#2) entry here points to the first picture. Anyway, all we have to do is add a pointer for the Berry pocket again.
```diff
- .tilemap ; 109e1
+ .tilemap
; ITEM_POCKET
db $00, $04, $04, $04, $01 ; top border
db $06, $07, $08, $09, $0a ; Items
@@ -780,20 +775,18 @@ This is a table of pointers to the individual highlighted pocket pictures in pac
+ db $00, $04, $04, $04, $01 ; top border
+ db $1a, $1b, $1c, $1d, $1e ; Berries
+ db $02, $05, $05, $05, $03 ; bottom border
- ; 10a1d
```
These are tilemaps for the pocket name labels in pack_menu.png. Each one is three rows of five tiles each, with tile indexes starting at 0. Take a look at pack_menu.png and notice how the hexadecimal indexes here correspond to tiles that form sensible pictures.
```diff
- BallsPocketMenuHeader: ; 0x10aaf
+ BallsPocketMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
dw .MenuData
db 1 ; default option
- ; 0x10ab7
- .MenuData: ; 0x10ab7
+ .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -801,16 +794,14 @@ These are tilemaps for the pocket name labels in pack_menu.png. Each one is thre
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
- ; 10ac7
- PC_Mart_BallsPocketMenuHeader: ; 0x10ac7
+ PC_Mart_BallsPocketMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
dw .MenuData
db 1 ; default option
- ; 0x10acf
- .MenuData: ; 0x10acf
+ .MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
@@ -818,7 +809,6 @@ These are tilemaps for the pocket name labels in pack_menu.png. Each one is thre
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
- ; 10adf
+
+BerryPocketMenuHeader:
+ db MENU_BACKUP_TILES ; flags
@@ -859,7 +849,7 @@ We saw `BallsPocketMenuHeader` used in the subroutines for the Start Menu Pack a
Edit [engine/items/pack_kris.asm](../blob/master/engine/items/pack_kris.asm):
```diff
- PackFGFXPointers: ; 48e93
+ PackFGFXPointers:
dw PackFGFX + (15 tiles) * 1 ; ITEM_POCKET
dw PackFGFX + (15 tiles) * 3 ; BALL_POCKET
dw PackFGFX + (15 tiles) * 0 ; KEY_ITEM_POCKET
@@ -883,10 +873,10 @@ Line 1243 of [engine/items/pack.asm](../blob/master/engine/items/pack.asm) is `j
So, `jr` and `jp` both jump to the given label. But `jp` encodes the full two-byte address of the label, while `jr` saves a byte by encoding a one-byte distance to jump. That means it can only reach −128 to 127 bytes away from its own location. Some of the code we added must have made `.DisplayPocket` more than 128 bytes away from this `jr` instruction. Anyway, the solution is simple: change it to `jp`.
```diff
- TutorialPack: ; 107bb
+ TutorialPack:
...
- .Items: ; 107e9 (4:47e9)
+ .Items:
xor a ; ITEM_POCKET
ld hl, .ItemsMenuHeader
- jr .DisplayPocket
diff --git a/Add-a-new-Pokémon.md b/Add-a-new-Pokémon.md
index cefc1c8..afff4d6 100644
--- a/Add-a-new-Pokémon.md
+++ b/Add-a-new-Pokémon.md
@@ -163,12 +163,11 @@ Then edit [data/pokemon/base_stats.asm](../blob/master/data/pokemon/base_stats.a
Edit [data/pokemon/evos_attacks_pointers.asm](../blob/master/data/pokemon/evos_attacks_pointers.asm):
```diff
- EvosAttacksPointers:: ; 0x425b1
+ EvosAttacksPointers::
dw BulbasaurEvosAttacks
...
dw CelebiEvosAttacks
+ dw MunchlaxEvosAttacks
- ; 0x427a7
```
Then edit [data/pokemon/evos_attacks.asm](../blob/master/data/pokemon/evos_attacks.asm):
@@ -218,7 +217,7 @@ Note that the order of the `EvosAttacksPointers` matters, since the entries pair
Edit [data/pokemon/egg_move_pointers.asm](../blob/master/data/pokemon/egg_move_pointers.asm):
```diff
- EggMovePointers:: ; 0x23b11
+ EggMovePointers::
dw BulbasaurEggMoves
...
dw AerodactylEggMoves
@@ -228,7 +227,6 @@ Edit [data/pokemon/egg_move_pointers.asm](../blob/master/data/pokemon/egg_move_p
...
dw NoEggMoves
+ dw MunchlaxEggMoves
- ; 0x23d07
```
Then edit [data/pokemon/egg_moves.asm](../blob/master/data/pokemon/egg_moves.asm):
@@ -251,7 +249,7 @@ Note that since Snorlax will now lay Munchlax eggs, it doesn't need Egg moves of
Edit [data/pokemon/cries.asm](../blob/master/data/pokemon/cries.asm):
```diff
- PokemonCries:: ; f2787
+ PokemonCries::
; entries correspond to constants/pokemon_constants.asm
mon_cry CRY_BULBASAUR, $080, $081 ; BULBASAUR
...
@@ -271,12 +269,11 @@ The three values passed to `mon_cry` are a cry index, a pitch, and a length. Def
Edit [data/pokemon/menu_icons.asm](../blob/master/data/pokemon/menu_icons.asm):
```diff
- MonMenuIcons: ; 8eac4
+ MonMenuIcons:
db ICON_BULBASAUR ; BULBASAUR
...
db ICON_HUMANSHAPE ; CELEBI
+ db ICON_SNORLAX ; MUNCHLAX
- ; 8ebbf
```
Valid icons are in [constants/icon_constants.asm](../blob/master/constants/icon_constants.asm). They're used in the party menu and Day-Care.
@@ -306,13 +303,12 @@ Create **data/pokemon/dex_entries/munchlax.asm**:
Edit [data/pokemon/dex_entry_pointers.asm](../blob/master/data/pokemon/dex_entry_pointers.asm):
```diff
- PokedexDataPointerTable: ; 0x44378
+ PokedexDataPointerTable:
; entries correspond to constants/pokemon_constants.asm
dw BulbasaurPokedexEntry
...
dw CelebiPokedexEntry
+ dw MunchlaxPokedexEntry
- ; 0x4456e
```
Then edit [data/pokemon/dex_entries.asm](../blob/master/data/pokemon/dex_entries.asm):
@@ -334,7 +330,7 @@ Now the Pokédex entry exists, and will be listed correctly in "Old Pokédex Mod
Edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new.asm):
```diff
- NewPokedexOrder: ; 0x40d60
+ NewPokedexOrder:
db CHIKORITA
...
db AERODACTYL
@@ -343,13 +339,12 @@ Edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new.
db BULBASAUR
...
db CELEBI
- ; 0x40e5b
```
Then edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new.asm):
```diff
- AlphabeticalPokedexOrder: ; 0x40c65
+ AlphabeticalPokedexOrder:
db ABRA
...
db MUK
@@ -357,7 +352,6 @@ Then edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order
db MURKROW
...
db ZUBAT
- ; 0x40d60
```
That's all for the Pokédex.
@@ -516,7 +510,7 @@ Edit [gfx/pics.asm](../blob/master/gfx/pics.asm):
Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.asm):
```diff
- PokemonPalettes: ; a8ce
+ PokemonPalettes:
; entries correspond to Pokémon species, two apiece
; 000
@@ -557,8 +551,6 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as
; 255 shiny
RGB 23, 23, 23
RGB 17, 17, 17
-
- ; b0ce
```
Edit [gfx/pokemon/anim_pointers.asm](../blob/master/gfx/pokemon/anim_pointers.asm):
diff --git a/Add-a-new-TM.md b/Add-a-new-TM.md
index 7e3fdb0..bf153df 100644
--- a/Add-a-new-TM.md
+++ b/Add-a-new-TM.md
@@ -93,7 +93,7 @@ Notice how the `ItemNames` and `ItemAttributes` both already had the maximum 256
Edit [data/moves/tmhm_moves.asm](../blob/master/data/moves/tmhm_moves.asm):
```diff
- TMHMMoves: ; 1167a
+ TMHMMoves:
; entries correspond to *_TMNUM enums (see constants/item_constants.asm)
; TMs
db DYNAMICPUNCH
diff --git a/Add-a-new-fishing-rod.md b/Add-a-new-fishing-rod.md
index 6f9d023..8d45219 100644
--- a/Add-a-new-fishing-rod.md
+++ b/Add-a-new-fishing-rod.md
@@ -19,7 +19,7 @@ Follow [the tutorial to add a new item](Add-different-kinds-of-new-items) to cre
Edit [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm):
```diff
- ItemEffects: ; e73c
+ ItemEffects:
; entries correspond to item ids
dw PokeBallEffect ; MASTER_BALL
...
@@ -29,33 +29,28 @@ Edit [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.as
dw NoEffect ; ITEM_88
...
dw NoEffect ; ITEM_B3
- ; e8a2
...
- OldRodEffect: ; f5a5
+ OldRodEffect:
ld e, $0
jr UseRod
- ; f5a9
- GoodRodEffect: ; f5a9
+ GoodRodEffect:
ld e, $1
jr UseRod
- ; f5ad
- SuperRodEffect: ; f5ad
+ SuperRodEffect:
ld e, $2
jr UseRod
- ; f5b1
+
+MasterRodEffect:
+ ld e, $3
+ jr UseRod
- UseRod: ; f5b1
+ UseRod:
farcall FishFunction
ret
- ; f5b8
```
Pretty simple; we just observe how the other three Rods work, and follow their pattern.
@@ -76,7 +71,7 @@ Edit [data/wild/fish.asm](../blob/master/data/wild/fish.asm):
+ dw \2, \3, \4, \5
ENDM
- FishGroups: ; 92488
+ FishGroups:
; entries correspond to FISHGROUP_* constants
- fishgroup 50 percent + 1, .Shore_Old, .Shore_Good, .Shore_Super
- ...
@@ -87,21 +82,20 @@ Edit [data/wild/fish.asm](../blob/master/data/wild/fish.asm):
...
- .Remoraid_Old: ; 9264e
+ .Remoraid_Old:
db 70 percent + 1, MAGIKARP, 10
db 85 percent + 1, MAGIKARP, 10
db 100 percent, POLIWAG, 10
- .Remoraid_Good: ; 92657
+ .Remoraid_Good:
db 35 percent, MAGIKARP, 20
db 70 percent, POLIWAG, 20
db 90 percent + 1, POLIWAG, 20
db 100 percent, time_group 6
- .Remoraid_Super: ; 92663
+ .Remoraid_Super:
db 40 percent, POLIWAG, 40
db 70 percent, time_group 7
db 90 percent + 1, MAGIKARP, 40
db 100 percent, REMORAID, 40
- ; 9266f
+
+.Shore_Master:
+.Ocean_Master:
@@ -160,7 +154,7 @@ Edit [constants/pokemon_data_constants.asm](../blob/master/constants/pokemon_dat
If you're using an older copy of pokecrystal and `FISHGROUP_DATA_LENGTH` does not exist, then edit [engine/events/fish.asm](../blob/master/engine/events/fish.asm) instead:
```diff
- Fish: ; 92402
+ Fish:
; Using a fishing rod.
; Fish for monsters with rod e in encounter group d.
; Return monster e at level d.
@@ -183,7 +177,6 @@ If you're using an older copy of pokecrystal and `FISHGROUP_DATA_LENGTH` does no
pop bc
pop af
ret
- ; 9241a
```
Either way, this allows the `FishGroups` table to be indexed by Rods from 0 to 3, instead of 0 to 2. (Remember how we defined `MasterRodEffect`.)
diff --git a/Add-a-new-map-and-landmark.md b/Add-a-new-map-and-landmark.md
index 28d1378..f6855e1 100644
--- a/Add-a-new-map-and-landmark.md
+++ b/Add-a-new-map-and-landmark.md
@@ -118,7 +118,7 @@ The roof type controls which nine roof tiles get used. This only applies to maps
Edit [data/maps/roofs.asm](../blob/master/data/maps/roofs.asm):
```diff
- MapGroupRoofs: ; 1c021i
+ MapGroupRoofs:
; entries correspond to map groups
; values are indexes for Roofs (see below)
db -1 ; 0
@@ -126,7 +126,6 @@ Edit [data/maps/roofs.asm](../blob/master/data/maps/roofs.asm):
...
db ROOF_NEW_BARK ; 26 (Cherrygrove)
+ db ROOF_GOLDENROD ; 27 (Global Terminal)
- ; 1c03c
```
Roof tiles, like all graphics, are only loaded when you warp to a map. Walking across map connections, like from Route 34 to Goldenrod City, will not reload graphics. So if two maps are connected, even if they're in different groups, their roof types have to match. We're going to connect the Global Terminal to Goldenrod City's west edge later, so it has to use the same roof type.
@@ -170,18 +169,17 @@ The outdoor sprite set is the set of sprites it's possible to use in outdoor map
Edit [data/maps/outdoor_sprites.asm](../blob/master/data/maps/outdoor_sprites.asm):
```diff
- OutdoorSprites: ; 144b8
+ OutdoorSprites:
; entries correspond to map groups
dw OlivineGroupSprites
...
dw CherrygroveGroupSprites
+ dw GlobalTerminalSprites
- ; 144ec
...
+GlobalTerminalSprites:
- GoldenrodGroupSprites: ; 14673
+ GoldenrodGroupSprites:
db SPRITE_SUICUNE
db SPRITE_SILVER_TROPHY
db SPRITE_POKE_BALL
@@ -205,7 +203,6 @@ Edit [data/maps/outdoor_sprites.asm](../blob/master/data/maps/outdoor_sprites.as
db SPRITE_DAY_CARE_MON_2
db SPRITE_FRUIT_TREE
db SPRITE_SLOWPOKE
- ; 1468a
```
The Global Terminal is going to be connected to the west edge of Goldenrod City, so they'll have to have identical sprite sets; to save space, they can literally use the same data. Note that, for instance, `OlivineGroupSprites` and `CianwoodGroupSprites` are two different sets but have identical contents, since you can Surf from Olivine City to Cianwood City.
@@ -350,7 +347,7 @@ The Town Map will cycle through landmarks in their constant order.
Now edit [data/maps/landmarks.asm](../blob/master/data/maps/landmarks.asm):
```diff
- Landmarks: ; 0x1ca8c3
+ Landmarks:
; entries correspond to constants/landmark_constants.asm
landmark 0, 0, SpecialMapName
...
@@ -359,7 +356,6 @@ Now edit [data/maps/landmarks.asm](../blob/master/data/maps/landmarks.asm):
landmark 60, 92, Route35Name
...
landmark 148, 132, FastShipName
- ; 0x1caa43
NewBarkTownName: db "NEW BARK¯TOWN@"
...
diff --git a/Add-a-new-move-effect.md b/Add-a-new-move-effect.md
index 5b813e7..d85731e 100644
--- a/Add-a-new-move-effect.md
+++ b/Add-a-new-move-effect.md
@@ -39,7 +39,7 @@ If you want to be save space, there are six `UNUSED` effects you can replace, in
Edit [data/moves/effects_pointers.asm](../blob/master/data/moves/effects_pointers.asm):
```diff
- MoveEffectsPointers: ; 271f4
+ MoveEffectsPointers:
; entries correspond to EFFECT_* constants
dw NormalHit
...
@@ -100,13 +100,12 @@ You can replace `effect0x3c` or `effect0x5d` before adding to the end of the lis
Anyway, edit [data/battle/effect_command_pointers.asm](../blob/master/data/battle/effect_command_pointers.asm):
```diff
- BattleCommandPointers: ; 3fd28
+ BattleCommandPointers:
; entries correspond to macros/scripts/battle_commands.asm
- dw BattleCommand_CheckTurn ; 34084
+ dw BattleCommand_CheckTurn
...
- dw BattleCommand_Curl ; 365a7
+ dw BattleCommand_Curl
+ dw BattleCommand_Hex
- ; 3fe86
```
Create **engine/battle/move_effects/hex.asm**:
@@ -131,7 +130,7 @@ And edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect
+
+INCLUDE "engine/battle/move_effects/hex.asm"
- BattleCommand_DoubleFlyingDamage: ; 36f25
+ BattleCommand_DoubleFlyingDamage:
; doubleflyingdamage
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVar
@@ -154,7 +153,7 @@ First, look at the tables of moves and effects in [data/battle/ai](../tree/maste
Next, we'll teach `AI_SMART` to take advantage of `EFFECT_HEX` when the player has a status condition. Edit [engine/battle/ai/scoring.asm](../blob/master/engine/battle/ai/scoring.asm):
```diff
- AI_Smart: ; 386be
+ AI_Smart:
; Context-specific scoring.
...
@@ -165,11 +164,10 @@ Next, we'll teach `AI_SMART` to take advantage of `EFFECT_HEX` when the player h
dbw EFFECT_FLY, AI_Smart_Fly
+ dbw EFFECT_HEX, AI_Smart_Hex
db -1 ; end
- ; 387e3
...
- AI_Smart_DefrostOpponent: ; 38ccb
+ AI_Smart_DefrostOpponent:
; Greatly encourage this move if enemy is frozen.
; No move has EFFECT_DEFROST_OPPONENT, so this layer is unused.
@@ -180,7 +178,6 @@ Next, we'll teach `AI_SMART` to take advantage of `EFFECT_HEX` when the player h
dec [hl]
dec [hl]
ret
- ; 38cd5
+
+AI_Smart_Hex:
+; Greatly encourage this move if the player has a status condition.
diff --git a/Add-a-new-move.md b/Add-a-new-move.md
index 757fdc9..6178550 100644
--- a/Add-a-new-move.md
+++ b/Add-a-new-move.md
@@ -58,7 +58,7 @@ A name can be up to 12 characters long, plus a "@" at the end.
Now edit [data/moves/descriptions.asm](../blob/master/data/moves/descriptions.asm):
```diff
- MoveDescriptions:: ; 2cb52
+ MoveDescriptions::
; entries correspond to move ids (see constants/move_constants.asm)
dw PoundDescription
...
@@ -69,7 +69,6 @@ Now edit [data/moves/descriptions.asm](../blob/master/data/moves/descriptions.as
dw MoveFEDescription
dw MoveFFDescription
dw Move00Description
- ; 2cd52
-MoveFCDescription:
MoveFDDescription:
@@ -87,7 +86,6 @@ Now edit [data/moves/descriptions.asm](../blob/master/data/moves/descriptions.as
+NastyPlotDescription:
+ db "Sharply increases"
+ next "user's SPCL.ATK.@"
- ; 2ed44
```
A description has two lines, each with up to 18 characters, plus a "@" at the end.
@@ -98,7 +96,7 @@ A description has two lines, each with up to 18 characters, plus a "@" at the en
Edit [data/moves/moves.asm](../blob/master/data/moves/moves.asm):
```diff
- Moves: ; 41afb
+ Moves:
; entries correspond to constants/move_constants.asm
move POUND, EFFECT_NORMAL_HIT, 40, NORMAL, 100, 35, 0
...
@@ -122,7 +120,7 @@ The `move` defines these properties:
Edit [data/moves/animations.asm](../blob/master/data/moves/animations.asm):
```diff
- BattleAnimations:: ; c906f
+ BattleAnimations::
; entries correspond to constants/move_constants.asm
dw BattleAnim_0
dw BattleAnim_Pound
@@ -136,20 +134,18 @@ Edit [data/moves/animations.asm](../blob/master/data/moves/animations.asm):
; $100
dw BattleAnim_ThrowPokeBall
...
- ; c929b
- BattleAnim_0: ; c929b
--BattleAnim_252: ; c929b
- BattleAnim_253: ; c929b
- BattleAnim_254: ; c929b
- BattleAnim_MirrorMove: ; c929b
+ BattleAnim_0:
+-BattleAnim_252:
+ BattleAnim_253:
+ BattleAnim_254:
+ BattleAnim_MirrorMove:
anim_ret
- ; c929c
...
+BattleAnim_NastyPlot:
-BattleAnim_PsychUp: ; cb917
+BattleAnim_PsychUp:
anim_1gfx ANIM_GFX_STATUS
anim_call BattleAnim_FollowEnemyFeet_0
anim_bgeffect ANIM_BG_1A, $0, $1, $20
@@ -163,7 +159,6 @@ BattleAnim_PsychUp: ; cb917
anim_call BattleAnim_ShowMon_0
anim_wait 16
anim_ret
-; cb940
```
Designing a new animation is beyond the scope of this tutorial. They require careful placement and timing of different elements, and the scripting system used to do this is [poorly understood](../blob/master/docs/battle_anim_commands.md). Here we're just reusing Psych Up's animation for Nasty Plot, since it looks appropriate.
diff --git a/Add-a-new-music-song.md b/Add-a-new-music-song.md
index 41410f9..eab81a7 100644
--- a/Add-a-new-music-song.md
+++ b/Add-a-new-music-song.md
@@ -61,19 +61,18 @@ Edit [audio/music_pointers.asm](../blob/master/audio/music_pointers.asm):
```diff
; See song sections in audio.asm.
- Music: ; e906e
+ Music:
; entries correspond to MUSIC_* constants
- dba Music_Nothing ; 0xe91a3
+ dba Music_Nothing
...
- dba Music_PostCredits ; 0xcfd9e
+ dba Music_PostCredits
; Crystal adds the following songs:
- dba Music_Clair ; 0x1fa8d
+ dba Music_Clair
...
- dba Music_MobileCenter ; 0x17961d
- ; e91a3
+ dba Music_MobileCenter
+ dba Music_Route47
```
diff --git a/Add-a-new-overworld-sprite.md b/Add-a-new-overworld-sprite.md
index 3270de3..e3e209e 100644
--- a/Add-a-new-overworld-sprite.md
+++ b/Add-a-new-overworld-sprite.md
@@ -84,7 +84,7 @@ It doesn't matter where new sprite graphics go, so you can add them in the exist
Finally, edit [data/sprites/sprites.asm](../blob/master/data/sprites/sprites.asm):
```diff
- OverworldSprites: ; 14736
+ OverworldSprites:
; entries correspond to SPRITE_* constants
overworld_sprite ChrisSpriteGFX, 12, WALKING_SPRITE, PAL_OW_RED
...
@@ -107,13 +107,12 @@ Note that `BigSnorlaxSpriteGFX`, `BigLaprasSpriteGFX`, and `BigOnixSpriteGFX` do
Edit [data/sprites/sprite_mons.asm](../blob/master/data/sprites/sprite_mons.asm):
```diff
- SpriteMons: ; 14495
+ SpriteMons:
; entries correspond to SPRITE_* constants past SPRITE_POKEMON
db UNOWN
...
db HO_OH
+ db EGG
- ; 144b8
```
This means that `SPRITE_EGG` will use the same menu icon as `EGG`, just like `SPRITE_UNOWN` uses the icon for `UNOWN`, etc.
@@ -121,14 +120,13 @@ This means that `SPRITE_EGG` will use the same menu icon as `EGG`, just like `SP
There's one problem: `EGG` doesn't actually *have* a defined menu icon, since the party menu code treats Eggs as a special case. So edit [data/pokemon/menu_icons.asm](../blob/master/data/pokemon/menu_icons.asm):
```diff
- MonMenuIcons: ; 8eac4
+ MonMenuIcons:
db ICON_BULBASAUR ; BULBASAUR
...
db ICON_HUMANSHAPE ; CELEBI
+ db ICON_MONSTER ; MON_FC
+ db ICON_EGG ; EGG
+ db ICON_MONSTER ; MON_FE
- ; 8ebbf
```
Now `EGG` (and the two unused Pokémon slots) has its menu icon defined in the usual way, so `SPRITE_EGG` will appear correctly.
diff --git a/Add-a-new-party-menu-icon.md b/Add-a-new-party-menu-icon.md
index 5b9cca6..6fac8f8 100644
--- a/Add-a-new-party-menu-icon.md
+++ b/Add-a-new-party-menu-icon.md
@@ -55,9 +55,9 @@ And edit [gfx/icons.asm](../blob/master/gfx/icons.asm):
```diff
Icons:
NullIcon:
- PoliwagIcon: INCBIN "gfx/icons/poliwag.2bpp" ; 0x8ec0d
+ PoliwagIcon: INCBIN "gfx/icons/poliwag.2bpp"
...
- BigmonIcon: INCBIN "gfx/icons/bigmon.2bpp" ; 0x8fe8d
+ BigmonIcon: INCBIN "gfx/icons/bigmon.2bpp"
+CelebiIcon: INCBIN "gfx/icons/celebi.2bpp"
```
@@ -67,7 +67,7 @@ And edit [gfx/icons.asm](../blob/master/gfx/icons.asm):
Edit [data/pokemon/menu_icons.asm](../blob/master/data/pokemon/menu_icons.asm):
```diff
- MonMenuIcons: ; 8eac4
+ MonMenuIcons:
...
- db ICON_HUMANSHAPE ; CELEBI
+ db ICON_CELEBI ; CELEBI
@@ -122,7 +122,7 @@ One section, "Mon Icons 1", contains icons #1 to #128. The next, "Mon Icons 2",
Now edit [engine/gfx/mon_icons.asm](../blob/master/engine/gfx/mon_icons.asm):
```diff
- LoadOverworldMonIcon: ; 8e82b
+ LoadOverworldMonIcon:
ld a, e
+ push af
call ReadMonMenuIcon
@@ -139,11 +139,10 @@ Now edit [engine/gfx/mon_icons.asm](../blob/master/engine/gfx/mon_icons.asm):
+ pop af
+ call GetIconBank
ret
- ; 8e83f
...
- GetIcon: ; 8ea1e
+ GetIcon:
; Load icon graphics into VRAM starting from tile hl.
...
@@ -154,7 +153,6 @@ Now edit [engine/gfx/mon_icons.asm](../blob/master/engine/gfx/mon_icons.asm):
pop hl
ret
- ; 8ea3f
+
+GetIconBank:
+ lb bc, BANK("Mon Icons 1"), 8
diff --git a/Add-a-new-radio-channel.md b/Add-a-new-radio-channel.md
index 0a15f95..557e329 100644
--- a/Add-a-new-radio-channel.md
+++ b/Add-a-new-radio-channel.md
@@ -115,7 +115,7 @@ Anyway, we haven't defined `LoadStation_NationalPark`, so let's do that next.
Continue to edit [engine/pokegear/pokegear.asm](../blob/master/engine/pokegear/pokegear.asm):
```diff
- LoadStation_UnownRadio: ; 917d5 (24:57d5)
+ LoadStation_UnownRadio:
ld a, UNOWN_RADIO
ld [wCurrentRadioLine], a
xor a
diff --git a/Add-a-new-sprite-movement-behavior.md b/Add-a-new-sprite-movement-behavior.md
index c18ea6f..d774964 100644
--- a/Add-a-new-sprite-movement-behavior.md
+++ b/Add-a-new-sprite-movement-behavior.md
@@ -27,7 +27,7 @@ Edit [constants/map_object_constants.asm](../blob/master/constants/map_object_co
And edit [data/sprites/map_objects.asm](../blob/master/data/sprites/map_objects.asm):
```diff
- SpriteMovementData:: ; 4273
+ SpriteMovementData::
; entries correspond to SPRITEMOVEDATA_* constants
; SPRITEMOVEDATA_00
@@ -62,8 +62,6 @@ And edit [data/sprites/map_objects.asm](../blob/master/data/sprites/map_objects.
+ db 0 ; flags1
+ db 0 ; flags2
+ db SWIMMING ; palette flags
-
- ; 4357
```
Note that we had to delete some unused data at the bottom which didn't correspond to any `SPRITEMOVEDATA_*` constant.
diff --git a/Add-a-new-trainer-class.md b/Add-a-new-trainer-class.md
index 9adc64c..da1eabd 100644
--- a/Add-a-new-trainer-class.md
+++ b/Add-a-new-trainer-class.md
@@ -65,7 +65,7 @@ Next we'll add data for the new `PARASOL_LADY` class to all those tables mention
Edit [data/trainers/class_names.asm](../blob/master/data/trainers/class_names.asm):
```diff
- TrainerClassNames:: ; 2c1ef
+ TrainerClassNames::
; entries correspond to trainer classes (see constants/trainer_constants.asm)
db "LEADER@"
...
@@ -81,7 +81,7 @@ A name can be up to 12 characters long, plus a "@" at the end. Note that the tra
Edit [data/trainers/attributes.asm](../blob/master/data/trainers/attributes.asm):
```diff
- TrainerClassAttributes: ; 3959c
+ TrainerClassAttributes:
; entries correspond to trainer classes (see constants/trainer_constants.asm)
; Falkner
@@ -103,8 +103,6 @@ Edit [data/trainers/attributes.asm](../blob/master/data/trainers/attributes.asm)
+ db 10 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
-
- ; 39771
```
"Attributes" encompass a number of different properties:
@@ -142,14 +140,13 @@ Edit [data/trainers/attributes.asm](../blob/master/data/trainers/attributes.asm)
Edit [data/trainers/dvs.asm](../blob/master/data/trainers/dvs.asm):
```diff
- TrainerClassDVs: ; 270d6
+ TrainerClassDVs:
; entries correspond to trainer classes (see constants/trainer_constants.asm)
; atk,def,spd,spc
dn 9, 10, 7, 7 ; FALKNER
...
dn 9, 8, 8, 8 ; MYSTICALMAN
+ dn 7, 8, 8, 8 ; parasol lady
- ; 2715c
```
The four numbers define, in order, the Attack, Defense, Speed, and Special DVs for all the trainer class's Pokémon. Each DV can be from 0 to 15. (Remember, in Gen 2 there was one DV for both Special Attack and Special Defense; and bits from all four DVs were combined to calculate HP.)
@@ -221,7 +218,7 @@ Edit [gfx/pics.asm](../blob/master/gfx/pics.asm):
Anyway, edit [data/trainers/palettes.asm](../blob/master/data/trainers/palettes.asm):
```diff
- TrainerPalettes: ; b0ce
+ TrainerPalettes:
; entries correspond to trainer classes
PlayerPalette: ; Chris uses the same colors as Cal
@@ -231,7 +228,6 @@ Anyway, edit [data/trainers/palettes.asm](../blob/master/data/trainers/palettes.
...
INCLUDE "gfx/trainers/mysticalman.pal"
+INCLUDE "gfx/trainers/parasol_lady.pal"
- ; b1de
```
parasol_lady.2bpp.lz and parasol_lady.pal will be automatically generated from parasol_lady.png when you run `make`.
@@ -242,7 +238,7 @@ parasol_lady.2bpp.lz and parasol_lady.pal will be automatically generated from p
Edit [data/trainers/party_pointers.asm](../blob/master/data/trainers/party_pointers.asm):
```diff
- TrainerGroups: ; 0x39999
+ TrainerGroups:
; entries correspond to trainer classes (see constants/trainer_constants.asm)
dw FalknerGroup
...
@@ -315,14 +311,13 @@ Notice that there was no sprite for `MYSTICALMAN`, so we had to add one so that
Anyway, edit [data/trainers/genders.asm](../blob/master/data/trainers/genders.asm):
```diff
- BTTrainerClassGenders: ; 11f2f0
+ BTTrainerClassGenders:
; entries correspond to trainer classes
db MALE ; FALKNER
...
db FEMALE ; GRUNTF
+ db MALE ; MYSTICALMAN
+ db FEMALE ; PARASOL_LADY
- ; 11f332
```
Again, we had to add data for `MYSTICALMAN` to reach the slot for `PARASOL_LADY`.
@@ -330,7 +325,7 @@ Again, we had to add data for `MYSTICALMAN` to reach the slot for `PARASOL_LADY`
Also edit [data/trainers/gendered_trainers.asm](../blob/master/data/trainers/gendered_trainers.asm):
```diff
- FemaleTrainers: ; 4e976
+ FemaleTrainers:
db MEDIUM
db LASS
db BEAUTY
@@ -391,7 +386,6 @@ Edit [gfx/pics.asm](../blob/master/gfx/pics.asm) again:
RaichuFrontpic: INCBIN "gfx/pokemon/raichu/front.animated.2bpp.lz"
PrimeapeFrontpic: INCBIN "gfx/pokemon/primeape/front.animated.2bpp.lz"
-OmastarBackpic: INCBIN "gfx/pokemon/omastar/back.2bpp.lz"
- ; 12bffe
...
diff --git a/Add-a-new-wild-Pokémon-slot.md b/Add-a-new-wild-Pokémon-slot.md
index 7ef1025..47c4217 100644
--- a/Add-a-new-wild-Pokémon-slot.md
+++ b/Add-a-new-wild-Pokémon-slot.md
@@ -27,7 +27,7 @@ If you've seen the [data/wild/\*.asm](../tree/master/data/wild/) files before, i
Edit [data/wild/probabilities.asm](../blob/master/data/wild/probabilities.asm):
```diff
- GrassMonProbTable: ; 2a1cb
+ GrassMonProbTable:
mon_prob 30, 0 ; 30% chance
mon_prob 60, 1 ; 30% chance
mon_prob 80, 2 ; 20% chance
@@ -39,16 +39,14 @@ Edit [data/wild/probabilities.asm](../blob/master/data/wild/probabilities.asm):
+ mon_prob 97, 5 ; 3% chance
+ mon_prob 99, 6 ; 2% chance
+ mon_prob 100, 7 ; 1% chance
- ; 2a1d9
- WaterMonProbTable: ; 2a1d9
+ WaterMonProbTable:
mon_prob 60, 0 ; 60% chance
- mon_prob 90, 1 ; 30% chance
- mon_prob 100, 2 ; 10% chance
+ mon_prob 80, 1 ; 20% chance
+ mon_prob 95, 2 ; 15% chance
+ mon_prob 100, 3 ; 5% chance
- ; 2a1df
```
These are just the cumulative probabilities for each possible slot.
diff --git a/Add-different-kinds-of-new-items.md b/Add-different-kinds-of-new-items.md
index 26264b0..d179c11 100644
--- a/Add-different-kinds-of-new-items.md
+++ b/Add-different-kinds-of-new-items.md
@@ -130,7 +130,7 @@ Edit [data/items/item_effects.asm](../blob/master/data/items/item_effects.asm):
And last, edit [data/items/catch_rate_items.asm](../blob/master/data/items/catch_rate_items.asm):
```diff
- TimeCapsule_CatchRateItems: ; 28785
+ TimeCapsule_CatchRateItems:
- db ITEM_19, LEFTOVERS
```
@@ -154,13 +154,12 @@ Then it's time to implement the specific HP healing amount for Sweet Heart. Noti
Edit [data/items/heal_hp.asm](../blob/master/data/items/heal_hp.asm):
```diff
- HealingHPAmounts: ; f3af
+ HealingHPAmounts:
dbw FRESH_WATER, 50
...
dbw BERRY_JUICE, 20
+ dbw SWEET_HEART, 20
dbw -1, 0 ; end
-; f3df
```
`HealingHPAmounts` is used by `GetHealingItemAmount`, which is called by `ItemRestoreHP`, which is called by `RestoreHPEffect`, which is the effect we already assigned to Sweet Heart; so now it will successfully heal 20 HP when used by the player.
@@ -168,24 +167,22 @@ Edit [data/items/heal_hp.asm](../blob/master/data/items/heal_hp.asm):
Now edit [engine/battle/ai/items.asm](../blob/master/engine/battle/ai/items.asm):
```diff
- AI_Items: ; 39196
+ AI_Items:
dbw FULL_RESTORE, .FullRestore
...
dbw X_SPECIAL, .XSpecial
+ dbw SWEET_HEART, .SweetHeart
db -1 ; end
- ; 381be
...
- .Potion: ; 382a0
+ .Potion:
call .HealItem
jp c, .DontUse
ld b, 20
call EnemyUsedPotion
jp .Use
- ; 382ae
-
++
+.SweetHeart:
+ call .HealItem
+ jp c, .DontUse
@@ -195,11 +192,11 @@ Now edit [engine/battle/ai/items.asm](../blob/master/engine/battle/ai/items.asm)
...
- EnemyUsedPotion: ; 383e8
+ EnemyUsedPotion:
ld a, POTION
ld b, 20
jr EnemyPotionContinue
-
++
+EnemyUsedSweetHeart:
+ ld a, SWEET_HEART
+ ld b, 20
@@ -220,14 +217,13 @@ First, add the essential data. Replace `ITEM_32` with `LAVA_COOKIE`; give it a n
Then it's time to implement the specific status-healing effect. Edit [data/items/heal_status.asm](../blob/master/data/items/heal_status.asm):
```diff
- StatusHealingActions: ; f071
+ StatusHealingActions:
; item, party menu action text, status
db ANTIDOTE, PARTYMENUTEXT_HEAL_PSN, 1 << PSN
...
db MIRACLEBERRY, PARTYMENUTEXT_HEAL_ALL, %11111111
+ db LAVA_COOKIE, PARTYMENUTEXT_HEAL_ALL, %11111111
db -1, 0, 0 ; end
- ; f09e
```
`%11111111` is a bit mask for all status conditions, but that particular value is checked for by `HealStatus` to allow healing confusion as well. A different value, like `1 << PSN` or `(1 << BRN) | (1 << FRZ)`, could be used to heal only certain conditions.
@@ -237,21 +233,19 @@ Then it's time to implement the specific status-healing effect. Edit [data/items
Now edit [engine/battle/ai/items.asm](../blob/master/engine/battle/ai/items.asm):
```diff
- AI_Items: ; 39196
+ AI_Items:
dbw FULL_RESTORE, .FullRestore
...
dbw X_SPECIAL, .XSpecial
+ dbw LAVA_COOKIE, .LavaCookie
db -1 ; end
- ; 381be
- .FullHeal: ; 381be
+ .FullHeal:
call .Status
jp c, .DontUse
call EnemyUsedFullHeal
jp .Use
- ; 381ca
-
++
+.LavaCookie:
+ call .Status
+ jp c, .DontUse
@@ -260,12 +254,12 @@ Now edit [engine/battle/ai/items.asm](../blob/master/engine/battle/ai/items.asm)
...
- EnemyUsedFullHeal: ; 383a3 (e:43a3)
+ EnemyUsedFullHeal:
call AIUsedItemSound
call AI_HealStatus
ld a, FULL_HEAL
jp PrintText_UsedItemOn_AND_AIUpdateHUD
-
++
+EnemyUsedLavaCookie:
+ call AIUsedItemSound
+ call AI_HealStatus
@@ -287,13 +281,12 @@ First, add the essential data. Replace `ITEM_5A` with `DUSK_BALL`; give it a nam
A piece of data specific to Poké Balls is what color they are when thrown in battle. Edit [data/battle_anims/ball_colors.asm](../blob/master/data/battle_anims/ball_colors.asm):
```diff
- BallColors: ; cd26c (33:526c)
+ BallColors:
db MASTER_BALL, PAL_BATTLE_OB_GREEN
...
db LOVE_BALL, PAL_BATTLE_OB_RED
+ db DUSK_BALL, PAL_BATTLE_OB_GREEN
db -1, PAL_BATTLE_OB_GRAY
- ; cd284
```
Then it's time to implement the specific Pokémon-catching effect. Edit [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm) again:
@@ -391,7 +384,7 @@ First, add the essential data. The `TOWN_MAP` item constant already exists, but
Now fix the effect. Edit [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm):
```diff
- TownMapEffect: ; ee01
+ TownMapEffect:
- farcall PokegearMap
+ call FadeToMenu
+ farcall _TownMap
@@ -402,7 +395,6 @@ Now fix the effect. Edit [engine/items/item_effects.asm](../blob/master/engine/i
+ 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).
@@ -435,11 +427,9 @@ Eviolite's effect is pretty similar to Metal Powder, which boosts Ditto's defens
Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm):
```diff
- DittoMetalPowder: ; 352b1
+ DittoMetalPowder:
...
- ; 352dc
-
+UnevolvedEviolite:
+; get the defender's species
+ ld a, MON_SPECIES
@@ -498,7 +488,7 @@ Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/ef
+ rr c
+ ret
- PlayerAttackDamage: ; 352e2
+ PlayerAttackDamage:
; Return move power d, player level e, enemy defense c and player attack b.
...
@@ -512,11 +502,9 @@ Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/ef
and a
ret
- ; 3534d
-
...
- EnemyAttackDamage: ; 353f6
+ EnemyAttackDamage:
...
ld a, [wEnemyMonLevel]
@@ -527,8 +515,6 @@ Anyway, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/ef
ld a, 1
and a
ret
-
- ; 35461
```
The implementation of `UnevolvedEviolite` is very similar to `DittoMetalPowder`, except the simple check for whether the species is `DITTO` has been replaced by a check for evolutions, similar to the check in `MoonBallMultiplier` in [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm). (Also, instead of checking whether `[hl]` is `EVIOLITE`, we check whether `b` is `HELD_EVIOLITE`; either would be fine, since `GetOpponentItem` returns "the effect of the opponent's item in `bc`, and its id at `hl`", as explained in a comment.) `bc` gets repeatedly saved on the stack with `push` and `pop` because it contains the defense stat, and we don't want the various pre-boost checks to corrupt the original value.
diff --git a/Allow-map-tiles-to-appear-above-sprites-(so-NPCs-can-walk-behind-tiles)-with-PRIORITY-colors.md b/Allow-map-tiles-to-appear-above-sprites-(so-NPCs-can-walk-behind-tiles)-with-PRIORITY-colors.md
index 49850f3..2644ef4 100644
--- a/Allow-map-tiles-to-appear-above-sprites-(so-NPCs-can-walk-behind-tiles)-with-PRIORITY-colors.md
+++ b/Allow-map-tiles-to-appear-above-sprites-(so-NPCs-can-walk-behind-tiles)-with-PRIORITY-colors.md
@@ -135,7 +135,7 @@ Since we don't specify a bank for "Tileset Palettes" in [pokecrystal.link](../bl
Edit [engine/tilesets/map_palettes.asm](../blob/master/engine/tilesets/map_palettes.asm):
```diff
- SwapTextboxPalettes:: ; 4c000
+ SwapTextboxPalettes::
hlcoord 0, 0
decoord 0, 0, wAttrMap
ld b, SCREEN_HEIGHT
@@ -182,7 +182,7 @@ Edit [engine/tilesets/map_palettes.asm](../blob/master/engine/tilesets/map_palet
jr nz, .loop
ret
- ScrollBGMapPalettes:: ; 4c03f
+ ScrollBGMapPalettes::
ld hl, wBGMapBuffer
ld de, wBGMapPalBuffer
+ ; fallthrough
diff --git a/Automatically-reuse-Repel.md b/Automatically-reuse-Repel.md
index 3ac6972..ccc5b8a 100644
--- a/Automatically-reuse-Repel.md
+++ b/Automatically-reuse-Repel.md
@@ -40,21 +40,18 @@ We need to add a `wRepelType` byte that works the same way. It's just one byte s
The file that defines item effects is, predictably, [engine/items/item_effects.asm](../blob/master/engine/items/item_effects.asm). It turns out that Repel, Super Repel, and Max Repel all use the same code, so we don't have to write anything three times.
```diff
- SuperRepelEffect: ; f462
+ SuperRepelEffect:
ld b, 200
jr UseRepel
- ; f466
- MaxRepelEffect: ; f466
+ MaxRepelEffect:
ld b, 250
jr UseRepel
- ; f466
- RepelEffect: ; f46a
+ RepelEffect:
ld b, 100
- ; f46c
- UseRepel: ; f46c
+ UseRepel:
ld a, [wRepelEffect]
and a
ld hl, TextJump_RepelUsedEarlierIsStillInEffect
@@ -67,11 +64,10 @@ The file that defines item effects is, predictably, [engine/items/item_effects.a
jp UseItemText
- TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d
+ TextJump_RepelUsedEarlierIsStillInEffect:
; The REPEL used earlier is still in effect.
text_jump Text_RepelUsedEarlierIsStillInEffect
db "@"
- ; 0xf482
```
@@ -80,7 +76,7 @@ The file that defines item effects is, predictably, [engine/items/item_effects.a
Edit [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm):
```diff
- DoRepelStep: ; 96bd7
+ DoRepelStep:
ld a, [wRepelEffect]
and a
ret z
@@ -102,7 +98,6 @@ Edit [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm):
call CallScript
scf
ret
- ; 96beb
```
Note that `UseAnotherRepelScript` hasn't been defined yet, so we'll do that next.
@@ -113,14 +108,14 @@ Note that `UseAnotherRepelScript` hasn't been defined yet, so we'll do that next
Edit [engine/events/misc_scripts_2.asm](../blob/master/engine/events/misc_scripts_2.asm):
```diff
- RepelWoreOffScript:: ; 0x13619
+ RepelWoreOffScript::
opentext
writetext .text
waitbutton
closetext
end
- .text ; 0x13620
+ .text
; REPEL's effect wore off.
text_jump UnknownText_0x1bd308
db "@"
diff --git a/Colored-trainer-card-badges.md b/Colored-trainer-card-badges.md
index 3199241..c27c6a2 100644
--- a/Colored-trainer-card-badges.md
+++ b/Colored-trainer-card-badges.md
@@ -30,7 +30,7 @@ Create **gfx/trainer_card/badges.pal**:
Edit [engine/gfx/cgb_layouts.asm](../blob/master/engine/gfx/cgb_layouts.asm):
```diff
- _CGB_TrainerCard: ; 9289
+ _CGB_TrainerCard:
...
- ld a, PREDEFPAL_CGB_BADGE
- call GetPredefPal
@@ -39,11 +39,10 @@ Edit [engine/gfx/cgb_layouts.asm](../blob/master/engine/gfx/cgb_layouts.asm):
+ ld bc, 8 palettes
+ ld a, BANK(wOBPals1)
+ call FarCopyWRAM
-
+
...
ret
- ; 9373
-
++
+.BadgePalettes:
+INCLUDE "gfx/trainer_card/badges.pal"
```
@@ -54,7 +53,7 @@ Edit [engine/gfx/cgb_layouts.asm](../blob/master/engine/gfx/cgb_layouts.asm):
Edit [engine/menus/trainer_card.asm](../blob/master/engine/menus/trainer_card.asm):
```diff
- TrainerCard_JohtoBadgesOAM: ; 254c9
+ TrainerCard_JohtoBadgesOAM:
; Template OAM data for each badge on the trainer card.
; Format:
; y, x, palette
diff --git a/Expand-tilesets-from-192-to-255-tiles.md b/Expand-tilesets-from-192-to-255-tiles.md
index 9953020..4102e69 100644
--- a/Expand-tilesets-from-192-to-255-tiles.md
+++ b/Expand-tilesets-from-192-to-255-tiles.md
@@ -176,7 +176,7 @@ Edit [charmap.asm](../blob/master/charmap.asm):
Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
```diff
- _LoadStandardFont:: ; fb449
+ _LoadStandardFont::
- ld de, Font
- ld hl, vTiles1
- lb bc, BANK(Font), 128 ; "A" to "9"
@@ -203,9 +203,8 @@ Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
lb bc, BANK(Font), 32 ; "'" to "9"
call Get1bpp_2
ret
- ; fb48a
- _LoadFontsExtra1:: ; fb48a
+ _LoadFontsExtra1::
- ld de, FontsExtra_SolidBlackGFX
- ld hl, vTiles2 tile "■" ; $60
- lb bc, BANK(FontsExtra_SolidBlackGFX), 1
@@ -219,20 +218,18 @@ Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
- lb bc, BANK(FontExtra), 22 ; "<BOLD_D>" to "ぉ"
- call Get2bpp_2
jr LoadFrame
- ; fb4b0
- _LoadFontsExtra2:: ; fb4b0
+ _LoadFontsExtra2::
- ld de, FontsExtra2_UpArrowGFX
- ld hl, vTiles2 tile "▲" ; $61
- ld b, BANK(FontsExtra2_UpArrowGFX)
- ld c, 1
- call Get2bpp_2
ret
- ; fb4be
...
- LoadFrame: ; fb4cc
+ LoadFrame:
ld a, [wTextBoxFrame]
maskbits NUM_FRAMES
ld bc, 6 * LEN_1BPP_TILE
@@ -249,13 +246,12 @@ Edit [engine/gfx/load_font.asm](../blob/master/engine/gfx/load_font.asm):
lb bc, BANK(TextBoxSpaceGFX), 1
call Get1bpp_2
ret
- ; fb4f2
```
And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm):
```diff
- Function106464:: ; 106464
+ Function106464::
- ld de, FontsExtra_SolidBlackGFX
- ld hl, vTiles2 tile "■" ; $60
- lb bc, BANK(FontsExtra_SolidBlackGFX), 1
@@ -275,9 +271,8 @@ And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm):
call Get2bpp
farcall LoadFrame
ret
- ; 10649b
- Function10649b: ; 10649b
+ Function10649b:
ld a, [wTextBoxFrame]
maskbits NUM_FRAMES
ld bc, 6 * LEN_1BPP_TILE
@@ -296,7 +291,6 @@ And edit [mobile/mobile_41.asm](../blob/master/mobile/mobile_41.asm):
ld b, BANK(TextBoxSpaceGFX)
call Function1064c3
ret
- ; 1064c3
```
@@ -312,21 +306,18 @@ Edit [gfx/font.asm](../blob/master/gfx/font.asm):
...
--PokegearPhoneIconGFX: ; f8f24
+-PokegearPhoneIconGFX:
-INCBIN "gfx/font/phone_icon.2bpp"
--; f8f34
...
--FontsExtra_SolidBlackGFX: ; f9214
+-FontsExtra_SolidBlackGFX:
-INCBIN "gfx/font/black.1bpp"
--; f921c
...
--FontsExtra2_UpArrowGFX: ; f9424
+-FontsExtra2_UpArrowGFX:
-INCBIN "gfx/font/up_arrow.2bpp"
--; f9434
```
This is not strictly necessary, but it will save space in the ROM, and avoid confusion from wondering why changes to those files don't affect the game.
@@ -337,7 +328,7 @@ This is not strictly necessary, but it will save space in the ROM, and avoid con
Edit [home/map.asm](../blob/master/home/map.asm).
```diff
- LoadTilesetGFX:: ; 2821
+ LoadTilesetGFX::
...
ld a, e
@@ -435,7 +426,7 @@ By default, sprites will disappear when they're behind (on top of) tiles $60–$
Edit [engine/overworld/map_objects.asm](../blob/master/engine/overworld/map_objects.asm):
```diff
- Function56cd: ; 56cd:
+ Function56cd:
...
ld a, [hUsedSpriteIndex]
add d
@@ -479,7 +470,7 @@ Edit [engine/menus/naming_screen.asm](../blob/master/engine/menus/naming_screen.
-NAMINGSCREEN_UNDERLINE EQUS "\"<DOT>\"" ; $f2
+NAMINGSCREEN_UNDERLINE EQUS "\"☎\"" ; $d9
- LoadNamingScreenGFX: ; 11c51
+ LoadNamingScreenGFX:
...
- ld de, vTiles2 tile NAMINGSCREEN_BORDER
@@ -498,27 +489,25 @@ Edit [engine/events/map_name_sign.asm](../blob/master/engine/events/map_name_sig
...
- LoadMapNameSignGFX: ; b80c6
+ LoadMapNameSignGFX:
ld de, MapEntryFrameGFX
- ld hl, vTiles2 tile MAP_NAME_SIGN_START
+ ld hl, vTiles0 tile MAP_NAME_SIGN_START
lb bc, BANK(MapEntryFrameGFX), 14
call Get2bpp
ret
- ; b80d3
```
Edit [engine/events/magikarp.asm](../blob/master/engine/events/magikarp.asm):
```diff
- Magikarp_LoadFeetInchesChars: ; fbbae
+ Magikarp_LoadFeetInchesChars:
- ld hl, vTiles2 tile "′" ; $6e
+ ld hl, vTiles0 tile "′" ; $da
ld de, .feetinchchars
lb bc, BANK(.feetinchchars), 2
call Request2bpp
ret
- ; fbbbb
```
Edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.asm):
@@ -528,7 +517,7 @@ Edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.asm)
...
- HOF_AnimatePlayerPic: ; 86810
+ HOF_AnimatePlayerPic:
call ClearBGPalettes
- ld hl, vTiles2 tile HALLOFFAME_COLON
- ld de, FontExtra + 13 tiles ; "<COLON>"
@@ -552,7 +541,7 @@ Edit [engine/events/halloffame.asm](../blob/master/engine/events/halloffame.asm)
Edit [engine/pokemon/correct_nick_errors.asm](../blob/master/engine/pokemon/correct_nick_errors.asm):
```diff
- .textcommands ; 66cf
+ .textcommands
; table defining which characters are actually text commands
; format:
; ≥ <
@@ -570,10 +559,10 @@ Edit [engine/pokemon/correct_nick_errors.asm](../blob/master/engine/pokemon/corr
And edit [engine/link/link_2.asm](../blob/master/engine/link/link_2.asm) (this was already done for pokecrystal as of July 2018):
```diff
- LinkTextbox2: ; 4d35b
+ LinkTextbox2:
...
- .PlaceBorder: ; 4d37e
+ .PlaceBorder:
push hl
ld a, $76
ld [hli], a
@@ -608,9 +597,8 @@ And edit [engine/link/link_2.asm](../blob/master/engine/link/link_2.asm) (this w
- ld [hl], "└"
+ ld [hl], $7d
ret
- ; 4d3ab
- .PlaceRow: ; 4d3ab
+ .PlaceRow:
ld d, c
.row_loop
ld [hli], a
diff --git a/Hard-coded-logic.md b/Hard-coded-logic.md
index a7997b9..c83ccf8 100644
--- a/Hard-coded-logic.md
+++ b/Hard-coded-logic.md
@@ -40,7 +40,7 @@ This is caused by `LoadTilesetGFX` in [home/map.asm](../blob/master/home/map.asm
This is caused by `ReturnFromMapSetupScript.CheckSpecialMap` in [engine/events/map_name_sign.asm](../blob/master/engine/events/map_name_sign.asm):
```asm
-.CheckSpecialMap: ; b8070
+.CheckSpecialMap:
; These landmarks do not get pop-up signs.
cp -1
ret z
@@ -59,7 +59,6 @@ This is caused by `ReturnFromMapSetupScript.CheckSpecialMap` in [engine/events/m
ld a, 1
and a
ret
-; b8089
```
@@ -89,17 +88,17 @@ There's no "outdoor-within-indoor" map environment, so the few maps in this situ
This is caused by `PokegearMap_KantoMap` and `PokegearMap_JohtoMap` in [engine/pokegear/pokegear.asm](../blob/master/engine/pokegear/pokegear.asm):
```asm
-PokegearMap_KantoMap: ; 90fe9 (24:4fe9)
+PokegearMap_KantoMap:
call TownMap_GetKantoLandmarkLimits
jr PokegearMap_ContinueMap
-PokegearMap_JohtoMap: ; 90fee (24:4fee)
+PokegearMap_JohtoMap:
ld d, SILVER_CAVE
ld e, NEW_BARK_TOWN
-PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
+PokegearMap_ContinueMap:
...
-TownMap_GetKantoLandmarkLimits: ; 910e8
+TownMap_GetKantoLandmarkLimits:
ld a, [wStatusFlags]
bit STATUSFLAGS_HALL_OF_FAME_F, a
jr z, .not_hof
@@ -138,7 +137,7 @@ If a map's music ID in [data/maps/maps.asm](../blob/master/data/maps/maps.asm) i
This is caused by `GetMapMusic` in [home/map.asm](../blob/master/home/map.asm):
```asm
-GetMapMusic:: ; 2cbd
+GetMapMusic::
push hl
push bc
ld de, MAP_MUSIC
@@ -181,7 +180,6 @@ GetMapMusic:: ; 2cbd
.clearedmahogany
ld de, MUSIC_CHERRYGROVE_CITY
jr .done
-; 2cff
```
This can cause problems if you add too many new songs, or rearrange the existing ones. A solution would be to redefine the special music constants in [constants/music_constants.asm](../blob/master/constants/music_constants.asm):
@@ -199,7 +197,7 @@ ENTER_MAP_MUSIC EQU $ff
And then edit `GetMapMusic`:
```asm
-GetMapMusic:: ; 2cbd
+GetMapMusic::
push hl
push bc
ld de, MAP_MUSIC
@@ -238,7 +236,6 @@ GetMapMusic:: ; 2cbd
.clearedmahogany
ld de, MUSIC_CHERRYGROVE_CITY
jr .done
-; 2cff
```
You'll also need to edit [data/maps/maps.asm](../blob/master/data/maps/maps.asm) so the Radio Tower maps use `MUSIC_RADIO_TOWER` instead of `RADIO_TOWER_MUSIC | MUSIC_GOLDENROD_CITY`.
diff --git a/Infinitely-reusable-TMs.md b/Infinitely-reusable-TMs.md
index ce77e12..7e5ce93 100644
--- a/Infinitely-reusable-TMs.md
+++ b/Infinitely-reusable-TMs.md
@@ -32,7 +32,7 @@ Edit [engine/items/tmhm.asm](../blob/master/engine/items/tmhm.asm):
...
--ConsumeTM: ; 2cb0c (b:4b0c)
+-ConsumeTM:
- call ConvertCurItemIntoCurTMHM
- ld a, [wd265]
- dec a
@@ -129,7 +129,7 @@ If you didn't know how to do this, you could get away with just not selling TMs
Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
```diff
- MartAskPurchaseQuantity: ; 15c91
+ MartAskPurchaseQuantity:
+ ld a, [wCurItem]
+ cp TM01
+ jr nc, .PurchaseQuantityOfTM
@@ -142,7 +142,6 @@ Edit [engine/items/mart.asm](../blob/master/engine/items/mart.asm):
cp 1
jp z, BargainShopAskPurchaseQuantity
jp RooftopSaleAskPurchaseQuantity
-; 15ca3
+
+.PurchaseQuantityOfTM:
+ push de
@@ -437,34 +436,31 @@ Finally, edit [data/items/marts.asm](../blob/master/data/items/marts.asm):
+ dw MartGoldenrod5F
...
--MartGoldenrod5F1: ; 1613b
-+MartGoldenrod5F: ; 1613b
+-MartGoldenrod5F1:
++MartGoldenrod5F:
db 3 ; # items
db TM_THUNDERPUNCH
db TM_FIRE_PUNCH
db TM_ICE_PUNCH
db -1 ; end
- ; 16140
-
--MartGoldenrod5F2: ; 16140
+-MartGoldenrod5F2:
- db 4 ; # items
- db TM_THUNDERPUNCH
- db TM_FIRE_PUNCH
- db TM_ICE_PUNCH
- db TM_HEADBUTT
- db -1 ; end
--; 16146
-
--MartGoldenrod5F3: ; 16146
+-MartGoldenrod5F3:
- db 4 ; # items
- db TM_THUNDERPUNCH
- db TM_FIRE_PUNCH
- db TM_ICE_PUNCH
- db TM_ROCK_SMASH
- db -1 ; end
--; 1614c
-
--MartGoldenrod5F4: ; 1614c
+-MartGoldenrod5F4:
- db 5 ; # items
- db TM_THUNDERPUNCH
- db TM_FIRE_PUNCH
@@ -472,11 +468,10 @@ Finally, edit [data/items/marts.asm](../blob/master/data/items/marts.asm):
- db TM_HEADBUTT
- db TM_ROCK_SMASH
- db -1 ; end
--; 16153
...
- MartCeladon3F: ; 161ce
+ MartCeladon3F:
db 5 ; # items
- db TM_HIDDEN_POWER
- db TM_SUNNY_DAY
@@ -488,7 +483,6 @@ Finally, edit [data/items/marts.asm](../blob/master/data/items/marts.asm):
+ db TM_FIRE_PUNCH
+ db TM_ICE_PUNCH
db -1 ; end
- ; 161d5
```
We simplified the Goldenrod Mart data, and revised the Celadon Mart's inventory: they still sell TM17 Protect, but also the same three Punch TMs as Goldenrod, as well as TM09 Psych Up (which was only available held by Abra or Kadabra traded from Gen 1).
@@ -511,7 +505,7 @@ Some other Pokémon have catch rates equivalent to unused item slots, so the `Ti
Edit [data/items/catch_rate_items.asm](../blob/master/data/items/catch_rate_items.asm):
```diff
- TimeCapsule_CatchRateItems: ; 28785
+ TimeCapsule_CatchRateItems:
db ITEM_19, LEFTOVERS
db ITEM_2D, BITTER_BERRY
db ITEM_32, GOLD_BERRY
@@ -528,7 +522,6 @@ Edit [data/items/catch_rate_items.asm](../blob/master/data/items/catch_rate_item
+ db TM_DETECT, BERRY
db -1, BERRY
db 0 ; end
- ; 2879e
```
That's everything!
diff --git a/Physical-Special-split.md b/Physical-Special-split.md
index 7f51ffd..1bc5005 100644
--- a/Physical-Special-split.md
+++ b/Physical-Special-split.md
@@ -88,7 +88,7 @@ move: MACRO
+ db \8 percent ; effect chance
ENDM
-Moves: ; 41afb
+Moves:
; entries correspond to constants/move_constants.asm
- move POUND, EFFECT_NORMAL_HIT, 40, NORMAL, 100, 35, 0
- ...
@@ -106,7 +106,7 @@ You'll have to assign the right category—`PHYSICAL`, `SPECIAL`, or `STATUS`—
Edit [engine/pokemon/types.asm](../blob/master/engine/pokemon/types.asm):
```diff
- PrintMoveType: ; 5093a
+ PrintMoveType:
; Print the type of move b at hl.
push hl
@@ -197,7 +197,7 @@ At this point the Physical/Special split *works*, technically, but for two thing
Edit [engine/battle/ai/scoring.asm](../blob/master/engine/battle/ai/scoring.asm). There are a few unrelated changes to make here, so let's go over them one at a time.
```diff
- AI_Types: ; 38635
+ AI_Types:
...
; Discourage this move if there are any moves
; that do damage of a different type.
@@ -217,7 +217,7 @@ Edit [engine/battle/ai/scoring.asm](../blob/master/engine/battle/ai/scoring.asm)
Here we're just masking out categories again.
```diff
- AI_Smart_SpDefenseUp2: ; 38aed
+ AI_Smart_SpDefenseUp2:
...
@@ -267,7 +267,7 @@ Here we're just masking out categories again.
This routine used to encourage the AI to use moves that raise its Special Defense if the player's Pokémon was of a Special type. Since physical/special categories are now independent of types, we've changed it to check whether the player's base Special Attack is at least as high as its base Attack.
```diff
- AI_Smart_Encore: ; 38c3b
+ AI_Smart_Encore:
...
push hl
@@ -280,7 +280,7 @@ This routine used to encourage the AI to use moves that raise its Special Defens
Just masking out the category again.
```diff
- AI_Smart_Curse: ; 38e5c
+ AI_Smart_Curse:
...
ld a, [wBattleMonType1]
@@ -390,13 +390,11 @@ Edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm):
.done
ret
- ; 3e74f
.Disabled:
db "Disabled!@"
-.Type:
- db "TYPE/@"
- ; 3e75f
```
Instead of printing "TYPE/" in the move property box, we print the move's category.
@@ -407,7 +405,7 @@ Instead of printing "TYPE/" in the move property box, we print the move's catego
Edit [engine/menus/start_menu.asm](../blob/master/engine/menus/start_menu.asm):
```diff
- PlaceMoveData: ; 13256
+ PlaceMoveData:
xor a
ld [hBGMapMode], a
hlcoord 0, 10
@@ -434,14 +432,12 @@ Edit [engine/menus/start_menu.asm](../blob/master/engine/menus/start_menu.asm):
predef PrintMoveType
...
- String_MoveType_Top: ; 132ba
+ String_MoveType_Top:
- db "┌─────┐@
+ db "┌────────┐@"
- ; 132c2
- String_MoveType_Bottom: ; 132c2
+ String_MoveType_Bottom:
- db "│TYPE/└@"
+ db "│ └@"
- ; 132ca
```
Again, instead of printing "TYPE/" in the move property box, we print the move's category. There's no room for the "/" after the category, so here it goes before the type.
diff --git a/Remove-the-25%-failure-chance-for-AI-status-moves.md b/Remove-the-25%-failure-chance-for-AI-status-moves.md
index 696f06c..411ec83 100644
--- a/Remove-the-25%-failure-chance-for-AI-status-moves.md
+++ b/Remove-the-25%-failure-chance-for-AI-status-moves.md
@@ -69,7 +69,7 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep
...
--.CheckAIRandomFail: ; 35ece
+-.CheckAIRandomFail:
- ; Enemy turn
- ld a, [hBattleTurn]
- and a
diff --git a/Running-Shoes.md b/Running-Shoes.md
index 10de40c..d1ab4ad 100644
--- a/Running-Shoes.md
+++ b/Running-Shoes.md
@@ -3,7 +3,7 @@ The simplest possible way to implement Running Shoes is to double the player's w
This is easy to do, as discovered by [Victoria Lacroix](https://github.com/VictoriaLacroix/pokecrystal/commit/ed7f525d642cb02e84e856f2e506d2a6425d95db). Just edit [engine/overworld/player_movement.asm](../blob/master/engine/overworld/player_movement.asm):
```diff
- DoPlayerMovement:: ; 80000
+ DoPlayerMovement::
...
@@ -29,7 +29,7 @@ This is easy to do, as discovered by [Victoria Lacroix](https://github.com/Victo
...
- .BikeCheck: ; 803ca
+ .BikeCheck:
ld a, [wPlayerState]
cp PLAYER_BIKE
ret z
@@ -44,7 +44,6 @@ This is easy to do, as discovered by [Victoria Lacroix](https://github.com/Victo
+ and B_BUTTON
+ cp B_BUTTON
+ ret
- ; 803d3
```
That's it!