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

@ -14,7 +14,7 @@
* - "Spear Patrol" (variable 0xPP00 PP=pathId): uses a spear, patrols following a path, charges
*/
#define FLAGS 0x00000015
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4)
typedef enum {
/* -1 */ ENMB_TYPE_SPEAR_GUARD = -1,
@ -307,7 +307,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f);
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.naviEnemyId += 1;
EnMb_SetupClubWaitPlayerNear(this);
break;
@ -323,7 +323,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_HEAVY;
this->maxHomeDist = 350.0f;
this->playerDetectionRange = 1750.0f;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
EnMb_SetupSpearPatrolTurnTowardsWaypoint(this, globalCtx);
break;
}
@ -574,7 +574,7 @@ void EnMb_SetupClubDamagedWhileKneeling(EnMb* this) {
void EnMb_SetupClubDead(EnMb* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gEnMbClubFallOnItsBackAnim, -4.0f);
this->state = ENMB_STATE_CLUB_DEAD;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
this->hitbox.dim.height = 80;
this->hitbox.dim.radius = 95;
this->timer1 = 30;
@ -1134,12 +1134,12 @@ void EnMb_SpearGuardWalk(EnMb* this, GlobalContext* globalCtx) {
if (this->timer3 == 0 &&
Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->playerDetectionRange) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0);
this->actor.flags |= 1;
this->actor.flags |= ACTOR_FLAG_0;
if (this->actor.xzDistToPlayer < 500.0f && relYawTowardsPlayer < 0x1388) {
EnMb_SetupSpearPrepareAndCharge(this);
}
} else {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > this->maxHomeDist || this->timer2 != 0) {
yawTowardsHome = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
Math_SmoothStepToS(&this->actor.world.rot.y, yawTowardsHome, 1, 0x2EE, 0);
@ -1286,7 +1286,7 @@ void EnMb_SetupSpearDead(EnMb* this) {
this->timer1 = 30;
this->state = ENMB_STATE_SPEAR_SPEARPATH_DAMAGED;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DEAD);
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
EnMb_SetupAction(this, EnMb_SpearDead);
}