1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-22 06:52:03 +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:
Dragorn421 2021-12-06 01:11:38 +01:00 committed by GitHub
parent 79220ba58a
commit a9284494f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
439 changed files with 1342 additions and 1304 deletions

View file

@ -8,7 +8,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_Bb/object_Bb.h"
#define FLAGS 0x01000015
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_24)
#define vBombHopPhase actionVar1
#define vTrailIdx actionVar1
@ -344,7 +344,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) {
this->flamePrimBlue = this->flameEnvColor.b = 255;
thisx->world.pos.y += 50.0f;
EnBb_SetupBlue(this);
thisx->flags |= 0x4000;
thisx->flags |= ACTOR_FLAG_14;
break;
case ENBB_RED:
thisx->naviEnemyId = 0x24;
@ -373,7 +373,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) {
EnBb_SetupWhite(globalCtx, this);
EnBb_SetWaypoint(this, globalCtx);
EnBb_FaceWaypoint(this);
thisx->flags |= 0x4000;
thisx->flags |= ACTOR_FLAG_14;
break;
case ENBB_GREEN_BIG:
this->path = this->actionState >> 4;
@ -407,7 +407,7 @@ void EnBb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnBb_SetupFlameTrail(EnBb* this) {
this->action = BB_FLAME_TRAIL;
this->moveMode = BBMOVE_NOCLIP;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
this->actor.speedXZ = 0.0f;
@ -698,7 +698,7 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) {
this->moveMode = BBMOVE_HIDDEN;
this->timer = 10;
this->actionState++;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
this->action = BB_RED;
EnBb_SetupAction(this, EnBb_Red);
return;
@ -763,7 +763,7 @@ void EnBb_SetupRed(GlobalContext* globalCtx, EnBb* this) {
this->actor.home.pos = this->actor.world.pos;
this->actor.velocity.y = this->actor.gravity = this->actor.speedXZ = 0.0f;
this->actor.bgCheckFlags &= ~1;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
}
this->action = BB_RED;
EnBb_SetupAction(this, EnBb_Red);
@ -797,7 +797,7 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) {
case BBRED_ATTACK:
if (this->timer == 0) {
this->moveMode = BBMOVE_NORMAL;
this->actor.flags |= 1;
this->actor.flags |= ACTOR_FLAG_0;
}
this->bobPhase += Rand_ZeroOne();
Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f);
@ -816,7 +816,7 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) {
this->moveMode = BBMOVE_HIDDEN;
this->timer = 10;
this->actionState++;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
} else {
this->actor.velocity.y *= -1.06f;
if (this->actor.velocity.y > 13.0f) {
@ -1125,7 +1125,7 @@ void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) {
EnBb_SetupDown(this);
}
} else {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
EnBb_SetupDeath(this, globalCtx);
}
}
@ -1190,7 +1190,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) {
}
}
if (this->actor.colChkInfo.health == 0) {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
if (this->actor.params == ENBB_RED) {
EnBb_KillFlameTrail(this);
}
@ -1232,7 +1232,7 @@ void EnBb_Update(Actor* thisx, GlobalContext* globalCtx2) {
if (this->actor.colChkInfo.damageEffect != 0xD) {
this->actionFunc(this, globalCtx);
if ((this->actor.params <= ENBB_BLUE) && (this->actor.speedXZ >= -6.0f) &&
((this->actor.flags & 0x8000) == 0)) {
((this->actor.flags & ACTOR_FLAG_15) == 0)) {
Actor_MoveForward(&this->actor);
}
if (this->moveMode == BBMOVE_NORMAL) {