diff options
author | scnorton <scnorton@biociphers.org> | 2018-01-18 12:53:31 -0500 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2018-01-18 12:53:31 -0500 |
commit | c6ff1a6ce39cb67c6de21f2e4938ea62c97ee7e5 (patch) | |
tree | 47e2f5eaa84c3cc97b96bdf06170136abe446d81 /include/bike.h | |
parent | 3c2b1731eeb7037a1b681444b1c126fc239a904e (diff) | |
parent | 24e0edee9f428a68715c47051ebba3cda5a3e5a7 (diff) |
Merge branch 'master' into link
Diffstat (limited to 'include/bike.h')
-rw-r--r-- | include/bike.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/include/bike.h b/include/bike.h new file mode 100644 index 000000000..e625ad438 --- /dev/null +++ b/include/bike.h @@ -0,0 +1,78 @@ +#ifndef GUARD_BIKE_H +#define GUARD_BIKE_H + +// the struct below is used for checking button combinations of the last input so that the acro can potentially perform a side/turn jump. +// its possible that at some point Game Freak intended for the acro bike to have more complex tricks: but only the acro jump combinations can be seen in the final ROM. +struct BikeHistoryInputInfo +{ + u32 dirHistoryMatch; // the direction you need to press + u32 abStartSelectHistoryMatch; // the button you need to press + u32 dirHistoryMask; // mask applied so that way only the recent nybble (the recent input) is checked + u32 abStartSelectHistoryMask; // mask applied so that way only the recent nybble (the recent input) is checked + const u8 *dirTimerHistoryList; // list of timers to check for direction before the button+dir combination can be verified. + const u8 *abStartSelectHistoryList; // list of timers to check for buttons before the button+dir combination can be verified. + u32 direction; // direction to jump +}; + +// Player speeds +enum +{ + SPEED_STANDING, + SPEED_NORMAL, + SPEED_FAST, + SPEED_FASTER, + SPEED_FASTEST, +}; + +// mach bike transitions enum +enum +{ + MACH_TRANS_FACE_DIRECTION, + MACH_TRANS_TURN_DIRECTION, + MACH_TRANS_KEEP_MOVING, + MACH_TRANS_START_MOVING +}; + +// Acro bike states +enum +{ + ACRO_STATE_NORMAL, + ACRO_STATE_TURNING, + ACRO_STATE_WHEELIE_STANDING, + ACRO_STATE_BUNNY_HOP, + ACRO_STATE_WHEELIE_MOVING, + ACRO_STATE_SIDE_JUMP, + ACRO_STATE_TURN_JUMP, +}; + +// Acro bike transitions +enum +{ + ACRO_TRANS_FACE_DIRECTION, + ACRO_TRANS_TURN_DIRECTION, + ACRO_TRANS_MOVING, + ACRO_TRANS_NORMAL_TO_WHEELIE, + ACRO_TRANS_WHEELIE_TO_NORMAL, + ACRO_TRANS_WHEELIE_IDLE, + ACRO_TRANS_WHEELIE_HOPPING_STANDING, + ACRO_TRANS_WHEELIE_HOPPING_MOVING, + ACRO_TRANS_SIDE_JUMP, + ACRO_TRANS_TURN_JUMP, + ACRO_TRANS_WHEELIE_MOVING, + ACRO_TRANS_WHEELIE_RISING_MOVING, + ACRO_TRANS_WHEELIE_LOWERING_MOVING, +}; + +void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); +void Bike_TryAcroBikeHistoryUpdate(u16 newKeys, u16 heldKeys); +bool8 RS_IsRunningDisallowed(u8 tile); +bool8 IsBikingDisallowedByPlayer(void); +bool8 player_should_look_direction_be_enforced_upon_movement(void); +void GetOnOffBike(u8 transitionFlags); +void BikeClearState(int newDirHistory, int newAbStartHistory); +void Bike_UpdateBikeCounterSpeed(u8 counter); +s16 GetPlayerSpeed(void); +void Bike_HandleBumpySlopeJump(void); +bool32 IsRunningDisallowed(u8 metatile); + +#endif // GUARD_BIKE_H |