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

Player Docs: Player_ActionChange_6, Rolling and Put Away #1949

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/z64player.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ typedef struct {
#define PLAYER_STATE2_17 (1 << 17)
#define PLAYER_STATE2_CRAWLING (1 << 18) // Crawling through a crawlspace
#define PLAYER_STATE2_19 (1 << 19)
#define PLAYER_STATE2_20 (1 << 20)
#define PLAYER_STATE2_NAVI_ACTIVE (1 << 20) // Navi is visible and active. Could be hovering idle near Link or hovering over other actors.
#define PLAYER_STATE2_21 (1 << 21)
#define PLAYER_STATE2_22 (1 << 22)
#define PLAYER_STATE2_23 (1 << 23)
Expand Down Expand Up @@ -835,7 +835,7 @@ typedef struct Player {
/* 0x0830 */ f32 upperAnimInterpWeight;
/* 0x0834 */ s16 unk_834;
/* 0x0836 */ s8 unk_836;
/* 0x0837 */ u8 unk_837;
/* 0x0837 */ u8 putAwayCooldownTimer;
/* 0x0838 */ f32 speedXZ; // Controls horizontal speed, used for `actor.speed`. Current or target value depending on context.
/* 0x083C */ s16 yaw; // General yaw value, used both for world and shape rotation. Current or target value depending on context.
/* 0x083E */ s16 zTargetYaw; // yaw relating to Z targeting/"parallel" mode
Expand All @@ -854,6 +854,7 @@ typedef struct Player {

/* 0x0850 */ union {
s16 actionVar2;
s16 bonked; // Player_Action_Roll: set to true after bonking into a wall or an actor
} av2; // "Action Variable 2": context dependent variable that has different meanings depending on what action is currently running

/* 0x0854 */ f32 unk_854;
Expand Down
12 changes: 6 additions & 6 deletions src/overlays/actors/ovl_En_Elf/z_en_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ void func_80A0461C(EnElf* this, PlayState* play) {
} else if (arrowPointedActor == NULL || arrowPointedActor->category == ACTORCAT_NPC) {
if (arrowPointedActor != NULL) {
this->unk_2C0 = 100;
player->stateFlags2 |= PLAYER_STATE2_20;
player->stateFlags2 |= PLAYER_STATE2_NAVI_ACTIVE;
temp = 0;
} else {
switch (this->unk_2A8) {
Expand All @@ -1116,7 +1116,7 @@ void func_80A0461C(EnElf* this, PlayState* play) {
this->unk_2AE--;
temp = 7;
} else {
player->stateFlags2 |= PLAYER_STATE2_20;
player->stateFlags2 |= PLAYER_STATE2_NAVI_ACTIVE;
temp = 0;
}
} else {
Expand Down Expand Up @@ -1146,15 +1146,15 @@ void func_80A0461C(EnElf* this, PlayState* play) {

switch (temp) {
case 0:
if (!(player->stateFlags2 & PLAYER_STATE2_20)) {
if (!(player->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE)) {
temp = 7;
if (this->unk_2C7 == 0) {
Actor_PlaySfx(&this->actor, NA_SE_EV_NAVY_VANISH);
}
}
break;
case 8:
if (player->stateFlags2 & PLAYER_STATE2_20) {
if (player->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE) {
func_80A0299C(this, 0x32);
this->unk_2C0 = 42;
temp = 11;
Expand All @@ -1164,10 +1164,10 @@ void func_80A0461C(EnElf* this, PlayState* play) {
}
break;
case 7:
player->stateFlags2 &= ~PLAYER_STATE2_20;
player->stateFlags2 &= ~PLAYER_STATE2_NAVI_ACTIVE;
break;
default:
player->stateFlags2 |= PLAYER_STATE2_20;
player->stateFlags2 |= PLAYER_STATE2_NAVI_ACTIVE;
break;
}
}
Expand Down