mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-24 07:51:48 +00:00
Use defines for actor flags (#873)
* Add ACTOR_FLAG_ defines * Add ACTOR_FLAGS_ALL macro and use ACTOR_FLAG_* constants everywhere * Remove unused ACTOR_FLAG_* constants * actor flags in bigokuta & ko * actor flags in obj_mure * actor flags in stalfos, twinrova & ganon2 * actor flags in morpha & barinade * name some previously missed actor flags * found some comments using hex for actor flags * Actor flags in ovl_En_Ganon_Mant * Actor flags in EnWf * Flags in en_zf * Actor flags in BossGanon (FeelsOKMan) * Remove `ACTOR_FLAG_NONE` * Wrap expansion of `FLAGS` in parentheses * `ACTOR_FLAGS_ALL` -> `CHECK_FLAG_ALL` * Move `CHECK_FLAG_ALL` to `macros.h` * Run formatter
This commit is contained in:
parent
79220ba58a
commit
a9284494f2
439 changed files with 1342 additions and 1304 deletions
|
@ -9,7 +9,7 @@
|
|||
#include "overlays/actors/ovl_En_Boom/z_en_boom.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define FLAGS 0x00000035
|
||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5)
|
||||
|
||||
#define GET_BODY(this) ((BossVa*)(this)->actor.parent)
|
||||
#define vaGorePulse offset.x
|
||||
|
@ -587,7 +587,7 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
switch (this->actor.params) {
|
||||
case BOSSVA_BODY:
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &gBarinadeBodySkel, &gBarinadeBodyAnim, NULL, NULL, 0);
|
||||
this->actor.flags |= 0x1000000;
|
||||
this->actor.flags |= ACTOR_FLAG_24;
|
||||
break;
|
||||
case BOSSVA_SUPPORT_1:
|
||||
case BOSSVA_SUPPORT_2:
|
||||
|
@ -607,7 +607,7 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gBarinadeStumpSkel, &gBarinadeStumpAnim, NULL, NULL, 0);
|
||||
break;
|
||||
default:
|
||||
this->actor.flags |= 0x1000000;
|
||||
this->actor.flags |= ACTOR_FLAG_24;
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &gBarinadeBariSkel, &gBarinadeBariAnim, NULL, NULL, 0);
|
||||
this->actor.shape.yOffset = 400.0f;
|
||||
break;
|
||||
|
@ -757,7 +757,7 @@ void BossVa_SetupIntro(BossVa* this) {
|
|||
|
||||
Animation_Change(&this->skelAnime, &gBarinadeBodyAnim, 1.0f, lastFrame, lastFrame, ANIMMODE_ONCE, 0.0f);
|
||||
this->actor.shape.yOffset = -450.0f;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_BodyIntro);
|
||||
}
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ void BossVa_SetupBodyPhase1(BossVa* this) {
|
|||
|
||||
Animation_Change(&this->skelAnime, &gBarinadeBodyAnim, 1.0f, lastFrame, lastFrame, ANIMMODE_ONCE, 0.0f);
|
||||
this->actor.shape.yOffset = -450.0f;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->timer = 25;
|
||||
sBodyState = 0x80;
|
||||
BossVa_SetupAction(this, BossVa_BodyPhase1);
|
||||
|
@ -1116,7 +1116,7 @@ void BossVa_SetupBodyPhase2(BossVa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
this->invincibilityTimer = 0;
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_BodyPhase2);
|
||||
}
|
||||
|
||||
|
@ -1182,10 +1182,10 @@ void BossVa_BodyPhase2(BossVa* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 1, 0xC8, 0);
|
||||
Math_SmoothStepToF(&this->actor.shape.yOffset, -1000.0f, 1.0f, 20.0f, 0.0f);
|
||||
if (!(sPhase2Timer & 0x100)) {
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
this->actor.speedXZ = 1.0f;
|
||||
} else {
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
||||
|
@ -1248,7 +1248,7 @@ void BossVa_BodyPhase3(BossVa* this, GlobalContext* globalCtx) {
|
|||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BALINADE_FAINT);
|
||||
sBodyState = 1;
|
||||
this->timer = 131;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
} else {
|
||||
sBodyState = 0;
|
||||
if (this->timer == 0) {
|
||||
|
@ -1258,7 +1258,7 @@ void BossVa_BodyPhase3(BossVa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 3.0f, 1.0f, 0.15f, 0.0f);
|
||||
}
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
} else {
|
||||
this->timer--;
|
||||
if (this->timer < 35) {
|
||||
|
@ -1333,7 +1333,7 @@ void BossVa_BodyPhase3(BossVa* this, GlobalContext* globalCtx) {
|
|||
|
||||
void BossVa_SetupBodyPhase4(BossVa* this, GlobalContext* globalCtx) {
|
||||
this->unk_1AC = 0;
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
this->vaBodySpinRate = this->unk_1AC;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->timer2 = (s16)(Rand_ZeroOne() * 150.0f) + 300;
|
||||
|
@ -1512,7 +1512,7 @@ void BossVa_BodyPhase4(BossVa* this, GlobalContext* globalCtx) {
|
|||
|
||||
void BossVa_SetupBodyDeath(BossVa* this, GlobalContext* globalCtx) {
|
||||
func_800F436C(&this->actor.projectedPos, NA_SE_EN_BALINADE_LEVEL - SFX_FLAG, 1.0f);
|
||||
this->actor.flags &= ~5;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF);
|
||||
this->vaCamRotMod = 0xC31;
|
||||
sCsState = DEATH_START;
|
||||
|
@ -1802,7 +1802,7 @@ void BossVa_SupportCut(BossVa* this, GlobalContext* globalCtx) {
|
|||
lastFrame = Animation_GetLastFrame(&gBarinadeSupportDetachedAnim);
|
||||
Animation_Change(&this->skelAnime, &gBarinadeSupportDetachedAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_LOOP_INTERP,
|
||||
0.0f);
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
}
|
||||
|
||||
if ((this->timer == 0) && (sCsState < DEATH_START)) {
|
||||
|
@ -1856,7 +1856,7 @@ void BossVa_SupportCut(BossVa* this, GlobalContext* globalCtx) {
|
|||
void BossVa_SetupStump(BossVa* this, GlobalContext* globalCtx) {
|
||||
Animation_Change(&this->skelAnime, &gBarinadeStumpAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gBarinadeStumpAnim),
|
||||
ANIMMODE_ONCE, 0.0f);
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_Stump);
|
||||
}
|
||||
|
||||
|
@ -1875,7 +1875,7 @@ void BossVa_SetupZapperIntro(BossVa* this, GlobalContext* globalCtx) {
|
|||
|
||||
Animation_Change(&this->skelAnime, &gBarinadeZapperIdleAnim, 1.0f, lastFrame - 1.0f, lastFrame,
|
||||
ANIMMODE_LOOP_INTERP, -6.0f);
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_ZapperIntro);
|
||||
}
|
||||
|
||||
|
@ -1902,7 +1902,7 @@ void BossVa_SetupZapperAttack(BossVa* this, GlobalContext* globalCtx) {
|
|||
|
||||
Animation_Change(&this->skelAnime, &gBarinadeZapperIdleAnim, 1.0f, lastFrame - 1.0f, lastFrame,
|
||||
ANIMMODE_LOOP_INTERP, -6.0f);
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_ZapperAttack);
|
||||
}
|
||||
|
||||
|
@ -2399,7 +2399,7 @@ void BossVa_SetupBariIntro(BossVa* this, GlobalContext* globalCtx) {
|
|||
this->actor.world.pos.y = sInitPosOffsets[this->actor.params + 10].y + this->actor.home.pos.y;
|
||||
this->actor.world.pos.z = sInitPosOffsets[this->actor.params + 10].z + this->actor.home.pos.z;
|
||||
this->timer = 45;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_BariIntro);
|
||||
}
|
||||
|
||||
|
@ -2520,7 +2520,7 @@ void BossVa_SetupBariPhase3Attack(BossVa* this, GlobalContext* globalCtx) {
|
|||
this->unk_1F0 = 0x78;
|
||||
this->unk_1A0 = 60.0f;
|
||||
this->unk_1A8 = 0.0f;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_BariPhase3Attack);
|
||||
}
|
||||
|
||||
|
@ -2607,7 +2607,7 @@ void BossVa_SetupBariPhase2Attack(BossVa* this, GlobalContext* globalCtx) {
|
|||
this->unk_1F0 = 0x78;
|
||||
this->unk_1A0 = 60.0f;
|
||||
this->unk_1A8 = 0.0f;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_BariPhase2Attack);
|
||||
}
|
||||
|
||||
|
@ -2657,7 +2657,7 @@ void BossVa_BariPhase2Attack(BossVa* this, GlobalContext* globalCtx) {
|
|||
if (!(sPhase2Timer & 0x100) && (GET_BODY(this)->actor.colorFilterTimer == 0)) {
|
||||
sp4C = 200.0f;
|
||||
BossVa_Spark(globalCtx, this, 1, 125, 15.0f, 7.0f, SPARK_TETHER, 1.0f, true);
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
if (this->actor.params & 1) {
|
||||
sp4C = -200.0f;
|
||||
}
|
||||
|
@ -2680,7 +2680,7 @@ void BossVa_BariPhase2Attack(BossVa* this, GlobalContext* globalCtx) {
|
|||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderLightning.base);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base);
|
||||
} else {
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
Math_SmoothStepToS(&this->unk_1AC, sp50 + 150, 1, 0x3C, 0);
|
||||
if (GET_BODY(this)->actor.colorFilterTimer == 0) {
|
||||
Math_SmoothStepToF(&this->unk_1A0, 180.0f, 1.0f, 1.5f, 0.0f);
|
||||
|
@ -2720,7 +2720,7 @@ void BossVa_BariPhase2Attack(BossVa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void BossVa_SetupBariPhase3Stunned(BossVa* this, GlobalContext* globalCtx) {
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
this->timer = GET_BODY(this)->timer;
|
||||
Actor_SetColorFilter(&this->actor, 0, 255, 0x2000, this->timer);
|
||||
BossVa_SetupAction(this, BossVa_BariPhase3Stunned);
|
||||
|
@ -2753,7 +2753,7 @@ void BossVa_BariPhase3Stunned(BossVa* this, GlobalContext* globalCtx) {
|
|||
} else {
|
||||
BossVa_Spark(globalCtx, this, 1, 85, 15.0f, 0.0f, SPARK_TETHER, 1.0f, true);
|
||||
if (this->timer2 >= 0x10) {
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->timer2 = 0x80;
|
||||
BossVa_SetupAction(this, BossVa_BariPhase3Attack);
|
||||
}
|
||||
|
@ -2762,7 +2762,7 @@ void BossVa_BariPhase3Stunned(BossVa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void BossVa_SetupBariDeath(BossVa* this) {
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->timer = 30;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BALINADE_BL_DEAD);
|
||||
this->isDead++;
|
||||
|
@ -2780,7 +2780,7 @@ void BossVa_SetupDoor(BossVa* this, GlobalContext* globalCtx) {
|
|||
if (sCsState >= INTRO_SPAWN_BARI) {
|
||||
sDoorState = 100;
|
||||
}
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
BossVa_SetupAction(this, BossVa_Door);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue