1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 07:21:19 +00:00

Defines for player state flags (#1081)

* script-assisted player state flags

* Run formatter

* manually convert state flags in `D_80116068`

* `PLAYER_STATE_FLAG_` -> `PLAYER_STATE`

* Run formatter
This commit is contained in:
Dragorn421 2022-01-18 01:04:07 +01:00 committed by GitHub
parent 2a4fb604fb
commit 6479913daa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 945 additions and 810 deletions

View file

@ -178,17 +178,17 @@ void func_80A1DBD4(EnFu* this, GlobalContext* globalCtx) {
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_00;
gSaveContext.eventChkInf[6] |= 0x20;
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_02) {
player->stateFlags2 &= ~0x1000000;
player->stateFlags2 &= ~PLAYER_STATE2_24;
this->actionFunc = EnFu_WaitAdult;
} else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_01) {
player->stateFlags2 |= 0x800000;
player->stateFlags2 |= PLAYER_STATE2_23;
}
}
void EnFu_WaitForPlayback(EnFu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
player->stateFlags2 |= 0x800000;
player->stateFlags2 |= PLAYER_STATE2_23;
// if dialog state is 7, player has played back the song
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_SONG_DEMO_DONE) {
func_8010BD58(globalCtx, OCARINA_ACTION_PLAYBACK_STORMS);
@ -199,7 +199,7 @@ void EnFu_WaitForPlayback(EnFu* this, GlobalContext* globalCtx) {
void EnFu_TeachSong(EnFu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
player->stateFlags2 |= 0x800000;
player->stateFlags2 |= PLAYER_STATE2_23;
// if dialog state is 2, start song demonstration
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
this->behaviorFlags &= ~FU_WAIT;
@ -216,7 +216,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) {
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if ((gSaveContext.eventChkInf[5] & 0x800)) {
func_80A1D94C(this, globalCtx, 0x508E, func_80A1DBA0);
} else if (player->stateFlags2 & 0x1000000) {
} else if (player->stateFlags2 & PLAYER_STATE2_24) {
this->actor.textId = 0x5035;
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
this->actionFunc = EnFu_TeachSong;
@ -227,7 +227,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) {
if (this->actor.xzDistToPlayer < 100.0f) {
this->actor.textId = 0x5034;
func_8002F2CC(&this->actor, globalCtx, 100.0f);
player->stateFlags2 |= 0x800000;
player->stateFlags2 |= PLAYER_STATE2_23;
}
}
}