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

@ -816,10 +816,10 @@ void func_80860F84(EnTest* this, GlobalContext* globalCtx) {
}
}
if ((this->actor.bgCheckFlags & 8) ||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
((this->actor.params == STALFOS_TYPE_CEILING) &&
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.world.rot.y))) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->actor.speedXZ >= 0.0f) {
newYaw = this->actor.shape.rot.y + 0x3FFF;
} else {
@ -1222,8 +1222,9 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
this->actor.speedXZ = 0.0f;
if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if (!EnTest_ReactToProjectile(globalCtx, this)) {
EnTest_ChooseAction(this, globalCtx);
@ -1233,8 +1234,9 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
}
if (player->swordState != 0) {
if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->swordAnimation != 0x11)) {
@ -1272,8 +1274,9 @@ void func_80862418(EnTest* this, GlobalContext* globalCtx) {
}
if (player->swordState != 0) {
if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->swordAnimation != 0x11)) {
@ -1318,7 +1321,7 @@ void EnTest_Stunned(EnTest* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.health == 0) {
func_80862FA8(this, globalCtx);
} else if (player->swordState != 0) {
if ((this->actor.bgCheckFlags & 8) &&
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
@ -1387,10 +1390,10 @@ void func_808628C8(EnTest* this, GlobalContext* globalCtx) {
}
}
if ((this->actor.bgCheckFlags & 8) ||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
((this->actor.params == STALFOS_TYPE_CEILING) &&
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF))) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->actor.speedXZ >= 0.0f) {
newYaw = (this->actor.shape.rot.y + 0x3FFF);
} else {
@ -1716,7 +1719,7 @@ void EnTest_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->actor.floorHeight <= this->actor.home.pos.y) {
this->actor.floorHeight = this->actor.home.pos.y;
}
} else if (this->actor.bgCheckFlags & 2) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
floorProperty = func_80041EA4(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
if ((floorProperty == 5) || (floorProperty == 0xC) ||
@ -1993,7 +1996,7 @@ s32 EnTest_ReactToProjectile(GlobalContext* globalCtx, EnTest* this) {
if (projectileActor != NULL) {
yawToProjectile = Actor_WorldYawTowardActor(&this->actor, projectileActor) - (u16)this->actor.shape.rot.y;
if ((u8)(this->actor.bgCheckFlags & 8)) {
if ((u8)(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
wallYawDiff = ((u16)this->actor.wallYaw - (u16)this->actor.shape.rot.y);
touchingWall = true;
} else {