mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-09-30 21:40:45 -05:00
add rest of distortion world states and name state function
This commit is contained in:
@@ -27,6 +27,11 @@ enum AvatarMoveState {
|
||||
enum AvatarDistortionState {
|
||||
AVATAR_DISTORTION_STATE_NONE = 0,
|
||||
AVATAR_DISTORTION_STATE_ACTIVE,
|
||||
AVATAR_DISTORTION_STATE_FLOOR,
|
||||
AVATAR_DISTORTION_STATE_WEST_WALL,
|
||||
AVATAR_DISTORTION_STATE_EAST_WALL,
|
||||
AVATAR_DISTORTION_STATE_CEILING,
|
||||
AVATAR_DISTORTION_STATE_MAX,
|
||||
};
|
||||
|
||||
#endif // POKEPLATINUM_CONSTANTS_PLAYER_AVATAR_H
|
||||
|
||||
@@ -96,7 +96,7 @@ int sub_0205F060(PlayerAvatar * playerAvatar);
|
||||
void sub_0205F074(PlayerAvatar * playerAvatar, int param1);
|
||||
int sub_0205F08C(PlayerAvatar * playerAvatar);
|
||||
void sub_0205F098(PlayerAvatar * playerAvatar, int param1);
|
||||
int sub_0205F108(PlayerAvatar * const playerAvatar);
|
||||
int PlayerAvatar_DistortionWorldState(PlayerAvatar * const playerAvatar);
|
||||
BOOL sub_0205F158(PlayerAvatar * const playerAvatar);
|
||||
BOOL sub_0205F16C(PlayerAvatar * const playerAvatar);
|
||||
|
||||
|
||||
@@ -279,9 +279,9 @@ BOOL FieldInput_Process (const FieldInput *input, FieldSystem *fieldSystem)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int distortionCheck = sub_0205F108(fieldSystem->playerAvatar);
|
||||
int distortionState = PlayerAvatar_DistortionWorldState(fieldSystem->playerAvatar);
|
||||
|
||||
if (distortionCheck == AVATAR_DISTORTION_STATE_NONE || distortionCheck == AVATAR_DISTORTION_STATE_ACTIVE) {
|
||||
if (distortionState == AVATAR_DISTORTION_STATE_NONE || distortionState == AVATAR_DISTORTION_STATE_ACTIVE) {
|
||||
int event = sub_0203CA6C(fieldSystem, (void *)sub_0203A440(fieldSystem), sub_0203A448(fieldSystem));
|
||||
|
||||
if (event != 0xffff) {
|
||||
@@ -290,7 +290,7 @@ BOOL FieldInput_Process (const FieldInput *input, FieldSystem *fieldSystem)
|
||||
}
|
||||
}
|
||||
|
||||
if (distortionCheck == AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (distortionState == AVATAR_DISTORTION_STATE_NONE) {
|
||||
int event;
|
||||
|
||||
if (ov5_021EFB40(fieldSystem, &event)) {
|
||||
|
||||
@@ -200,7 +200,7 @@ static void PlayerAvatar_RequestStateWalking (PlayerAvatar * playerAvatar)
|
||||
int v0;
|
||||
int v1 = 0x0;
|
||||
|
||||
if (sub_0205F108(playerAvatar) != 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(playerAvatar) != 0) {
|
||||
v1 = 0x18;
|
||||
} else {
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
@@ -254,7 +254,7 @@ static void PlayerAvatar_RequestStateSurf (PlayerAvatar * playerAvatar)
|
||||
int v0, v1;
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
FieldSystem * fieldSystem = MapObject_FieldSystem(mapObj);
|
||||
int v4 = sub_0205F108(playerAvatar);
|
||||
int v4 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
UnkStruct_ov101_021D5D90 * v5 = sub_0205EC04(playerAvatar);
|
||||
|
||||
if (v5 != NULL) {
|
||||
@@ -312,7 +312,7 @@ static void PlayerAvatar_RequestStatePoketch (PlayerAvatar * playerAvatar)
|
||||
int v0;
|
||||
int v1 = 0x14;
|
||||
|
||||
if (sub_0205F108(playerAvatar) != 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(playerAvatar) != 0) {
|
||||
v1 = 0x1b;
|
||||
} else {
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
@@ -332,7 +332,7 @@ static void PlayerAvatar_RequestStateSave (PlayerAvatar * playerAvatar)
|
||||
int v0;
|
||||
int v1 = 0x15;
|
||||
|
||||
if (sub_0205F108(playerAvatar) != 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(playerAvatar) != 0) {
|
||||
v1 = 0x1a;
|
||||
} else {
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
@@ -623,7 +623,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
|
||||
switch (v0->unk_00) {
|
||||
case 0:
|
||||
if (sub_0205F108(v0->playerAvatar) == 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(v0->playerAvatar) == 0) {
|
||||
sub_020553F0(v0->fieldSystem, 0);
|
||||
sub_02055554(v0->fieldSystem, 1151, 1);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if (sub_0205F108(v0->playerAvatar) == 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(v0->playerAvatar) == 0) {
|
||||
int v1 = Player_GetXPos(v0->playerAvatar) + sub_0206419C(v0->unk_04);
|
||||
int v2 = Player_GetZPos(v0->playerAvatar) + sub_020641A8(v0->unk_04);
|
||||
|
||||
@@ -651,7 +651,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
int v3 = MapObject_GetXPos(v0->unk_24);
|
||||
int v4 = ((MapObject_GetYPos(v0->unk_24) / 2));
|
||||
int v5 = MapObject_GetZPos(v0->unk_24);
|
||||
int v6 = sub_0205F108(v0->playerAvatar);
|
||||
int v6 = PlayerAvatar_DistortionWorldState(v0->playerAvatar);
|
||||
|
||||
sub_02061674(v0->playerAvatar, v0->unk_04, &v3, &v4, &v5);
|
||||
v0->unk_28 = ov5_021F85BC(v0->playerAvatar, v3, v4, v5, v0->unk_04, 0, v6);
|
||||
@@ -671,7 +671,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
int v8[6] = {
|
||||
0x34, 0x34, 0x34, 0x85, 0x89, 0x8d
|
||||
};
|
||||
int v9 = sub_0205F108(v0->playerAvatar);
|
||||
int v9 = PlayerAvatar_DistortionWorldState(v0->playerAvatar);
|
||||
|
||||
v7 = sub_02065838(v0->unk_04, v8[v9]);
|
||||
LocalMapObj_SetAnimationCode(v0->unk_24, v7);
|
||||
@@ -685,7 +685,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
|
||||
sub_020656AC(v0->unk_24);
|
||||
|
||||
if (sub_0205F108(v0->playerAvatar) == 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(v0->playerAvatar) == 0) {
|
||||
int v10;
|
||||
|
||||
ov5_021F2838(v0->unk_28, 1);
|
||||
@@ -763,7 +763,7 @@ static BOOL ov5_021E03C8 (TaskManager * param0)
|
||||
0x34, 0x34, 0x34, 0x85, 0x89, 0x8d
|
||||
};
|
||||
|
||||
v2 = sub_0205F108(v0->playerAvatar);
|
||||
v2 = PlayerAvatar_DistortionWorldState(v0->playerAvatar);
|
||||
|
||||
if (v2 == 0) {
|
||||
ov5_021F2838(v0->unk_14, 0);
|
||||
@@ -1727,7 +1727,7 @@ static void PlayerAvatar_Redraw (PlayerAvatar * playerAvatar, int param1)
|
||||
{
|
||||
MapObject * v0 = Player_MapObject(playerAvatar);
|
||||
|
||||
if (sub_0205F108(playerAvatar) == 0) {
|
||||
if (PlayerAvatar_DistortionWorldState(playerAvatar) == 0) {
|
||||
ov5_021EE3FC(v0, param1, NULL, NULL);
|
||||
} else {
|
||||
int v1;
|
||||
|
||||
@@ -170,7 +170,7 @@ static void ov5_021F86E4 (UnkStruct_ov101_021D5D90 * param0, void * param1)
|
||||
}
|
||||
|
||||
v0->unk_04 = MapObject_GetMoveDir(v1);
|
||||
v0->unk_34 = sub_0205F108(playerAvatar);
|
||||
v0->unk_34 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
GF_ASSERT(v0->unk_04 != -1);
|
||||
|
||||
|
||||
@@ -858,35 +858,35 @@ void sub_0205F098 (PlayerAvatar * playerAvatar, int param1)
|
||||
GF_ASSERT(0);
|
||||
}
|
||||
|
||||
int sub_0205F108 (PlayerAvatar * const playerAvatar)
|
||||
int PlayerAvatar_DistortionWorldState (PlayerAvatar * const playerAvatar)
|
||||
{
|
||||
int v0 = 0;
|
||||
int state = AVATAR_DISTORTION_STATE_NONE;
|
||||
u32 v1 = sub_0205EBB0(playerAvatar, ((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12)));
|
||||
|
||||
switch (v1) {
|
||||
case (1 << 8):
|
||||
v0 = 1;
|
||||
state = AVATAR_DISTORTION_STATE_ACTIVE;
|
||||
break;
|
||||
case (1 << 9):
|
||||
v0 = 2;
|
||||
state = AVATAR_DISTORTION_STATE_FLOOR;
|
||||
break;
|
||||
case (1 << 10):
|
||||
v0 = 3;
|
||||
state = AVATAR_DISTORTION_STATE_WEST_WALL;
|
||||
break;
|
||||
case (1 << 11):
|
||||
v0 = 4;
|
||||
state = AVATAR_DISTORTION_STATE_EAST_WALL;
|
||||
break;
|
||||
case (1 << 12):
|
||||
v0 = 5;
|
||||
state = AVATAR_DISTORTION_STATE_CEILING;
|
||||
break;
|
||||
}
|
||||
|
||||
return v0;
|
||||
return state;
|
||||
}
|
||||
|
||||
BOOL sub_0205F158 (PlayerAvatar * const playerAvatar)
|
||||
{
|
||||
int v0 = sub_0205F108(playerAvatar);
|
||||
int v0 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
if ((v0 == 0) || (v0 == 1)) {
|
||||
return FALSE;
|
||||
@@ -897,7 +897,7 @@ BOOL sub_0205F158 (PlayerAvatar * const playerAvatar)
|
||||
|
||||
BOOL sub_0205F16C (PlayerAvatar * const playerAvatar)
|
||||
{
|
||||
int v0 = sub_0205F108(playerAvatar);
|
||||
int v0 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
if ((v0 == 0) || (v0 == 1) || (v0 == 2)) {
|
||||
return TRUE;
|
||||
|
||||
@@ -199,7 +199,7 @@ static int PlayerAvatar_CheckStartMoveInternal (PlayerAvatar * playerAvatar, int
|
||||
if (sub_0205F158(playerAvatar) == 1) {
|
||||
v2 = sub_020611FC(playerAvatar, mapObj, dir);
|
||||
|
||||
if ((v2 & (~(1 << 7))) && (sub_0205F108(playerAvatar) == 2)) {
|
||||
if ((v2 & (~(1 << 7))) && (PlayerAvatar_DistortionWorldState(playerAvatar) == 2)) {
|
||||
FieldSystem * fieldSystem = MapObject_FieldSystem(mapObj);
|
||||
int xOut, x = MapObject_GetXPos(mapObj);
|
||||
int yOut, y = MapObject_GetYPos(mapObj);
|
||||
@@ -861,7 +861,7 @@ static int sub_0205FCC0 (PlayerAvatar * playerAvatar, int param1)
|
||||
v0 = PlayerAvatar_GetDir(playerAvatar);
|
||||
|
||||
{
|
||||
int v1 = sub_0205F108(playerAvatar);
|
||||
int v1 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
if ((v1 != 0) && (v1 != 1) && (v1 != 2)) {
|
||||
v0 = PlayerAvatar_GetMoveDir(playerAvatar);
|
||||
@@ -887,7 +887,7 @@ static void sub_0205FD20 (PlayerAvatar * playerAvatar, MapObject * param1, int p
|
||||
|
||||
static void sub_0205FD40 (PlayerAvatar * playerAvatar, MapObject * param1, int param2, u16 param3, u16 param4)
|
||||
{
|
||||
int v0 = sub_0205F108(playerAvatar);
|
||||
int v0 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
switch (v0) {
|
||||
case 2:
|
||||
@@ -1130,7 +1130,7 @@ static void sub_02060258 (PlayerAvatar * playerAvatar, MapObject * mapObj, int p
|
||||
int v2;
|
||||
|
||||
v1 = param2;
|
||||
v2 = sub_0205F108(playerAvatar);
|
||||
v2 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
switch (v2) {
|
||||
case 3:
|
||||
@@ -2077,7 +2077,7 @@ static int sub_02061248 (PlayerAvatar * playerAvatar, MapObject * mapObj, int pa
|
||||
{
|
||||
BOOL v0 = 0;
|
||||
|
||||
if ((param2 != -1) && (sub_0205F108(playerAvatar) == 2)) {
|
||||
if ((param2 != -1) && (PlayerAvatar_DistortionWorldState(playerAvatar) == 2)) {
|
||||
FieldSystem * fieldSystem = MapObject_FieldSystem(mapObj);
|
||||
|
||||
if (sub_02071CB4(fieldSystem, 9) == 1) {
|
||||
@@ -2420,7 +2420,7 @@ static int PlayerAvatar_IsUnderCyclingRoad (PlayerAvatar * playerAvatar, u32 par
|
||||
void sub_02061674 (PlayerAvatar * playerAvatar, int param1, int * param2, int * param3, int * param4)
|
||||
{
|
||||
const UnkStruct_020EDB04 * v0;
|
||||
int v1 = sub_0205F108(playerAvatar);
|
||||
int v1 = PlayerAvatar_DistortionWorldState(playerAvatar);
|
||||
|
||||
switch (v1) {
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user