through PlayerTurnInPlace

This commit is contained in:
PikalaxALT
2020-03-24 18:17:18 -04:00
parent 87b2c7f34b
commit 8a85485cc2
5 changed files with 118 additions and 285 deletions
+91 -6
View File
@@ -71,19 +71,20 @@ bool8 PlayerIsAnimActive(void);
bool8 PlayerCheckIfAnimFinishedOrInactive(void);
bool8 player_is_anim_in_certain_ranges(void);
bool8 sub_805BF58(void);
void PlayerRun(u8 direction);
void PlayerRunSlow(u8 direction);
void PlayerGoSpeed2(u8 direction);
void PlayerGoSpeed1(u8 direction);
void PlayerGoSlow(u8 direction);
void PlayerRideWaterCurrent(u8 direction);
void sub_805C438(u8 direction);
void CreateStopSurfingTask(u8 direction);
void StartStrengthAnim(u8 objectEventId, u8 direction);
void PlayerNotOnBikeCollide(u8 direction);
void PlayerRun(u8 direction);
void PlayerRunSlow(u8 direction);
void PlayerFaceDirection(u8 direction);
void PlayerTurnInPlace(u8 direction);
void PlayerGoSpeed2(u8 direction);
void PlayerGoSpeed1(u8 direction);
void PlayerJumpLedge(u8 direction);
void PlayerGoSlow(u8 direction);
void PlayerGoSpin(u8 direction);
void PlayerRideWaterCurrent(u8 direction);
void sub_805C2CC(u8 metatileBehavior);
void sub_805CC40(struct ObjectEvent * playerObjEvent);
void DoPlayerMatJump(void);
@@ -779,3 +780,87 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement)
sub_8112628(movementActionId);
}
}
void sub_805C06C(struct ObjectEvent * objectEvent, u8 movementAction)
{
if (!ObjectEventSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], movementAction))
sub_81126AC(movementAction, 0);
}
void sub_805C0A4(struct ObjectEvent * objectEvent, u8 movementAction)
{
if (!ObjectEventSetHeldMovement(objectEvent, movementAction))
sub_8112588(objectEvent->localId, objectEvent->mapNum, objectEvent->mapGroup, movementAction, 32);
}
void sub_805C0D4(u8 direction)
{
PlayerSetAnimId(sub_8063F2C(direction), 2);
}
void PlayerGoSlow(u8 direction)
{
PlayerSetAnimId(sub_8063F58(direction), 2);
}
void PlayerGoSpeed1(u8 direction)
{
PlayerSetAnimId(GetWalkNormalMovementAction(direction), 2);
}
void PlayerGoSpeed2(u8 direction)
{
PlayerSetAnimId(GetWalkFastMovementAction(direction), 2);
}
void sub_805C134(u8 direction)
{
PlayerSetAnimId(sub_8063FDC(direction), 2);
}
void PlayerRideWaterCurrent(u8 direction)
{
PlayerSetAnimId(sub_8064008(direction), 2);
}
void sub_805C164(u8 direction)
{
PlayerSetAnimId(GetWalkFastestMovementAction(direction), 2);
}
void PlayerRun(u8 direction)
{
PlayerSetAnimId(GetPlayerRunMovementAction(direction), 2);
}
void PlayerRunSlow(u8 direction)
{
PlayerSetAnimId(GetPlayerRunSlowMovementAction(direction), 2);
}
void PlayerOnBikeCollide(u8 direction)
{
sub_805C438(direction);
PlayerSetAnimId(GetWalkInPlaceNormalMovementAction(direction), 2);
}
void PlayerNotOnBikeCollide(u8 direction)
{
sub_805C438(direction);
PlayerSetAnimId(GetStepInPlaceDelay32AnimId(direction), 2);
}
void PlayerFaceDirection(u8 direction)
{
PlayerSetAnimId(GetFaceDirectionMovementAction(direction), 1);
}
void sub_805C20C(u8 direction)
{
PlayerSetAnimId(GetWalkSlowMovementAction(direction), 1);
}
void PlayerTurnInPlace(u8 direction)
{
PlayerSetAnimId(GetWalkInPlaceSlowMovementAction(direction), 1);
}
+19 -18
View File
@@ -43,6 +43,7 @@
#include "constants/species.h"
#include "constants/items.h"
#include "constants/field_weather.h"
#include "constants/event_object_movement.h"
u8 gUnknown_3005E88;
@@ -1448,7 +1449,7 @@ void sub_811246C(struct Sprite *sprite)
}
}
void sub_81124EC(u8 a0, u8 a1, u8 a2, u8 a3)
void sub_81124EC(u8 a0, u8 a1, u8 a2, u8 movementActionId)
{
if (!sub_8112CEC())
{
@@ -1457,37 +1458,37 @@ void sub_81124EC(u8 a0, u8 a1, u8 a2, u8 a3)
sCurQuestLogEntry[sQuestLogCursor].unk_0 = a0;
sCurQuestLogEntry[sQuestLogCursor].unk_1 = a1;
sCurQuestLogEntry[sQuestLogCursor].unk_2 = a2;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = a3;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = movementActionId;
sQuestLogCursor++;
sNextStepDelay = 0;
}
}
void sub_8112588(u8 a0, u8 a1, u8 a2, u8 a3, u8 a4)
void sub_8112588(u8 localId, u8 mapNum, u8 mapGroup, u8 movementActionId, u8 duration)
{
if (!RecordHeadAtEndOfEntry())
{
sCurQuestLogEntry[sQuestLogCursor].unk_4 = sNextStepDelay;
sCurQuestLogEntry[sQuestLogCursor].unk_6 = 0;
sCurQuestLogEntry[sQuestLogCursor].unk_0 = a0;
sCurQuestLogEntry[sQuestLogCursor].unk_1 = a1;
sCurQuestLogEntry[sQuestLogCursor].unk_2 = a2;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = a3;
sCurQuestLogEntry[sQuestLogCursor].unk_0 = localId;
sCurQuestLogEntry[sQuestLogCursor].unk_1 = mapNum;
sCurQuestLogEntry[sQuestLogCursor].unk_2 = mapGroup;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = movementActionId;
sQuestLogCursor++;
sNextStepDelay = a4;
sNextStepDelay = duration;
}
}
void sub_8112628(u8 a0)
void sub_8112628(u8 movementActionId)
{
if (!sub_8112CEC())
{
if (a0 != sCurQuestLogEntry[gUnknown_203B01C].unk_3 || a0 > 3)
if (movementActionId != sCurQuestLogEntry[gUnknown_203B01C].unk_3 || movementActionId > MOVEMENT_ACTION_FACE_RIGHT)
{
sCurQuestLogEntry[sQuestLogCursor].unk_4 = sNextStepDelay;
sCurQuestLogEntry[sQuestLogCursor].unk_6 = 0;
sCurQuestLogEntry[sQuestLogCursor].unk_0 = 0;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = a0;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = movementActionId;
gUnknown_203B01C = sQuestLogCursor;
sQuestLogCursor++;
sNextStepDelay = 0;
@@ -1495,17 +1496,17 @@ void sub_8112628(u8 a0)
}
}
void sub_81126AC(u8 a0, u8 a1)
void sub_81126AC(u8 movementActionId, u8 duration)
{
if (!RecordHeadAtEndOfEntry())
{
sCurQuestLogEntry[sQuestLogCursor].unk_4 = sNextStepDelay;
sCurQuestLogEntry[sQuestLogCursor].unk_6 = 0;
sCurQuestLogEntry[sQuestLogCursor].unk_0 = 0;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = a0;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = movementActionId;
gUnknown_203B01C = sQuestLogCursor;
sQuestLogCursor++;
sNextStepDelay = a1;
sNextStepDelay = duration;
}
}
@@ -1637,16 +1638,16 @@ static void SetUpQuestLogEntry(u8 kind, struct QuestLogEntry *entry, u16 size)
{
case DIR_NONE:
case DIR_SOUTH:
sCurQuestLogEntry[sQuestLogCursor].unk_3 = DIR_SOUTH - 1;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = MOVEMENT_ACTION_FACE_DOWN;
break;
case DIR_EAST:
sCurQuestLogEntry[sQuestLogCursor].unk_3 = DIR_EAST - 1;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = MOVEMENT_ACTION_FACE_RIGHT;
break;
case DIR_NORTH:
sCurQuestLogEntry[sQuestLogCursor].unk_3 = DIR_NORTH - 1;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = MOVEMENT_ACTION_FACE_UP;
break;
case DIR_WEST:
sCurQuestLogEntry[sQuestLogCursor].unk_3 = DIR_WEST - 1;
sCurQuestLogEntry[sQuestLogCursor].unk_3 = MOVEMENT_ACTION_FACE_LEFT;
break;
}
gUnknown_203B01C = 0;