Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zEntPlayer_MoveInfo #346

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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