summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Diagonal-stairs.md48
1 files changed, 48 insertions, 0 deletions
diff --git a/Diagonal-stairs.md b/Diagonal-stairs.md
index dd82266..c47e5df 100644
--- a/Diagonal-stairs.md
+++ b/Diagonal-stairs.md
@@ -5,3 +5,51 @@ All the stairs in Gen 1 and 2 only go upwards. Gen 3 had a few that go downwards
[Here](https://github.com/Rangi42/pokecrystal/commit/756a1a712daf5dfd018313cb2f851e8d5e4e8f47) are all the changes needed to implement diagonal stairs, applied to a copy of pokecrystal. You can `clone` [Rangi42/pokecrystal](https://github.com/Rangi42/pokecrystal/tree/diagonal-stairs) and `checkout` the `diagonal-stairs` branch to test it for yourself.
![Screenshot](screenshots/diagonal-stairs.png)
+
+## 1 Define the constants
+
+edit constants/collision_constants.asm
+```diff
+; collision data types (see data/tilesets/*_collision.asm)
+; TileCollisionTable indexes (see data/collision_permissions.asm)
+ COLL_FLOOR EQU $00
+...
+ COLL_DOWN_WALL EQU $b3 ; unused
++COLL_DIAGONAL_STAIRS_RIGHT EQU $d0
++COLL_DIAGONAL_STAIRS_LEFT EQU $d1
+ COLL_FF EQU $ff ; garbage
+
+; collision data type nybbles
+ LO_NYBBLE_GRASS EQU $07
+ HI_NYBBLE_TALL_GRASS EQU $10
+...
+ HI_NYBBLE_SIDE_WALLS EQU $b0
+ HI_NYBBLE_UNUSED_C0 EQU $c0
++HI_NYBBLE_DIAGONAL_STAIRS EQU $d0
+```
+edit constants/map_object_constants.asm
+```diff
+; StepTypesJumptable indexes (see engine/overworld/map_objects.asm)
+ const_def
+ const STEP_TYPE_00 ; 00
+ const STEP_TYPE_SLEEP ; 01
+...
+ const STEP_TYPE_17 ; 17
+ const STEP_TYPE_18 ; 18
+ const STEP_TYPE_SKYFALL_TOP ; 19
++ const STEP_TYPE_NPC_DIAGONAL_STAIRS
++ const STEP_TYPE_PLAYER_DIAGONAL_STAIRS
+
+...
+; DoPlayerMovement.DoStep arguments (see engine/overworld/player_movement.asm)
+ const_def
+ const STEP_SLOW ; 0
+ const STEP_WALK ; 1
+ const STEP_BIKE ; 2
+ const STEP_LEDGE ; 3
+ const STEP_ICE ; 4
+ const STEP_TURN ; 5
+ const STEP_BACK_LEDGE ; 6
+ const STEP_WALK_IN_PLACE ; 7
++ const STEP_DIAGONAL_STAIRS
+``` \ No newline at end of file