This commit is contained in:
MCboy 2018-07-19 21:23:45 +04:30 committed by GitHub
parent a8f9adeaf5
commit 416db8e751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,46 +0,0 @@
#include "global.h"
#include "global.fieldmap.h"
#include "sprite.h"
#include "event_object_movement.h"
#include "bike.h"
static u8 EventObjectCB2_NoMovement2();
void sub_808C280(struct EventObject *); //struct EventObject *playerEventObj
bool8 TryInterruptEventObjectSpecialAnim(struct EventObject *, u8);
void npc_clear_strange_bits(struct EventObject *);
void DoPlayerAvatarTransition(void);
bool8 TryDoMetatileBehaviorForcedMovement();
void MovePlayerAvatarUsingKeypadInput(u8, u16, u16);
void PlayerAllowForcedMovementIfMovingSameDirection();
void MovementType_Player(struct Sprite *sprite)
{
// ((Sprite->data[0] << 3) + Sprite->data[0]) << 2
UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_NoMovement2);
}
static u8 EventObjectCB2_NoMovement2()
{
return 0;
}
void player_step(u8 direction, u16 newKeys, u16 heldKeys)
{
struct EventObject *playerEventObj = &gEventObjects[gPlayerAvatar.eventObjectId];
sub_808C280(playerEventObj);
if (gPlayerAvatar.preventStep == FALSE)
{
Bike_TryAcroBikeHistoryUpdate(newKeys, heldKeys);
if (TryInterruptEventObjectSpecialAnim(playerEventObj, direction) == 0)
{
npc_clear_strange_bits(playerEventObj);
DoPlayerAvatarTransition();
if (TryDoMetatileBehaviorForcedMovement() == 0)
{
MovePlayerAvatarUsingKeypadInput(direction, newKeys, heldKeys);
PlayerAllowForcedMovementIfMovingSameDirection();
}
}
}
}