Finish porting/decompiling field_player_avatar

This commit is contained in:
Diegoisawesome
2018-10-19 00:05:54 -05:00
parent 6206acd2d2
commit dd3689fdbf
13 changed files with 1652 additions and 4356 deletions

View File

@@ -18,7 +18,7 @@ extern u8 sub_808B980(u8 direction);
extern u8 sub_808B9BC(u8 direction);
extern u8 sub_808B9A4(u8 direction);
extern u8 sub_808C1B4(u8 direction);
extern u8 npc_use_some_d2s(u8 direction);
extern u8 sub_808B9D4(u8 direction);
extern void Overworld_ClearSavedMusic(void);
extern void Overworld_PlaySpecialMapMusic(void);
@@ -575,7 +575,7 @@ static void AcroBikeTransition_Moving(u8 direction)
}
else
{
PlayerGoSpeed3(direction);
PlayerRideWaterCurrent(direction);
}
}
@@ -768,7 +768,7 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction)
PlayerEndWheelie(direction);
return;
}
npc_use_some_d2s(direction);
sub_808B9D4(direction);
}
void Bike_TryAcroBikeHistoryUpdate(u16 newKeys, u16 heldKeys)
@@ -968,7 +968,7 @@ bool8 IsBikingDisallowedByPlayer(void)
s16 x, y;
u8 tileBehavior;
if (!(gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_SURFING | PLAYER_AVATAR_FLAG_4)))
if (!(gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_SURFING | PLAYER_AVATAR_FLAG_UNDERWATER)))
{
PlayerGetDestCoords(&x, &y);
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);

File diff suppressed because it is too large Load Diff

View File

@@ -260,7 +260,7 @@ bool32 CanFish(void)
if (MetatileBehavior_IsWaterfall(tileBehavior))
return FALSE;
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_4))
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_UNDERWATER))
return FALSE;
if (!TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))

View File

@@ -166,8 +166,8 @@ extern u32 sub_800B4DC(void);
extern bool32 sub_80B39D4(u8);
extern const u8* GetInteractedLinkPlayerScript(struct MapPosition *a1, u8, u8);
extern u8 *GetCoordEventScriptAtMapPosition(void*);
extern u8 sub_808BD6C(u8);
extern u8 sub_808BD7C(u8);
extern u8 GetFRLGAvatarGraphicsIdByGender(u8);
extern u8 GetRSAvatarGraphicsIdByGender(u8);
extern void UpdateEventObjectSpriteVisibility(struct Sprite*, u8);
// this file's functions
@@ -919,7 +919,7 @@ void StoreInitialPlayerAvatarState(void)
gInitialPlayerAvatarState.transitionFlags = 4;
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))
gInitialPlayerAvatarState.transitionFlags = 8;
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_4))
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_UNDERWATER))
gInitialPlayerAvatarState.transitionFlags = 16;
else
gInitialPlayerAvatarState.transitionFlags = 1;
@@ -3137,11 +3137,11 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion)
{
case VERSION_FIRE_RED:
case VERSION_LEAF_GREEN:
eventObj->spriteId = AddPseudoEventObject(sub_808BD6C(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
eventObj->spriteId = AddPseudoEventObject(GetFRLGAvatarGraphicsIdByGender(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
break;
case VERSION_RUBY:
case VERSION_SAPPHIRE:
eventObj->spriteId = AddPseudoEventObject(sub_808BD7C(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
eventObj->spriteId = AddPseudoEventObject(GetRSAvatarGraphicsIdByGender(eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);
break;
case VERSION_EMERALD:
eventObj->spriteId = AddPseudoEventObject(GetRivalAvatarGraphicsIdByStateIdAndGender(0, eventObj->singleMovementActive), SpriteCB_LinkPlayer, 0, 0, 0);