summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2019-01-27 21:46:26 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2019-01-27 21:46:26 -0500
commitd9b8d318e320f4c941344602eabdf842879adb7d (patch)
tree798a65a2466804eec97e4dc165ebbebb4e1a8ebf
parent9786a165ff48c7fc86dc982110b24db7c6030ddf (diff)
Useful unused data and routines
-rw-r--r--Tips-and-tricks.md62
-rw-r--r--Tutorials.md7
-rw-r--r--Useful-unused-data-and-routines.md78
3 files changed, 136 insertions, 11 deletions
diff --git a/Tips-and-tricks.md b/Tips-and-tricks.md
index 714efd4..a3d8364 100644
--- a/Tips-and-tricks.md
+++ b/Tips-and-tricks.md
@@ -3,12 +3,14 @@ This page is for small hints about how to edit pokecrystal that don't need an en
## 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)
+- [Change the odds of encountering a shiny Pokémon](#change-the-odds-of-encountering-a-shiny-pokémon)
+- [Stop the blue palette from animating its white hue](#stop-the-blue-palette-from-animating-its-white-hue)
+- [Make overworld sprites darker at night](#make-overworld-sprites-darker-at-night)
+- [Enemy trainers have maximum happiness for a powerful Return](#enemy-trainers-have-maximum-happiness-for-a-powerful-return)
- [Lowercasing Pokémon names cuts off their first letter](#lowercasing-pokémon-names-cuts-off-their-first-letter)
-## How to change shiny odds
+## Change the odds of encountering a shiny Pokémon
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:
@@ -22,13 +24,63 @@ The routine that checks those specific values is `CheckShininess` in [engine/gfx
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
+## Stop the blue palette from animating its white hue
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`.
+## Make overworld sprites darker at night
+
+Edit [gfx/overworld/npc_sprites.pal](../blob/master/gfx/overworld/npc_sprites.pal):
+
+```diff
+ ; nite
+- RGB 15,14,24, 31,19,10, 31,07,01, 00,00,00 ; red
+- RGB 15,14,24, 31,19,10, 10,09,31, 00,00,00 ; blue
+- RGB 15,14,24, 31,19,10, 07,23,03, 00,00,00 ; green
+- RGB 15,14,24, 31,19,10, 15,10,03, 00,00,00 ; brown
+- RGB 15,14,24, 31,19,10, 30,10,06, 00,00,00 ; pink
++ RGB 15,14,24, 16,10,09, 17,03,00, 00,00,00 ; red
++ RGB 15,14,24, 16,10,09, 05,04,27, 00,00,00 ; blue
++ RGB 15,14,24, 16,10,09, 03,10,02, 00,00,00 ; green
++ RGB 15,14,24, 16,10,09, 08,04,02, 00,00,00 ; brown
++ RGB 15,14,24, 16,10,09, 18,05,04, 00,00,00 ; pink
+ RGB 31,31,31, 31,31,31, 13,13,13, 00,00,00 ; silver
+ RGB 15,14,24, 08,13,19, 00,11,13, 00,00,00 ; tree
+ RGB 15,14,24, 12,09,15, 08,04,05, 00,00,00 ; rock
+```
+
+
+## Enemy trainers have maximum happiness for a powerful Return
+
+Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
+
+```diff
+ TryAddMonToParty:
+ ...
+ GeneratePartyMonStats:
+ ; wBattleMode specifies whether it's a wild mon or not.
+ ; wMonType specifies whether it's an opposing mon or not.
+ ; wCurPartySpecies/wCurPartyLevel specify the species and level.
+ ; hl points to the wPartyMon struct to fill.
+ ...
+
+ ; Initialize happiness.
++ ld a, [wMonType]
++ and $f
+ ld a, BASE_HAPPINESS
++ jr z, .got_happiness
++ ld a, $ff ; max happiness for enemy trainers
++.got_happiness
+ ld [de], a
+ inc de
+
+ ...
+```
+
+
## 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@"`. \ No newline at end of file
+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@"`.
diff --git a/Tutorials.md b/Tutorials.md
index 9d2f302..3c8e0c3 100644
--- a/Tutorials.md
+++ b/Tutorials.md
@@ -21,6 +21,7 @@ Tutorials may use diff syntax to show edits:
## Miscellaneous
- [Tips and tricks](Tips-and-tricks)
+- [Useful unused data and routines](Useful-unused-data-and-routines)
## How to add a new…
@@ -133,10 +134,4 @@ Feel free to contribute one of these!
- Show quantity already in Pack in Marts
- Instant text option
- Nuzlocke mode (an in-game enforced [Nuzlocke Challenge](https://bulbapedia.bulbagarden.net/wiki/Nuzlocke_Challenge))
-
-Tips and tricks:
-
-- Trainers have max happiness for Return
-- Make overworld sprites darker at night
- Pan the camera for cutscenes by making the player invisible
-- Useful unused content (`COLL_CURRENT_*`, `HELD_PREVENT_*`, `ENVIRONMENT_5`, `TRADE_GENDER_MALE`, `GROWTH_SLIGHTLY_*`, `SPRITE_UNUSED_GUY`, `PAL_NPC_PINK`, etc)
diff --git a/Useful-unused-data-and-routines.md b/Useful-unused-data-and-routines.md
new file mode 100644
index 0000000..0872478
--- /dev/null
+++ b/Useful-unused-data-and-routines.md
@@ -0,0 +1,78 @@
+This page is for pointing out unused data or routines that were left over in the pokecrystal ROM.
+
+
+## Contents
+
+- [NPC sprites](#npc-sprites)
+- [Pink overworld sprite color](#pink-overworld-sprite-color)
+- [Map environment for outdoor dungeons](#map-environment-for-outdoor-dungeons)
+- [Tile collision behavior](#tile-collision-behavior)
+- [Held item effects to prevent status conditions](#held-item-effects-to-prevent-status-conditions)
+- [Experience growth rates](#experience-growth-rates)
+- [NPCs that trade for a male Pokémon](#npcs-that-trade-for-a-male-pokémon)
+
+
+## NPC sprites
+
+From [constants/sprite_constants.asm](../blob/master/constants/sprite_constants.asm):
+
+- `SPRITE_UNUSED_GUY`: An old balding man with a moustache. Does not have walking frame graphics. Maybe the Safari Zone Warden?
+- `SPRITE_OLD_LINK_RECEPTIONIST`: The Cable Club receptionist from RBY.
+
+Use them in [maps/\*.asm](../tree/master/maps/).
+
+
+## Pink overworld sprite color
+
+From [constants/sprite_data_constants.asm](../blob/master/constants/sprite_data_constants.asm):
+
+- `PAL_NPC_PINK`: A counterpart to the other `PAL_NPC_*` constants. Pink looks very similar to red. (IMO purple would be more useful.)
+
+
+## Map environment for outdoor dungeons
+
+From [constants/map_data_constants.asm](../blob/master/constants/map_data_constants.asm):
+
+- `ENVIRONMENT_5`: An environment that seems neither outdoors nor indoors. You can't use Fly, Teleport, Dig, Escape Rope, or the Bicycle; and its colors change with the time of day, but unlike `TOWN` and `ROUTE` maps, they don't use the special outdoor water colors.
+
+Use it in [data/maps/maps.asm](../blob/master/data/maps/maps.asm).
+
+
+## Tile collision behavior
+
+From [constants/collision_constants.asm](../blob/master/constants/collision_constants.asm):
+
+- `COLL_CURRENT_*`: Force the player to Surf `RIGHT`, `LEFT`, `UP`, or `DOWN`. Similar to the current tiles in RSE west of Pacifidlog Town.
+- `COLL_WALK_*` and `COLL_BRAKE`: Force the player to walk `RIGHT`, `LEFT`, `UP`, or `DOWN`, or to stop forced walking. Similar to the spinner tiles in RBY's Rocket Hideout, but without the spinning.
+- `COLL_HOP_UP`, `COLL_HOP_UP_RIGHT`, and `COLL_HOP_UP_LEFT`: Counterparts to the other `COLL_HOP_*` constants. Useful for upward-facing ledges.
+- `COLL_DOWN_WALL`: A counterpart to `COLL_RIGHT_WALL`, `COLL_LEFT_WALL`, and `COLL_UP_WALL`. Blocks the bottom edge but not the other three. Useful for placing above cave entrances in case the player can walk on top of cliffs with caves.
+
+Use them in [data/tilesets/\*_collision.asm](../tree/master/data/tilesets/).
+
+
+## Held item effects to prevent status conditions
+
+From [constants/item_data_constants.asm](../blob/master/constants/item_data_constants.asm):
+
+- `HELD_PREVENT_*`: For held items that prevent status conditions: `POISON`, `BURN`, `FREEZE`, `SLEEP`, `PARALYZE`, or `CONFUSE`.
+
+Use it in [data/items/attributes.asm](../blob/master/data/items/attributes.asm).
+
+
+## Experience growth rates
+
+From [constants/pokemon_data_constants.asm](../blob/master/constants/pokemon_data_constants.asm):
+
+- `GROWTH_SLIGHTLY_FAST`: Needs 849,970 to reach level 100.
+- `GROWTH_SLIGHTLY_SLOW`: Needs 949,930 to reach level 100.
+
+Use them in [data/pokemon/base_stats/\*.asm](../tree/master/data/pokemon/base_stats/).
+
+
+## NPCs that trade for a male Pokémon
+
+From [constants/npc_trade_constants.asm](../blob/master/constants/npc_trade_constants.asm):
+
+- `TRADE_GENDER_MALE`: A counterpart to `TRADE_GENDER_FEMALE`.
+
+Use it in [data/events/npc_trades.asm](../blob/master/data/events/npc_trades.asm).