1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-24 16:01:26 +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

@ -3,7 +3,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_oF1d_map/object_oF1d_map.h"
#define FLAGS 0x00000039
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4 | ACTOR_FLAG_5)
/*
FLAGS
@ -455,9 +455,10 @@ u16 EnGo2_GetTextIdGoronCityLowestFloor(GlobalContext* globalCtx, EnGo2* this) {
} else if (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
return 0x3027;
} else {
return CUR_UPG_VALUE(UPG_STRENGTH) != 0
? 0x302C
: !Flags_GetSwitch(globalCtx, 0x1B) ? 0x3017 : gSaveContext.infTable[15] & 0x100 ? 0x3019 : 0x3018;
return CUR_UPG_VALUE(UPG_STRENGTH) != 0 ? 0x302C
: !Flags_GetSwitch(globalCtx, 0x1B) ? 0x3017
: gSaveContext.infTable[15] & 0x100 ? 0x3019
: 0x3018;
}
}
@ -857,7 +858,7 @@ s32 func_80A44AB0(EnGo2* this, GlobalContext* globalCtx) {
} else {
if (this->collider.base.acFlags & 2) {
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->actor.flags &= ~0x1000000;
this->actor.flags &= ~ACTOR_FLAG_24;
this->collider.base.acFlags &= ~0x2;
EnGo2_StopRolling(this, globalCtx);
return true;
@ -933,10 +934,10 @@ s32 EnGo2_IsWakingUp(EnGo2* this) {
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
if ((this->collider.base.ocFlags2 & 1) == 0) {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
return false;
} else {
this->actor.flags |= 1;
this->actor.flags |= ACTOR_FLAG_0;
return true;
}
}
@ -1263,7 +1264,7 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) {
void EnGo2_RollingAnimation(EnGo2* this, GlobalContext* globalCtx) {
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
func_80034EC0(&this->skelAnime, sAnimations, 10);
this->skelAnime.playSpeed = -0.5f;
} else {
@ -1312,7 +1313,7 @@ void EnGo2_SetupRolling(EnGo2* this, GlobalContext* globalCtx) {
} else {
this->actor.speedXZ = 6.0f;
}
this->actor.flags |= 0x1000000;
this->actor.flags |= ACTOR_FLAG_24;
this->animTimer = 10;
this->actor.shape.yOffset = 1800.0f;
this->actor.speedXZ += this->actor.speedXZ; // Speeding up
@ -1494,8 +1495,8 @@ void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx) {
case GORON_CITY_LOST_WOODS:
case GORON_DMT_FAIRY_HINT:
case GORON_MARKET_BAZAAR:
this->actor.flags &= ~0x10;
this->actor.flags &= ~0x20;
this->actor.flags &= ~ACTOR_FLAG_4;
this->actor.flags &= ~ACTOR_FLAG_5;
}
EnGo2_SetColliderDim(this);
@ -1559,7 +1560,7 @@ void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case GORON_DMT_BIGGORON:
this->actor.shape.shadowDraw = NULL;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
if ((INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_SWORD_BROKEN) &&
(INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYEDROPS)) {
this->eyeMouthTexState = 1;
@ -1636,7 +1637,7 @@ void func_80A46B40(EnGo2* this, GlobalContext* globalCtx) {
} else {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
this->actor.flags |= 1;
this->actor.flags |= ACTOR_FLAG_0;
}
func_80A454CC(this);
this->unk_211 = true;
@ -1783,7 +1784,7 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, GlobalContext* globalCtx) {
switch (this->goronState) {
case 0:
func_80034EC0(&this->skelAnime, sAnimations, 5);
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
this->actor.shape.rot.y += 0x5B0;
this->unk_26E = 1;
this->animTimer = this->skelAnime.endFrame + 60.0f + 60.0f; // eyeDrops animation timer
@ -1814,7 +1815,7 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, GlobalContext* globalCtx) {
}
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
func_80034EC0(&this->skelAnime, sAnimations, 1);
this->actor.flags |= 1;
this->actor.flags |= ACTOR_FLAG_0;
this->unk_26E = 2;
this->skelAnime.playSpeed = 0.0f;
this->skelAnime.curFrame = this->skelAnime.endFrame;