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

@ -273,11 +273,11 @@ void EnSb_TurnAround(EnSb* this, GlobalContext* globalCtx) {
void EnSb_Lunge(EnSb* this, GlobalContext* globalCtx) {
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
if ((this->actor.velocity.y <= -0.1f) || ((this->actor.bgCheckFlags & 2))) {
if ((this->actor.velocity.y <= -0.1f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH)) {
if (!(this->actor.yDistToWater > 0.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
}
this->actor.bgCheckFlags = this->actor.bgCheckFlags & ~2;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
EnSb_SetupBounce(this);
}
}
@ -306,8 +306,8 @@ void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) {
}
EnSb_SpawnBubbles(globalCtx, this);
EnSb_SetupLunge(this);
} else if (this->actor.bgCheckFlags & 1) {
this->actor.bgCheckFlags &= ~2;
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
this->actor.speedXZ = 0.0f;
this->timer = 1;
EnSb_SetupWaitClosed(this);
@ -319,13 +319,13 @@ void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) {
void EnSb_Cooldown(EnSb* this, GlobalContext* globalCtx) {
if (this->timer != 0) {
this->timer--;
if (this->actor.bgCheckFlags & 1) {
this->actor.bgCheckFlags &= ~1;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.speedXZ = 0.0f;
}
} else {
if (this->actor.bgCheckFlags & 1) {
this->actor.bgCheckFlags &= ~1;
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actionFunc = EnSb_WaitClosed;
this->actor.speedXZ = 0.0f;
}