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:
parent
251d90301c
commit
67f294774b
121 changed files with 711 additions and 652 deletions
|
@ -126,29 +126,29 @@ void EnBom_Move(EnBom* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) {
|
||||
if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) {
|
||||
this->actor.velocity.y = -this->actor.velocity.y;
|
||||
}
|
||||
|
||||
// rebound bomb off the wall it hits
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) {
|
||||
this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_BOUND);
|
||||
Actor_MoveForward(&this->actor);
|
||||
this->actor.speedXZ *= 0.7f;
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f);
|
||||
} else {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
|
||||
if ((this->actor.bgCheckFlags & 2) && (this->actor.velocity.y < -3.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -3.0f)) {
|
||||
func_8002F850(globalCtx, &this->actor);
|
||||
this->actor.velocity.y *= -0.3f;
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
} else if (this->timer >= 4) {
|
||||
func_8002F580(&this->actor, globalCtx);
|
||||
}
|
||||
|
@ -348,8 +348,8 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
if (thisx->bgCheckFlags & 0x40) {
|
||||
thisx->bgCheckFlags &= ~0x40;
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_BOMB_DROP_WATER);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue