Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle catch_rate -> item for gen1 -> 2 #95

Closed
savaughn opened this issue Nov 14, 2023 · 0 comments · Fixed by #96
Closed

Handle catch_rate -> item for gen1 -> 2 #95

savaughn opened this issue Nov 14, 2023 · 0 comments · Fixed by #96
Assignees
Labels
bug Something isn't working

Comments

@savaughn
Copy link
Owner

Describe the bug
Time capsule converts some catch rates to a table of items.

There was originally a good reason for these two gaps!

Pokémon traded from RBY to GSC have their catch rate interpreted as their new held item. This was planned early on in development, so some items were given indexes corresponding to appropriate Gen 1 catch rates:

  • $03 = 3: BRIGHTPOWDER is for Articuno, Zapdos, Moltres, and Mewtwo
  • $1E = 30: LUCKY_PUNCH is for Chansey
  • $23 = 35: METAL_POWDER is for Ditto
  • $3C = 60: SILVER_LEAF is for 10 Pokémon
  • $4B = 75: GOLD_LEAF is for 13 Pokémon
  • $96 = 150: MYSTERYBERRY is for Clefairy
  • $AA = 170: POLKADOT_BOW is for Jigglypuff
  • $B4 = 180: BRICK_PIECE is for Machop

Yellow was also being developed then, and it did the reverse, altering some Pokémon's data after they're caught to correspond to appropriate Gen 2 items:

  • Starter Pikachu's catch rate byte is overwritten with 163 = $A3 for LIGHT_BALL
  • Wild-caught Kadabra's catch rate byte is overwritten with 96 = $60 for TWISTEDSPOON

(Yellow also directly changed Dragonair's catch rate to 27 and Dragonite's to 9, but this seems to have been only for adjusting their difficulty, since those meaninglessly correspond to PROTEIN and ANTIDOTE.)

Most catch rates were left as gaps in the item list, and transformed into held items via the TimeCapsule_CatchRateItems table in data/items/catch_rate_items.asm. For example, the 52 Pokémon with catch rate 45 would hold the gap ITEM_2D, except that gets transformed into BITTER_BERRY.

But a few Pokémon end up with weird items. Abra has a catch rate of 200, or $C8; and Krabby, Horsea, Goldeen, and Staryu have a catch rate of 225, or $E1. Those indexes correspond to the items TM_PSYCH_UP and TM_ICE_PUNCH, which seem like random choices—because they are.

The TMs and HMs span from indexes $BF to $F9. However, as we can see in pokegold-spaceworld, they originally spanned $C4 to $FF. For some reason they were shifted down by 5 during development.

Before the index shift, the gap ITEM_C3 would have been at index $C8, and ITEM_DC at $E1. In other words, they would have neatly corresponded to the catch rates for those five Pokémon! Then they would have held BERRY when traded through the Time Capsule (since the gap items get transformed via TimeCapsule_CatchRateItems).

TimeCapsule_CatchRateItems:
db ITEM_19, LEFTOVERS
db ITEM_2D, BITTER_BERRY
db ITEM_32, GOLD_BERRY
db ITEM_5A, BERRY
db ITEM_64, BERRY
db ITEM_78, BERRY
db ITEM_87, BERRY
db ITEM_BE, BERRY
db ITEM_C3, BERRY
db ITEM_DC, BERRY
db ITEM_FA, BERRY
db -1, BERRY
db 0 ; end

@savaughn savaughn added the bug Something isn't working label Nov 14, 2023
@savaughn savaughn self-assigned this Nov 15, 2023
@savaughn savaughn linked a pull request Nov 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant