mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 22:41:14 +00:00
Misc. doc/cleanup 5 (#1096)
* `0` -> `CHEST_ANIM_SHORT` in `GET_ITEM` z_player macro * fix typos in z_en_skj Co-authored-by: Yanis42 <yalink88@gmail.com> * `unkSkjStruct` -> `EnSkjUnkStruct` * Use `EFFECT_SS_` enum in all `EffectSs_Spawn` calls * Decimal for all `EffectSs_Spawn` priorities * Use `OBJECT_INVALID` more * `Object_IsLoaded` returns a boolean * Add `@bug` in `DmaMgr_SendRequestImpl` about passing partially uninitialized struct * Fix typo `forc_structure_alignment` -> "force" * Move `CMD_F` to `z64cutscene_commands.h` since it is specifically for cutscene data * Use `ALIGN16` macro more * Use `ALIGN256` macro more * Add `@bug` on two messed up 8-bytes-aligns * Set `gSaveContext.nightFlag` to 0/1 instead of false/true * Use `IS_DAY` macro more * Run formatter Co-authored-by: Yanis42 <yalink88@gmail.com>
This commit is contained in:
parent
11917bf640
commit
e5ecdfd559
20 changed files with 61 additions and 59 deletions
|
@ -115,7 +115,7 @@ typedef enum {
|
|||
} SkullKidStumpSide;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ SKULL_KID_OCRAINA_WAIT,
|
||||
/* 0 */ SKULL_KID_OCARINA_WAIT,
|
||||
/* 1 */ SKULL_KID_OCARINA_PLAY_NOTES,
|
||||
/* 2 */ SKULL_KID_OCARINA_LEAVE_GAME
|
||||
} SkullKidOcarinaGameState;
|
||||
|
@ -155,10 +155,10 @@ typedef enum {
|
|||
typedef struct {
|
||||
u8 unk0;
|
||||
EnSkj* skullkid;
|
||||
} unkSkjStruct;
|
||||
} EnSkjUnkStruct;
|
||||
|
||||
static unkSkjStruct sSmallStumpSkullKid = { 0, NULL };
|
||||
static unkSkjStruct sOcarinaMinigameSkullKids[] = { { 0, NULL }, { 0, NULL } };
|
||||
static EnSkjUnkStruct sSmallStumpSkullKid = { 0, NULL };
|
||||
static EnSkjUnkStruct sOcarinaMinigameSkullKids[] = { { 0, NULL }, { 0, NULL } };
|
||||
|
||||
const ActorInit En_Skj_InitVars = {
|
||||
ACTOR_EN_SKJ,
|
||||
|
@ -438,7 +438,7 @@ void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Actor_SetScale(thisx, 0.01f);
|
||||
this->actor.textId = this->textId = 0;
|
||||
this->multiuseTimer = 0;
|
||||
this->backfilpFlag = 0;
|
||||
this->backflipFlag = 0;
|
||||
this->needlesToShoot = 3;
|
||||
this->hitsUntilDodge = 3;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
@ -615,7 +615,7 @@ s32 EnSkj_CollisionCheck(EnSkj* this, GlobalContext* globalCtx) {
|
|||
return 1;
|
||||
}
|
||||
} else {
|
||||
this->backfilpFlag = 1;
|
||||
this->backflipFlag = 1;
|
||||
EnSkj_Backflip(this);
|
||||
return 1;
|
||||
}
|
||||
|
@ -660,7 +660,7 @@ void EnSkj_Fade(EnSkj* this, GlobalContext* globalCtx) {
|
|||
|
||||
alpha -= 20;
|
||||
|
||||
if (this->backfilpFlag != 0) {
|
||||
if (this->backflipFlag != 0) {
|
||||
if (alpha > 255) {
|
||||
alpha = 0;
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ void EnSkj_SetupResetFight(EnSkj* this) {
|
|||
void EnSkj_SariasSongKidIdle(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.params == 0) {
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x40) && (this->actor.xzDistToPlayer < 200.0f)) {
|
||||
this->backfilpFlag = 1;
|
||||
this->backflipFlag = 1;
|
||||
EnSkj_Backflip(this);
|
||||
} else if (sSmallStumpSkullKid.unk0 != 0) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
@ -837,7 +837,7 @@ void EnSkj_Fight(EnSkj* this, GlobalContext* globalCtx) {
|
|||
this->skelAnime.playSpeed = (yawDistToPlayer < 0) ? -(1.0f + phi_f14) : (1.0f + phi_f14);
|
||||
|
||||
} else if (func_80AFEDF8(this, globalCtx) != 0) {
|
||||
this->backfilpFlag = 1;
|
||||
this->backflipFlag = 1;
|
||||
EnSkj_Backflip(this);
|
||||
} else {
|
||||
EnSkj_SetupResetFight(this);
|
||||
|
@ -856,7 +856,7 @@ void EnSkj_NeedleRecover(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkj_SetupSpawnDeathEffect(EnSkj* this) {
|
||||
this->backfilpFlag = 1;
|
||||
this->backflipFlag = 1;
|
||||
EnSkj_SetupAction(this, SKJ_ACTION_SPAWN_DEATH_EFFECT);
|
||||
}
|
||||
|
||||
|
@ -1172,7 +1172,7 @@ void EnSkj_SetupWaitForMaskTextClear(EnSkj* this) {
|
|||
void EnSkj_WaitForMaskTextClear(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_8002DF54(globalCtx, &this->actor, 7);
|
||||
this->backfilpFlag = 1;
|
||||
this->backflipFlag = 1;
|
||||
EnSkj_Backflip(this);
|
||||
}
|
||||
}
|
||||
|
@ -1277,7 +1277,7 @@ void EnSkj_LeaveOcarinaGame(EnSkj* this, GlobalContext* globalCtx) {
|
|||
|
||||
sOcarinaMinigameSkullKids[paramsDecr].unk0 = 0;
|
||||
sOcarinaMinigameSkullKids[paramsDecr].skullkid = NULL;
|
||||
this->backfilpFlag = 1;
|
||||
this->backflipFlag = 1;
|
||||
EnSkj_Backflip(this);
|
||||
}
|
||||
|
||||
|
@ -1306,7 +1306,7 @@ void EnSkj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->hitsUntilDodge = 3;
|
||||
}
|
||||
|
||||
if ((this->backfilpFlag != 0) && (this->alpha == 0)) {
|
||||
if ((this->backflipFlag != 0) && (this->alpha == 0)) {
|
||||
if (this->action == 9) {
|
||||
dropPos.x = this->actor.world.pos.x;
|
||||
dropPos.y = this->actor.world.pos.y;
|
||||
|
@ -1432,7 +1432,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
|
|||
switch (globalCtx->msgCtx.msgMode) {
|
||||
case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_WAIT:
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid != NULL) {
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_LEFT].skullkid->minigameState = SKULL_KID_OCARINA_WAIT;
|
||||
}
|
||||
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
|
||||
|
@ -1444,7 +1444,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_WAIT:
|
||||
if (sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid != NULL) {
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCRAINA_WAIT;
|
||||
sOcarinaMinigameSkullKids[SKULL_KID_RIGHT].skullkid->minigameState = SKULL_KID_OCARINA_WAIT;
|
||||
}
|
||||
if (!Audio_IsSfxPlaying(NA_SE_SY_METRONOME)) {
|
||||
Message_UpdateOcarinaGame(globalCtx);
|
||||
|
|
|
@ -23,7 +23,7 @@ typedef struct EnSkj {
|
|||
/* 0x02CE */ s16 dodgeResetTimer;
|
||||
/* 0x02D0 */ u8 animIndex;
|
||||
/* 0x02D1 */ u8 action;
|
||||
/* 0x02D2 */ u8 backfilpFlag;
|
||||
/* 0x02D2 */ u8 backflipFlag;
|
||||
/* 0x02D3 */ u8 unk_2D3; // Is set to zero when walking to trade for skull mask and set to 1 when dying
|
||||
/* 0x02D4 */ u8 needlesToShoot;
|
||||
/* 0x02D5 */ u8 hitsUntilDodge; // Upon reaching zero will always backflip to avoid stun lock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue