1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 14:31:17 +00:00

Defines for Actor#bgCheckFlags (#1126)

* First pass, tool assisted bgCheckFlags

* Few manual bgCheckFlags

* Run formatter

* Remove fake bgCheckFlags 10-15

* Move existing documentation to the defines

* Comment on `bgCheckFlags` and rephrase some doc

* Name obvious flags, and some cleanup

* Comment on flag 9 being wall-interaction-related (thanks engineer and fig)

* Run formatter

* `BGCHECKFLAG_7` -> `BGCHECKFLAG_GROUND_STRICT`

* Touch up water-related bgcheckflags doc

* `BGCHECKFLAG_9` -> `BGCHECKFLAG_PLAYER_WALL_INTERACT`
This commit is contained in:
Dragorn421 2022-02-19 03:16:19 +01:00 committed by GitHub
parent 251d90301c
commit 67f294774b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
121 changed files with 711 additions and 652 deletions

View file

@ -336,7 +336,7 @@ void func_80AFD508(EnSkb* this, GlobalContext* globalCtx) {
}
void EnSkb_SetupStunned(EnSkb* this) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speedXZ = 0.0f;
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
@ -346,15 +346,15 @@ void EnSkb_SetupStunned(EnSkb* this) {
}
void func_80AFD59C(EnSkb* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speedXZ = 0.0f;
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.05f;
}
}
if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) {
if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (this->actor.colChkInfo.health == 0) {
func_80AFD7B4(this, globalCtx);
} else {
@ -365,7 +365,7 @@ void func_80AFD59C(EnSkb* this, GlobalContext* globalCtx) {
void func_80AFD644(EnSkb* this) {
Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDamagedAnim, -4.0f);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speedXZ = -4.0f;
}
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
@ -383,17 +383,17 @@ void func_80AFD6CC(EnSkb* this, GlobalContext* globalCtx) {
if ((*new_var) != 0) {
this->unk_283 = (*new_var) | 2;
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speedXZ = 0;
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.05f;
}
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0);
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
func_80AFCD60(this);
}
}
@ -403,7 +403,7 @@ void func_80AFD7B4(EnSkb* this, GlobalContext* globalCtx) {
Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDyingAnim, -4.0f);
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speedXZ = -6.0f;
}
this->unk_280 = 1;
@ -439,7 +439,8 @@ void func_80AFD968(EnSkb* this, GlobalContext* globalCtx) {
s16 phi_v1;
Player* player;
if ((this->unk_280 != 1) && (this->actor.bgCheckFlags & 0x60) && (this->actor.yDistToWater >= 40.0f)) {
if ((this->unk_280 != 1) && (this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
(this->actor.yDistToWater >= 40.0f)) {
this->actor.colChkInfo.health = 0;
this->unk_281 = 0;
func_80AFD7B4(this, globalCtx);