summaryrefslogtreecommitdiff
path: root/Tips-and-tricks.md
blob: 8161145876f33934369e741b22dff77257900f15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
This page is for small hints about how to edit pokecrystal that don't need an entire tutorial of their own. Any sort of tips, tricks, hints, pointers to obscure but useful code routines, engine trivia—it all goes here.


## Contents

- [How to change shiny odds](#how-to-change-shiny-odds)
- [How to stop the white hue of the blue palette from animating](#how-to-stop-the-white-hue-of-the-blue-palette-from-animating)
- [Lowercasing Pokémon names cuts off their first letter](#lowercasing-pokémon-names-cuts-off-their-first-letter)


## How to change shiny odds

The odds of encountering a shiny Pokémon in Gen 2 are 1 in 8,192. That value isn't literally defined anywhere: it's a consequence of making shininess based on DVs. A shiny Pokémon has:

- Attack DV = 2, 3, 6, 7, 10, 11, 14, or 15
- Defense, Speed, and Special DVs = 10

Since all four DVs are random from 0 to 15, some multiplication shows that 1 in 8,192 Pokémon will be shiny.

The routine that checks those specific values is `CheckShininess` in [engine/gfx/color.asm](../blob/master/engine/gfx/color.asm). If you want different odds, just change which DVs count as shiny. (The `Unused_CheckShininess` routine right below it would just make a Pokémon shiny if all its DVs are 10 or higher, which gives odds of about 1 in 50.)

Also, the red Gyarados has hard-coded values for its DVs of 14/10/10/10; they're defined as `ATKDEFDV_SHINY` and `SPDSPCDV_SHINY` in [constants/battle_constants.asm](../blob/master/constants/battle_constants.asm).


## How to stop the white hue of the blue palette from animating

There are eight palettes used for tilesets: `GRAY`, `RED`, `GREEN`, `WATER`, `YELLOW`, `BROWN`, `ROOF`, and `TEXT`. It's called `WATER` instead of `BLUE` because its lightest hue gets animated for some tilesets, cycling between three colors. This makes water (and rocks, whirlpools, and waterfalls) look more dynamic, but it prevents you from making static blue tiles (like Mart roofs).

To stop it, edit [engine/tilesets/tileset_anims.asm](../blob/master/engine/tilesets/tileset_anims.asm) and replace all the instances of `dw NULL, AnimateWaterPalette` with `dw NULL, WaitTileAnimation`.


## Lowercasing Pokémon names cuts off their first letter

If you simply lowercase all the names in [data/pokemon/names.asm](../blob/master/data/pokemon/names.asm) and rebuild the ROM, the first letter of their names may be missing. The cause is changing `"FARFETCH'D"` to `"Farfetch'd"`, because `'d` is actually a single character. The fix is to pad its name to the same length as all the rest with an `@`, so that it becomes `"Farfetch'd@".