Skip to content

Commit

Permalink
zEntPlayer_MoveInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
escape209 authored and SquareMan committed Aug 7, 2024
1 parent f44e6fa commit 142a66a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/SB/Game/zEntPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3631,6 +3631,64 @@ S32 zEntPlayer_Damage(xBase* src, U32 damage, const xVec3* knockback)
return true;
}

S32 zEntPlayer_MoveInfo()
{
U32 flags = 0;
U32 userFlags1e = globals.player.ent.model->Anim->Single->State->UserFlags & 0x1e;
const char* animName = globals.player.ent.model->Anim->Single->State->Name;

if (userFlags1e == 0 || globals.player.ent.model->Anim->Single->State->UserFlags & 1)
{
flags |= 1;
}

if (userFlags1e == 4)
{
flags |= 2;
}

if ((userFlags1e == 6) || (userFlags1e == 8))
{
flags |= 4;
}

if (globals.player.IsBubbleSpinning || strcmp(animName,"Bspin01") == 0)
{
flags |= 0x20;
}

if (strcmp(animName,"BbashStart01") == 0)
{
flags |= 8;
}

if
(
(strcmp(animName,"BbounceStrike01") == 0) ||
(strcmp(animName,"BbounceStart01") == 0) ||
(strcmp(animName,"BbounceAttack01") == 0))
{
flags |= 0x10;
}

if (userFlags1e == 0xe)
{
flags |= 0x10;
}

if (userFlags1e == 0xc)
{
flags |= 0x20;
}

if (userFlags1e == 2 || flags & 1 || flags & 2)
{
flags |= 0x40;
}

return flags;
}

void zEntPlayer_GiveHealth(S32 quantity)
{
if (quantity < 0 && -quantity > (S32)globals.player.Health)
Expand Down
2 changes: 2 additions & 0 deletions src/SB/Game/zEntPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ void zEntPlayer_LoadCheckPoint();
void zEntPlayer_MinimalRender(zEnt* ent);
U8 zEntPlayer_MinimalUpdate(xEnt* ent, xScene* sc, F32 dt, xVec3& drive_motion);

S32 zEntPlayer_MoveInfo();

void zEntPlayer_SNDPlay(_tagePlayerSnd player_snd, F32 delay);
void zEntPlayer_SNDPlayStream(_tagePlayerStreamSnd player_snd);
void zEntPlayer_SNDPlayStream(_tagePlayerStreamSnd player_snd, U32 flags);
Expand Down

0 comments on commit 142a66a

Please sign in to comment.