Introduce BgCheckFlags Defines (#1195)

* flags

* cleanup

* adjust comment
This commit is contained in:
engineer124 2023-03-04 17:53:56 -05:00 committed by GitHub
parent 8b025badd1
commit 2cce8f6767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
149 changed files with 719 additions and 672 deletions

View File

@ -132,6 +132,20 @@ typedef struct {
/* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDrawOpa
} ActorShape; // size = 0x30
#define BGCHECKFLAG_GROUND (1 << 0) // Standing on the ground
#define BGCHECKFLAG_GROUND_TOUCH (1 << 1) // Has touched the ground (only active for 1 frame)
#define BGCHECKFLAG_GROUND_LEAVE (1 << 2) // Has left the ground (only active for 1 frame)
#define BGCHECKFLAG_WALL (1 << 3) // Touching a wall
#define BGCHECKFLAG_CEILING (1 << 4) // Touching a ceiling
#define BGCHECKFLAG_WATER (1 << 5) // In water
#define BGCHECKFLAG_WATER_TOUCH (1 << 6) // Has touched water (reset when leaving water)
#define BGCHECKFLAG_GROUND_STRICT (1 << 7) // Similar to BGCHECKFLAG_GROUND but with no velocity check and is cleared every frame
#define BGCHECKFLAG_CRUSHED (1 << 8) // Crushed between a floor and ceiling (triggers a void for player)
#define BGCHECKFLAG_PLAYER_WALL_INTERACT (1 << 9) // Only set/used by player, related to interacting with walls
#define BGCHECKFLAG_PLAYER_400 (1 << 10) //
#define BGCHECKFLAG_PLAYER_800 (1 << 11) //
#define BGCHECKFLAG_PLAYER_1000 (1 << 12) //
typedef struct Actor {
/* 0x000 */ s16 id; // Actor ID
/* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values
@ -160,7 +174,7 @@ typedef struct Actor {
/* 0x086 */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching
/* 0x088 */ f32 floorHeight; // Y position of the floor polygon directly below the actor
/* 0x08C */ f32 depthInWater; // Directed distance to the surface of active waterbox. Negative value means water is below.
/* 0x090 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags
/* 0x090 */ u16 bgCheckFlags; // Flags indicating how the actor is interacting with collision
/* 0x092 */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player
/* 0x094 */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player in the x,y,z axis
/* 0x098 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane
@ -198,20 +212,6 @@ typedef enum {
/* 1 */ FOOT_RIGHT
} ActorFootIndex;
/**
* BgCheckFlags WIP documentation (logical masks):
* 0x001 : Standing on the ground
* 0x002 : Has touched the ground (only active for 1 frame)
* 0x004 : Has left the ground (only active for 1 frame)
* 0x008 : Touching a wall
* 0x010 : Touching a ceiling
* 0x020 : On or below water surface
* 0x040 : Has touched water (actor is responsible for unsetting this the frame it touches the water)
* 0x080 : Similar to & 0x1 but with no velocity check and is cleared every frame
* 0x100 : Crushed between a floor and ceiling (triggers a void for player)
* 0x200 : Only set/used by player, related to interacting with walls
*/
typedef struct {
/* 0x000 */ Actor actor;
/* 0x144 */ s32 bgId;

View File

@ -113,7 +113,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, PlayState* play, Gfx* dlist,
}
void ActorShadow_DrawCircle(Actor* actor, Lights* lights, PlayState* play) {
if (actor->bgCheckFlags & 0x400) {
if (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_400) {
func_800B4AEC(play, actor, 50.0f);
}
@ -121,7 +121,7 @@ void ActorShadow_DrawCircle(Actor* actor, Lights* lights, PlayState* play) {
}
void ActorShadow_DrawSquare(Actor* actor, Lights* lights, PlayState* play) {
if (actor->bgCheckFlags & 0x400) {
if (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_400) {
func_800B4AEC(play, actor, 50.0f);
}
@ -285,7 +285,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) {
floorHeightPtr++;
}
if (!(actor->bgCheckFlags & 1)) {
if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
actor->shape.feetFloorFlags = 0;
} else if (actor->shape.feetFloorFlags == 3) {
f32 footDistY = actor->shape.feetPos[FOOT_LEFT].y - actor->shape.feetPos[FOOT_RIGHT].y;
@ -336,7 +336,7 @@ void func_800B4B50(Actor* actor, Lights* mapper, PlayState* play) {
Light* phi_s0;
s32 lightNumMax;
if (actor->bgCheckFlags & 0x400) {
if (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_400) {
func_800B4AEC(play, actor, 50.0f);
}
@ -1497,9 +1497,9 @@ void Actor_GetSlopeDirection(CollisionPoly* floorPoly, Vec3f* slopeNormal, s16*
}
s32 func_800B761C(Actor* actor, f32 arg1, s32 arg2) {
if (actor->bgCheckFlags & 1) {
actor->bgCheckFlags &= ~1;
actor->bgCheckFlags |= 4;
if (actor->bgCheckFlags & BGCHECKFLAG_GROUND) {
actor->bgCheckFlags &= ~BGCHECKFLAG_GROUND;
actor->bgCheckFlags |= BGCHECKFLAG_GROUND_LEAVE;
if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) {
actor->velocity.y = 0.0f;
@ -1517,21 +1517,22 @@ s32 func_800B7678(PlayState* play, Actor* actor, Vec3f* pos, s32 flags) {
pos->y += (flags & 0x800) ? 10.0f : 50.0f;
actor->floorHeight = BgCheck_EntityRaycastFloor5_2(play, &play->colCtx, &actor->floorPoly, &bgId, actor, pos);
actor->bgCheckFlags &= ~(0x80 | 0x04 | 0x02);
actor->bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_STRICT);
if (actor->floorHeight <= BGCHECK_Y_MIN) {
return func_800B761C(actor, BGCHECK_Y_MIN, flags);
}
distToFloor = actor->floorHeight - actor->world.pos.y;
actor->floorBgId = bgId;
if ((distToFloor >= 0.0f) || (((actor->bgCheckFlags & 1)) && !(actor->bgCheckFlags & 0x800) &&
(distToFloor >= -11.0f) && (actor->velocity.y < 0.0f))) {
actor->bgCheckFlags |= 0x80;
if ((distToFloor >= 0.0f) ||
(((actor->bgCheckFlags & BGCHECKFLAG_GROUND)) && !(actor->bgCheckFlags & BGCHECKFLAG_PLAYER_800) &&
(distToFloor >= -11.0f) && (actor->velocity.y < 0.0f))) {
actor->bgCheckFlags |= BGCHECKFLAG_GROUND_STRICT;
if (actor->bgCheckFlags & 0x10) {
if (actor->bgCheckFlags & BGCHECKFLAG_CEILING) {
if (bgId != D_801ED8B4) {
if (distToFloor > 15.0f) {
actor->bgCheckFlags |= 0x100;
actor->bgCheckFlags |= BGCHECKFLAG_CRUSHED;
}
} else {
actor->world.pos.x = actor->prevPos.x;
@ -1542,15 +1543,15 @@ s32 func_800B7678(PlayState* play, Actor* actor, Vec3f* pos, s32 flags) {
actor->world.pos.y = actor->floorHeight;
if (actor->velocity.y <= 0.0f) {
if (!(actor->bgCheckFlags & 1)) {
actor->bgCheckFlags |= 2;
if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
actor->bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH;
} else if ((flags & 8) && (actor->gravity < 0.0f)) {
actor->velocity.y = -4.0f;
} else if (!(flags & 0x100)) {
actor->velocity.y = 0.0f;
}
actor->bgCheckFlags |= 1;
actor->bgCheckFlags |= BGCHECKFLAG_GROUND;
BgCheck2_AttachToMesh(&play->colCtx, actor, (s32)actor->floorBgId);
}
} else {
@ -1566,14 +1567,14 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
s32 pad;
Vec3f pos;
if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) {
if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
BgCheck2_UpdateActorAttachedToMesh(&play->colCtx, actor->floorBgId, actor);
}
if (flags & 1) {
s32 bgId;
actor->bgCheckFlags &= ~0x1000;
actor->bgCheckFlags &= ~BGCHECKFLAG_PLAYER_1000;
if ((!(flags & 0x80) &&
(BgCheck_EntitySphVsWall3(&play->colCtx, &pos, &actor->world.pos, &actor->prevPos, wallCheckRadius,
&actor->wallPoly, &bgId, actor, wallCheckHeight))) ||
@ -1582,18 +1583,18 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
&actor->wallPoly, &bgId, actor, wallCheckHeight)))) {
CollisionPoly* sp7C = actor->wallPoly;
actor->bgCheckFlags |= 8;
if ((flags & 0x200) && (actor->bgCheckFlags & 0x1000) && ((s32)sp7C->normal.y > 0) &&
actor->bgCheckFlags |= BGCHECKFLAG_WALL;
if ((flags & 0x200) && (actor->bgCheckFlags & BGCHECKFLAG_PLAYER_1000) && ((s32)sp7C->normal.y > 0) &&
(sqrtf(SQXYZ(actor->colChkInfo.displacement)) < 10.0f)) {
actor->bgCheckFlags &= ~8;
} else if (actor->bgCheckFlags & 8) {
actor->bgCheckFlags &= ~BGCHECKFLAG_WALL;
} else if (actor->bgCheckFlags & BGCHECKFLAG_WALL) {
Math_Vec3f_Copy(&actor->world.pos, &pos);
}
actor->wallYaw = Math_Atan2S_XY(sp7C->normal.z, sp7C->normal.x);
actor->wallBgId = bgId;
} else {
actor->bgCheckFlags &= ~8;
actor->bgCheckFlags &= ~BGCHECKFLAG_WALL;
}
}
@ -1605,10 +1606,10 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
pos.y = actor->prevPos.y + 4.0f;
if (BgCheck_EntityCheckCeiling(&play->colCtx, &y, &pos, (ceilingCheckHeight + sp94) - 4.0f, &D_801ED8B0,
&D_801ED8B4, actor)) {
actor->bgCheckFlags |= 0x10;
actor->bgCheckFlags |= BGCHECKFLAG_CEILING;
actor->world.pos.y = (y + sp94) - 4.0f;
} else {
actor->bgCheckFlags &= ~0x10;
actor->bgCheckFlags &= ~BGCHECKFLAG_CEILING;
}
}
if (flags & 4) {
@ -1622,9 +1623,9 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
if (WaterBox_GetSurface1(play, &play->colCtx, actor->world.pos.x, actor->world.pos.z, &y, &waterbox)) {
actor->depthInWater = y - actor->world.pos.y;
if (actor->depthInWater <= 0.0f) {
actor->bgCheckFlags &= ~(0x40 | 0x20);
} else if (!(actor->bgCheckFlags & 0x20)) {
actor->bgCheckFlags |= (0x40 | 0x20);
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
} else if (!(actor->bgCheckFlags & BGCHECKFLAG_WATER)) {
actor->bgCheckFlags |= (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
if (!(flags & 0x40)) {
Vec3f sp64;
@ -1637,10 +1638,10 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
EffectSsGRipple_Spawn(play, &sp64, 100, 500, 8);
}
} else {
actor->bgCheckFlags &= ~0x40;
actor->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
}
} else {
actor->bgCheckFlags &= ~(0x40 | 0x20);
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
actor->depthInWater = BGCHECK_Y_MIN;
}
}
@ -1653,9 +1654,9 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
actor->depthInWater = y - actor->world.pos.y;
if (actor->depthInWater < 0.0f) {
actor->bgCheckFlags &= ~(0x40 | 0x20);
} else if (!(actor->bgCheckFlags & 0x20)) {
actor->bgCheckFlags |= (0x40 | 0x20);
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
} else if (!(actor->bgCheckFlags & BGCHECKFLAG_WATER)) {
actor->bgCheckFlags |= (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
if (!(flags & 0x40)) {
Vec3f sp50;
@ -1668,10 +1669,10 @@ void Actor_UpdateBgCheckInfo(PlayState* play, Actor* actor, f32 wallCheckHeight,
EffectSsGRipple_Spawn(play, &sp50, 100, 500, 8);
}
} else {
actor->bgCheckFlags &= ~0x40;
actor->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
}
} else {
actor->bgCheckFlags &= ~(0x40 | 0x20);
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
actor->depthInWater = BGCHECK_Y_MIN;
}
}
@ -2152,7 +2153,7 @@ void Actor_PlaySfx(Actor* actor, u16 sfxId) {
void func_800B8EF4(PlayState* play, Actor* actor) {
u32 sfxId;
if (actor->bgCheckFlags & 0x20) {
if (actor->bgCheckFlags & BGCHECKFLAG_WATER) {
if (actor->depthInWater < 20.0f) {
sfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG;
} else {
@ -3680,7 +3681,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16
Actor_UpdateBgCheckInfo(play, actor, 0.0f, 0.0f, 0.0f, 4);
Math_Vec3f_Copy(&actor->world.pos, &actorPos);
ret = actor->bgCheckFlags & 1;
ret = actor->bgCheckFlags & BGCHECKFLAG_GROUND;
actor->bgCheckFlags = bgCheckFlags;

View File

@ -1955,7 +1955,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul
}
posResult->z = posIntersect.z;
if (actor != NULL) {
actor->bgCheckFlags |= 0x1000;
actor->bgCheckFlags |= BGCHECKFLAG_PLAYER_1000;
}
}
// poly is wall
@ -2001,7 +2001,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul
result = true;
if (poly->normal.y * COLPOLY_NORMAL_FRAC > 0.5f) {
if (actor != NULL) {
actor->bgCheckFlags |= 0x1000;
actor->bgCheckFlags |= BGCHECKFLAG_PLAYER_1000;
}
}
} else {

View File

@ -254,7 +254,7 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, PlayState* play, f32 distAboveThreshold) {
u16 sfxId;
u8 isFootOnGround;
if (enHy->actor.bgCheckFlags & 0x20) {
if (enHy->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
if (enHy->actor.depthInWater < 20.0f) {
waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG;
} else {

View File

@ -362,7 +362,7 @@ void func_800A640C(EnItem00* this, PlayState* play) {
}
}
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 1)) {
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actionFunc = func_800A6650;
}
}
@ -387,12 +387,12 @@ void func_800A6650(EnItem00* this, PlayState* play) {
EffectSsKirakira_SpawnSmall(play, &pos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor, &sEffectEnvColor);
}
if (this->actor.bgCheckFlags & 3) {
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
if (this->actor.velocity.y > -2.0f) {
this->actionFunc = func_800A640C;
} else {
this->actor.velocity.y = this->actor.velocity.y * -0.8f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
}
}
@ -444,7 +444,7 @@ void func_800A6780(EnItem00* this, PlayState* play) {
EffectSsKirakira_SpawnSmall(play, &pos, &sEffectVelocity, &sEffectAccel, &sEffectPrimColor, &sEffectEnvColor);
}
if (this->actor.bgCheckFlags & 3) {
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
this->actionFunc = func_800A640C;
this->actor.shape.rot.z = 0;
this->actor.speed = 0.0f;

View File

@ -495,7 +495,8 @@ s32 func_801234D4(PlayState* play) {
return (player->stateFlags2 & PLAYER_STATE2_8) || (player->actor.speed != 0.0f) ||
((player->transformation != PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000)) ||
((player->transformation == PLAYER_FORM_ZORA) && (player->stateFlags1 & PLAYER_STATE1_8000000) &&
(!(player->actor.bgCheckFlags & 1) || (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER)));
(!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER)));
}
s32 func_80123590(PlayState* play, Actor* actor) {
@ -1274,7 +1275,7 @@ void func_80123DA4(Player* player) {
}
void func_80123DC0(Player* player) {
if ((player->actor.bgCheckFlags & 1) ||
if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(player->stateFlags1 & (PLAYER_STATE1_200000 | PLAYER_STATE1_800000 | PLAYER_STATE1_8000000)) ||
(!(player->stateFlags1 & (PLAYER_STATE1_40000 | PLAYER_STATE1_80000)) &&
((player->actor.world.pos.y - player->actor.floorHeight) < 100.0f))) {
@ -1461,7 +1462,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) {
envHazard = PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1;
} else if (player->stateFlags1 & PLAYER_STATE1_8000000) {
if ((player->transformation == PLAYER_FORM_ZORA) && (player->currentBoots >= PLAYER_BOOTS_ZORA_UNDERWATER) &&
(player->actor.bgCheckFlags & 1)) {
(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
envHazard = PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1;
} else {
envHazard = PLAYER_ENV_HAZARD_SWIMMING - 1;

View File

@ -163,9 +163,9 @@ void BgIcicle_Shiver(BgIcicle* this, PlayState* play) {
}
void BgIcicle_Fall(BgIcicle* this, PlayState* play) {
if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & 1)) {
if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->collider.base.atFlags &= ~AT_HIT;
this->dyna.actor.bgCheckFlags &= ~1;
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
if (this->dyna.actor.world.pos.y < this->dyna.actor.floorHeight) {
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;

View File

@ -119,7 +119,7 @@ void BgIkanaDharma_Init(Actor* thisx, PlayState* play2) {
this->dyna.actor.unk20, NULL);
}
this->dyna.actor.bgCheckFlags |= 1;
this->dyna.actor.bgCheckFlags |= BGCHECKFLAG_GROUND;
}
BgIkanaDharma_SetupWaitForHit(this);
@ -227,7 +227,7 @@ void BgIkanaDharma_Update(Actor* thisx, PlayState* play) {
if (actorBelow == NULL) {
Actor_MoveWithGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
if (this->dyna.actor.bgCheckFlags & 2) {
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
Quake_SetSpeed(quakeIndex, 21536);

View File

@ -647,7 +647,7 @@ void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
if (player->actor.bgCheckFlags & 0x100) {
if (player->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) {
Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset);
func_80169EFC(&play->state);
Player_PlaySfx(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->voiceSfxIdOffset);

View File

@ -228,7 +228,7 @@ void func_809541B8(BgIngate* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->unk160 & 0x4) {
if ((player->transformation == PLAYER_FORM_HUMAN) && (player->actor.bgCheckFlags & 1) &&
if ((player->transformation == PLAYER_FORM_HUMAN) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(this->dyna.actor.xzDistToPlayer < 40.0f)) {
if (this->dyna.actor.playerHeightRel > 15.0f) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7);

View File

@ -283,7 +283,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play) {
Actor_MoveWithGravity(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
if (this->dyna.actor.bgCheckFlags & 1) {
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_StepToS(&this->step, 0x7D0, 0x78);
if (this->landTimer < 3) {

View File

@ -996,7 +996,7 @@ void func_809DAB78(Boss02* this, PlayState* play) {
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 150.0f, 100.0f, 4);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->unk_0144 = 23;
this->actor.speed = 0.0f;
this->unk_0170 = this->unk_017C;

View File

@ -584,7 +584,7 @@ void func_809E34B8(Boss03* this, PlayState* play) {
Math_ApproachF(&this->actor.speed, this->unk_278, 1.0f, this->unk_27C);
Math_ApproachF(&this->unk_260, sinf(this->skelAnime.curFrame * (M_PI / 5.0f)) * 10.0f * 0.01f, 0.5f, 1.0f);
if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & 8)) {
if ((this->workTimer[WORK_TIMER_UNK2_A] == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
Matrix_MultVecZ(-500.0f, &this->unk_268);
this->unk_268.y = Rand_ZeroFloat(100.0f) + 150.0f;
this->workTimer[WORK_TIMER_UNK2_A] = 60;
@ -618,7 +618,7 @@ void func_809E34B8(Boss03* this, PlayState* play) {
if (this->workTimer[WORK_TIMER_UNK1_A] == 0) {
// Player is above water && Player is standing on ground
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) {
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Boss03_SetupPrepareCharge(this, play);
} else if ((player->transformation != PLAYER_FORM_GORON) && (player->transformation != PLAYER_FORM_DEKU)) {
if (KREG(70) == 0) {
@ -678,7 +678,8 @@ void Boss03_ChasePlayer(Boss03* this, PlayState* play) {
// If either (Player is standing on ground && Player is above water) or (WORK_TIMER_CURRENT_ACTION timer runs out),
// then stop chasing
if (((player->actor.bgCheckFlags & 1) && (player->actor.shape.feetPos[0].y >= WATER_HEIGHT + 8.0f)) ||
if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(player->actor.shape.feetPos[0].y >= WATER_HEIGHT + 8.0f)) ||
(this->workTimer[WORK_TIMER_CURRENT_ACTION] == 0)) {
if (&this->actor == player->actor.parent) {
player->unk_AE8 = 101;
@ -773,7 +774,8 @@ void Boss03_CatchPlayer(Boss03* this, PlayState* play) {
// If either (Player is standing on ground && Player is above water) or (WORK_TIMER_CURRENT_ACTION timer runs out)
// then stop trying to catch Player
if (((player->actor.bgCheckFlags & 1) && (player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) ||
if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) ||
(this->workTimer[WORK_TIMER_CURRENT_ACTION] == 0)) {
if (&this->actor == player->actor.parent) {
player->unk_AE8 = 101;
@ -985,7 +987,7 @@ void Boss03_PrepareCharge(Boss03* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
// Player is above water && Player is standing on ground
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) {
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (this->workTimer[WORK_TIMER_CURRENT_ACTION] == 0) {
Boss03_SetupCharge(this, play);
}
@ -1046,14 +1048,14 @@ void Boss03_Charge(Boss03* this, PlayState* play) {
}
// Attack platform
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
func_800BC848(&this->actor, play, 20, 15);
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, 0.0f, this->waterHeight, 0.0f, 0, 0, 0x96,
ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE);
// Player is above water && Player is standing on ground
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) {
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
func_800B8D50(play, NULL, 7.0f, Math_Atan2S_XY(player->actor.world.pos.z, player->actor.world.pos.x),
7.0f, 0);
}
@ -1451,7 +1453,8 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
this->unk_2BE = Math_Atan2S_XY(this->actor.world.pos.z, this->actor.world.pos.x);
// Player is above water && Player is standing on ground
if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) {
if ((this->waterHeight < player->actor.world.pos.y) &&
(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
player->actor.world.pos.x = 0.0f;
player->actor.world.pos.z = -200.0f;
}
@ -1768,7 +1771,7 @@ void Boss03_Stunned(Boss03* this, PlayState* play) {
if ((this->waterHeight + 30.0f) < this->actor.world.pos.y) {
this->actor.gravity = -2.0f;
Actor_MoveWithGravity(&this->actor);
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
play_sound(NA_SE_IT_WALL_HIT_HARD);
func_800BC848(&this->actor, play, 10, 10);
}
@ -2095,7 +2098,8 @@ void Boss03_Update(Actor* thisx, PlayState* play2) {
}
// Player is standing on ground && Player is above water
if ((player->actor.bgCheckFlags & 1) && (player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) {
if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(player->actor.shape.feetPos[FOOT_LEFT].y >= WATER_HEIGHT + 8.0f)) {
if (this->wetSpotEffectSpawnCount != 0) {
this->wetSpotEffectSpawnCount--;
@ -2514,7 +2518,7 @@ void Boss03_SeaweedUpdate(Actor* thisx, PlayState* play) {
disturbanceFactor = player->actor.speed * 3.0f + 70.0f;
// Player is standing on ground
if (player->actor.bgCheckFlags & 1) {
if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
maxBendSpeed = 0;
} else {
maxBendSpeed = player->actor.speed * 16.0f;

View File

@ -323,7 +323,7 @@ void func_809EC568(Boss04* this, PlayState* play) {
Math_ApproachF(&this->subCamAt.x, this->actor.world.pos.x, 0.5f, 1000.0f);
Math_ApproachF(&this->subCamAt.y, this->actor.world.pos.y, 0.5f, 1000.0f);
Math_ApproachF(&this->subCamAt.z, this->actor.world.pos.z, 0.5f, 1000.0f);
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
this->unk_6F4 = 15;
this->unk_708 = 13;
@ -467,7 +467,7 @@ void func_809ECEF4(Boss04* this) {
void func_809ECF58(Boss04* this, PlayState* play) {
Vec3f sp3C;
if ((this->unk_1FE == 14) || ((this->actor.bgCheckFlags & 8) && (this->unk_1F8 == 0))) {
if ((this->unk_1FE == 14) || ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->unk_1F8 == 0))) {
this->unk_1F8 = 20;
if ((Rand_ZeroOne() < 0.2f) && (this->unk_1FE == 0)) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
@ -479,7 +479,7 @@ void func_809ECF58(Boss04* this, PlayState* play) {
this->actor.speed = 0.0f;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION);
func_800BC848(&this->actor, play, 15, 10);
this->unk_6F4 = 15;

View File

@ -1529,7 +1529,7 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) {
if (this->path != NULL) {
sp34 = func_80BECEAC(this->path, this->unk_334, &this->actor.world.pos, &sp38);
if (this->actor.bgCheckFlags & 0x8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
sp38.y = this->actor.wallYaw;
}

View File

@ -265,7 +265,7 @@ void EnAm_ApplyEnemyTexture(EnAm* this, PlayState* play) {
void func_808B0208(EnAm* this, PlayState* play) {
// If the armos is against a wall, rotate and turn away from it
if ((this->actor.speed > 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->actor.world.rot.y = (this->actor.wallYaw * 2) - this->actor.world.rot.y;
this->actor.world.pos.x += this->actor.speed * Math_SinS(this->actor.world.rot.y);
this->actor.world.pos.z += this->actor.speed * Math_CosS(this->actor.world.rot.y);
@ -275,12 +275,12 @@ void func_808B0208(EnAm* this, PlayState* play) {
this->actor.speed = this->speed;
this->actor.velocity.y = 12.0f;
} else if (this->skelAnime.curFrame > 11.0f) {
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->skelAnime.curFrame = 11.0f;
} else {
Math_ScaledStepToS(&this->actor.world.rot.y, this->armosYaw, 0x1F40);
this->actor.speed = 0.0f;
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
EnAm_SpawnEffects(this, play);
}
}
@ -302,7 +302,7 @@ void func_808B0358(EnAm* this) {
void func_808B03C0(EnAm* this, PlayState* play) {
this->armosYaw = this->actor.yawTowardsPlayer;
func_808B0208(this, play);
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->explodeTimer--;
}
if (this->explodeTimer == 0) {
@ -334,7 +334,7 @@ void func_808B04E4(EnAm* this) {
void func_808B0508(EnAm* this, PlayState* play) {
func_808B0208(this, play);
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 2.0f);
Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 2.0f);
}

View File

@ -211,7 +211,7 @@ void EnAni_FallToGround(EnAni* this, PlayState* play) {
s32 pad;
s16 quakeIndex;
if (this->actor.bgCheckFlags & 1) { // hit the ground
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.flags &= ~ACTOR_FLAG_10;
this->actionFunc = EnAni_LandOnFoot;
this->actor.velocity.x = 0.0f;

View File

@ -273,8 +273,8 @@ void func_8088AA98(EnArrow* this, PlayState* play) {
f32 temp_f0;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) &&
(this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & 0x20)) {
this->actor.bgCheckFlags |= 0x20;
(this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->actor.bgCheckFlags |= BGCHECKFLAG_WATER;
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.home.pos, &sp44);

View File

@ -236,7 +236,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) {
Actor_SetFocus(&this->actor, this->targetHeight);
Actor_GetScreenPos(play, &this->actor, &posX, &posY);
if (this->actor.bgCheckFlags & 8) { // touching a wall
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->targetRotY = this->actor.yawTowardsPlayer;
this->targetRotX = this->actor.world.rot.x - 3000.0f;
this->hopTimer = 0;
@ -255,7 +255,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) {
} else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(flightTarget.x - this->actor.world.pos.x) < 50.0f) &&
(fabsf(flightTarget.y - this->actor.world.pos.y) < 50.0f) &&
(fabsf(flightTarget.z - this->actor.world.pos.z) < 50.0f)) ||
(this->actor.bgCheckFlags & 1)) { // touching ground or with close distance of target
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
// reset state
this->hopTimer = 0;
this->unkTimer250 = this->hopTimer;
@ -286,7 +286,7 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) {
return;
}
if (this->actor.bgCheckFlags & 1) { // touching floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->hopTimer == 0) {
this->hopTimer = 3;
this->actor.velocity.y = 3.5f;
@ -316,17 +316,16 @@ void EnAttackNiw_AimAtPlayer(EnAttackNiw* this, PlayState* play) {
Math_ApproachF(&this->rotStep, 10000.0f, 1.0f, 1000.0f);
Math_ApproachF(&this->actor.speed, this->targetXZSpeed, 0.9f, 1.0f);
if (this->actor.gravity == -2.0f && this->unkTimer25A == 0 &&
(this->actor.bgCheckFlags & 8 || this->randomAngleChangeTimer == 0)) {
if ((this->actor.gravity == -2.0f) && (this->unkTimer25A == 0) &&
((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->randomAngleChangeTimer == 0))) {
this->targetXZSpeed = 0.0f;
this->actor.gravity = 0.0f;
this->rotStep = 0.0f;
this->targetRotX = this->actor.world.rot.x - 5000.0f;
this->actionFunc = EnAttackNiw_FlyAway;
} else if (this->actor.bgCheckFlags & 1) { // touching floor
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_SLOW_FORFLAPPING);
} else {
EnAttackNiw_AnimateWingHead(this, play, NIW_ANIM_PECKING_AND_WAVING);
}
@ -380,8 +379,7 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) {
return;
}
if ((this->actor.bgCheckFlags & 0x20) && // on or below water
(this->actionFunc != EnAttackNiw_FlyAway)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != EnAttackNiw_FlyAway)) {
Math_Vec3f_Copy(&splashPos, &this->actor.world.pos);
splashPos.y += this->actor.depthInWater;
EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, 400);

View File

@ -274,7 +274,7 @@ void EnAz_Init(Actor* thisx, PlayState* play2) {
this->collider.dim.yShift *= 1.2f;
}
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 5);
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 22.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 22.0f)) {
this->unk_374 |= 0x100;
this->unk_376 |= 0x100;
}
@ -560,7 +560,7 @@ s32 func_80A95B34(PlayState* play, ActorPathing* actorPathing) {
} else {
ret = func_80A958B0(play, actorPathing);
}
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->unk_374 & 8) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_WALK, &this->animIndex);
this->unk_374 &= ~8;
@ -578,21 +578,21 @@ void func_80A95C5C(EnAz* this, PlayState* play) {
this->actor.gravity = -1.0f;
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_IDLE, &this->animIndex);
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.bgCheckFlags &= ~0x21;
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER);
this->unk_3C0 = 0;
this->actionFunc = func_80A95CEC;
}
void func_80A95CEC(EnAz* this, PlayState* play) {
if (this->unk_374 & 0x8000) {
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.draw = EnAz_Draw;
Actor_MoveWithGravity(&this->actor);
func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG);
} else {
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN);
}
if (SubS_StartActorCutscene(&this->actor, 0x7C, this->unk_3D0[0], SUBS_CUTSCENE_NORMAL)) {
@ -613,7 +613,7 @@ void func_80A95DA0(EnAz* this, PlayState* play) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationInfo, BEAVER_ANIM_SWIM_WITH_SPINNING_TAIL,
&this->animIndex);
this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.bgCheckFlags &= ~0x21;
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER);
this->unk_374 |= 0x1000;
Math_Vec3f_Copy(&this->actor.world.pos, &sp40->curPoint);
this->actionFunc = func_80A95E88;
@ -668,7 +668,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) {
this->actor.speed = 0.0f;
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 3, 0x1000, 0x100);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1038, 0x100);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.shape.rot.x = 0;
this->actor.gravity = 0.0f;
func_80A97C0C(this, play);
@ -1517,7 +1517,7 @@ void func_80A97EAC(EnAz* this, PlayState* play) {
&this->animIndex);
this->actor.flags |= ACTOR_FLAG_8000000;
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.bgCheckFlags &= ~0x21;
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER);
this->unk_374 |= 0x1000;
this->unk_3C2 = 0;
this->unk_3C4 = 0;
@ -1589,7 +1589,7 @@ void func_80A982E0(PlayState* play, ActorPathing* actorPathing) {
Vec3f sp28;
actorPathing->curPoint.x = actorPathing->points[actorPathing->curPointIndex].x;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
actorPathing->curPoint.y = actorPathing->points[actorPathing->curPointIndex].y;
} else {
actorPathing->curPoint.y = actorPathing->points[actorPathing->curPointIndex].y - this->unk_3A4;
@ -1627,7 +1627,7 @@ void EnAz_Update(Actor* thisx, PlayState* play2) {
EnAz* this = THIS;
this->unk_374 &= ~0x100;
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 22.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 22.0f)) {
if (!(this->unk_376 & 0x100)) {
this->unk_374 |= 0x200;
}

View File

@ -316,12 +316,14 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, PlayState* play) {
// the Nejiron should forcibly explode and as a loop index.
i = false;
if (this->action != NEJIRON_ACTION_EXPLODING && this->action != NEJIRON_ACTION_RETREATING) {
if (!(this->actor.bgCheckFlags & 1) && this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f)) {
// Force a detonation if we're off the ground and have fallen
// below our home position (e.g., we rolled off a ledge).
i = true;
}
if (this->actor.bgCheckFlags & 0x60 && this->actor.depthInWater >= 40.0f) {
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
(this->actor.depthInWater >= 40.0f)) {
// Force a detonation if we're too far below the water's surface.
i = true;
}

View File

@ -225,8 +225,8 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) {
finishedRotStep = Math_ScaledStepToS(&this->actor.shape.rot.y, this->yawTarget, 0x300);
if (this->actor.bgCheckFlags & 8) {
this->actor.bgCheckFlags &= ~8;
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
this->yawTarget = this->actor.wallYaw;
} else if (Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z) > SQ(300.0f)) {
@ -238,7 +238,7 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) {
finishedRotStep = Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100);
if ((this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > -40.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.depthInWater > -40.0f)) {
this->pitchTarget = -0x1000;
} else if (this->actor.world.pos.y < (this->actor.home.pos.y - 100.0f)) {
this->pitchTarget = -((s32)(0x800 * Rand_ZeroOne()) + 0x800);
@ -295,7 +295,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) {
this->timer--;
if ((this->timer == 0) || (this->collider.base.atFlags & AT_HIT) || (Player_GetMask(play) == PLAYER_MASK_STONE) ||
(this->actor.bgCheckFlags & 1) || (player->stateFlags1 & PLAYER_STATE1_800000) ||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (player->stateFlags1 & PLAYER_STATE1_800000) ||
(this->actor.depthInWater > -40.0f)) {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
@ -304,11 +304,11 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) {
this->collider.base.atFlags &= ~AT_ON;
sNumberAttacking--;
EnBat_SetupFlyIdle(this);
} else if ((this->actor.bgCheckFlags & 8) &&
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
(ABS_ALT(BINANG_SUB(this->actor.wallYaw, this->actor.yawTowardsPlayer)) > 0x6800)) {
sNumberAttacking--;
this->collider.base.atFlags &= ~AT_ON;
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
this->yawTarget = this->actor.wallYaw;
EnBat_SetupFlyIdle(this);
}
@ -318,7 +318,7 @@ void EnBat_SetupDie(EnBat* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_1;
Enemy_StartFinishingBlow(play, &this->actor);
this->actor.speed *= Math_CosS(this->actor.world.rot.x);
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.velocity.y = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD);
@ -361,7 +361,7 @@ void EnBat_Die(EnBat* this, PlayState* play) {
this->actor.shape.rot.z += 0x1780;
}
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartPoss, ARRAY_COUNT(this->bodyPartPoss), 2, 0.2f,
0.2f);
@ -407,7 +407,7 @@ void EnBat_SetupStunned(EnBat* this) {
void EnBat_Stunned(EnBat* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if (this->timer != 0) {
this->timer--;
}

View File

@ -171,14 +171,14 @@ void EnBb_Destroy(Actor* thisx, PlayState* play) {
void EnBb_CheckForWall(EnBb* this) {
s16 yawDiff;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
yawDiff = this->actor.shape.rot.y - this->actor.wallYaw;
if (ABS_ALT(yawDiff) > 0x4000) {
this->actor.shape.rot.y = ((this->actor.wallYaw * 2) - this->actor.shape.rot.y) - 0x8000;
}
this->targetYRotation = this->actor.shape.rot.y;
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
}
}
@ -325,7 +325,7 @@ void EnBb_Down(EnBb* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
EnBb_CheckForWall(this);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK);
if (this->timer == 0) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BUBLE_UP);
@ -339,7 +339,7 @@ void EnBb_Down(EnBb* this, PlayState* play) {
this->actor.velocity.y = 10.0f;
}
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0);
Math_ScaledStepToS(&this->actor.shape.rot.y, BINANG_ADD(this->actor.yawTowardsPlayer, 0x8000), 0xBB8);
}
@ -436,7 +436,7 @@ void EnBb_SetupDamage(EnBb* this) {
void EnBb_Damage(EnBb* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed < 0.1f)) {
EnBb_SetupDown(this);
}
}

View File

@ -237,14 +237,14 @@ void EnBbfall_PlaySfx(EnBbfall* this) {
void EnBbfall_CheckForWall(EnBbfall* this) {
s16 yawDiff;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
yawDiff = this->actor.shape.rot.y - this->actor.wallYaw;
if (ABS_ALT(yawDiff) > 0x4000) {
this->actor.shape.rot.y = ((this->actor.wallYaw * 2) - this->actor.shape.rot.y) - 0x8000;
}
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
}
}
@ -283,7 +283,7 @@ void EnBbfall_SetupWaitForPlayer(EnBbfall* this) {
this->flamePos[i].y -= 47.0f;
}
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = EnBbfall_WaitForPlayer;
}
@ -322,7 +322,7 @@ void EnBbfall_Emerge(EnBbfall* this, PlayState* play) {
void EnBbfall_SetupFly(EnBbfall* this) {
this->flameOpacity = 255;
this->isBgCheckCollisionEnabled = true;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.speed = 5.0f;
this->actor.gravity = -1.0f;
this->actionFunc = EnBbfall_Fly;
@ -333,7 +333,7 @@ void EnBbfall_Fly(EnBbfall* this, PlayState* play) {
Math_StepToF(&this->flameScaleY, 0.8f, 0.1f);
Math_StepToF(&this->flameScaleX, 1.0f, 0.1f);
EnBbfall_CheckForWall(this);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (EnBbfall_IsTouchingLava(this, play)) {
EnBbfall_SetupSinkIntoLava(this);
} else {
@ -343,7 +343,7 @@ void EnBbfall_Fly(EnBbfall* this, PlayState* play) {
this->actor.shape.rot.y += (s16)randPlusMinusPoint5Scaled(73728.0f);
}
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
this->actor.world.rot.y = this->actor.shape.rot.y;
@ -385,7 +385,7 @@ void EnBbfall_Down(EnBbfall* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
EnBbfall_CheckForWall(this);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (EnBbfall_IsTouchingLava(this, play)) {
EnBbfall_SetupSinkIntoLava(this);
return;
@ -406,7 +406,7 @@ void EnBbfall_Down(EnBbfall* this, PlayState* play) {
this->actor.velocity.y = 10.0f;
}
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0);
Math_ScaledStepToS(&this->actor.shape.rot.y, BINANG_ADD(this->actor.yawTowardsPlayer, 0x8000), 0xBB8);
}
@ -501,7 +501,7 @@ void EnBbfall_SetupDamage(EnBbfall* this) {
void EnBbfall_Damage(EnBbfall* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.1f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed < 0.1f)) {
if (EnBbfall_IsTouchingLava(this, play)) {
EnBbfall_SetupSinkIntoLava(this);
} else {

View File

@ -500,10 +500,10 @@ void func_80A28708(EnBigpamet* this, PlayState* play) {
void func_80A28760(EnBigpamet* this) {
this->actor.speed = 15.0f;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.wallYaw;
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
if (temp_v1 > 0x3C00) {
this->actor.world.rot.y = this->actor.wallYaw + 0x3C00;
@ -539,7 +539,7 @@ void func_80A287E8(EnBigpamet* this, PlayState* play) {
func_80A27FE8(this, play);
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
this->actor.velocity.y = this->unk_29E * 0.375f;
@ -627,7 +627,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) {
}
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.params = ENBIGPAMET_0;
@ -648,7 +648,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) {
void func_80A28D0C(EnBigpamet* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime2);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_LAND);
func_80A27FE8(this, play);
func_80A28D80(this);

View File

@ -206,7 +206,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) {
}
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 45.0f);
thisx->bgCheckFlags |= 0x400;
thisx->bgCheckFlags |= BGCHECKFLAG_PLAYER_400;
this->savedHeight = thisx->home.pos.y + 100.0f;
this->mainColor.r = 255;
this->mainColor.g = 255;
@ -744,12 +744,12 @@ void EnBigpo_SetupLanternDrop(EnBigpo* this, PlayState* play) {
this->actor.world.pos.y -= 15.0f;
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); // targetable OFF, enemy music OFF
this->actor.bgCheckFlags &= ~0x400;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_PLAYER_400;
this->actionFunc = EnBigpo_LanternFalling;
}
void EnBigpo_LanternFalling(EnBigpo* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1 || this->actor.floorHeight == BGCHECK_Y_MIN) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND || this->actor.floorHeight == BGCHECK_Y_MIN) {
if (this->switchFlags != 0xFF) {
Flags_SetSwitch(play, this->switchFlags);
}

View File

@ -536,47 +536,47 @@ void EnBigslime_CheckRoomBoundaries(EnBigslime* this, Vec3f* vtxMax, Vec3f* vtxM
f32 vtxMaxZ;
f32 vtxMinZ;
this->actor.bgCheckFlags &= ~(0x2 | 0x8 | 0x10);
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING);
if ((this->actor.world.pos.y + vtxMax->y) > GBT_ROOM_5_MAX_Y) {
this->actor.world.pos.y = GBT_ROOM_5_MAX_Y - vtxMax->y;
this->actor.bgCheckFlags |= 0x10;
this->actor.bgCheckFlags |= BGCHECKFLAG_CEILING;
}
if ((this->actor.world.pos.y + vtxMin->y) <= GBT_ROOM_5_MIN_Y) {
this->actor.world.pos.y = GBT_ROOM_5_MIN_Y - vtxMin->y;
if (!(this->actor.bgCheckFlags & 1)) {
this->actor.bgCheckFlags |= 2;
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH;
}
this->actor.bgCheckFlags |= 1;
this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND;
} else {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
if ((this->actionFunc != EnBigslime_Freeze) || !(this->actor.bgCheckFlags & 1)) {
if ((this->actionFunc != EnBigslime_Freeze) || !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
worldPosX = this->actor.world.pos.x;
vtxMaxX = vtxMax->x;
if (GBT_ROOM_5_MAX_X < (worldPosX + vtxMaxX)) {
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
this->actor.world.pos.x = GBT_ROOM_5_MAX_X - vtxMaxX;
} else {
vtxMinX = vtxMin->x;
if ((worldPosX + vtxMinX) < GBT_ROOM_5_MIN_X) {
this->actor.world.pos.x = GBT_ROOM_5_MIN_X - vtxMinX;
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
}
}
worldPosZ = this->actor.world.pos.z;
vtxMaxZ = vtxMax->z;
if (GBT_ROOM_5_MAX_Z < (worldPosZ + vtxMaxZ)) {
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
this->actor.world.pos.z = GBT_ROOM_5_MAX_Z - vtxMaxZ;
} else {
vtxMinZ = vtxMin->z;
if ((worldPosZ + vtxMinZ) < GBT_ROOM_5_MIN_Z) {
this->actor.world.pos.z = GBT_ROOM_5_MIN_Z - vtxMinZ;
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
}
}
}
@ -769,7 +769,7 @@ void EnBigslime_BreakIntoMinislime(EnBigslime* this, PlayState* play) {
this->actor.hintId = TATL_HINT_ID_GEKKO_GIANT_SLIME;
this->gekkoRot.x = 0;
this->gekkoRot.y = 0;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->formBigslimeTimer = 2;
EnBigslime_AddIceShardEffect(this, play);
Actor_PlaySfx(&this->actor, NA_SE_EN_B_SLIME_BREAK);
@ -1083,7 +1083,7 @@ void EnBigslime_Drop(EnBigslime* this, PlayState* play) {
EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_DOWN);
this->rotation = 0;
}
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnBigslime_SetupSquishFlat(this);
} else {
Math_StepToF(&this->actor.scale.x, 0.15f, 0.0025f);
@ -1820,7 +1820,7 @@ void EnBigslime_SetupFreeze(EnBigslime* this) {
this->actor.speed = 0.0f;
this->freezeTimer = 40;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
} else if ((this->actionFunc == EnBigslime_Rise) && (this->riseCounter < 2)) {
@ -1898,7 +1898,7 @@ void EnBigslime_Freeze(EnBigslime* this, PlayState* play) {
}
func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
if (this->freezeTimer == 0) {
EnBigslime_BreakIntoMinislime(this, play);
} else {
@ -1907,7 +1907,7 @@ void EnBigslime_Freeze(EnBigslime* this, PlayState* play) {
EnBigslime_SetupSquishFlat(this);
}
} else if (this->freezeTimer == 0) {
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
EnBigslime_SetupFrozenFall(this);
} else {
EnBigslime_SetupFrozenGround(this);
@ -2019,7 +2019,7 @@ void EnBigslime_FrozenFall(EnBigslime* this, PlayState* play) {
func_800B8D50(play, &this->actor, 7.0f, this->actor.yawTowardsPlayer, 5.0f, 0x10);
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnBigslime_BreakIntoMinislime(this, play);
}
}
@ -2037,7 +2037,7 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) {
s16 yaw;
s16 yawDiff;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->gekkoCollider.base.acFlags |= AC_ON;
this->actor.flags |= ACTOR_FLAG_1;
}
@ -2049,7 +2049,8 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) {
EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EV_WALK_WATER);
}
if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
this->actor.speed = 8.0f;
} else {
this->actor.speed = 0.0f;

View File

@ -205,11 +205,11 @@ void func_80871058(EnBom* this, PlayState* play) {
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;
}
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y);
if (ABS_ALT(yDiff) > 0x4000) {
@ -220,10 +220,10 @@ void func_80871058(EnBom* this, PlayState* play) {
Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND);
Actor_MoveWithGravity(&this->actor);
this->actor.speed *= 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.speed, 0.0f, 0.08f);
} else {
Vec3f* sp58;
@ -280,7 +280,7 @@ void func_80871058(EnBom* this, PlayState* play) {
this->unk_1FA += (s16)(this->actor.speed * 800.0f);
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_PlaySfx(&this->actor, this->isPowderKeg ? NA_SE_EV_TRE_BOX_BOUND : NA_SE_EV_BOMB_BOUND);
if (this->actor.velocity.y < sp58->y) {
if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) {
@ -288,7 +288,7 @@ void func_80871058(EnBom* this, PlayState* play) {
} else {
this->actor.velocity.y = this->actor.velocity.y * sp58->z;
}
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
} else if (this->timer >= 4) {
Actor_LiftActor(&this->actor, play);
@ -303,7 +303,7 @@ void func_808714D4(EnBom* this, PlayState* play) {
this->actionFunc = func_80871058;
this->actor.room = play->roomCtx.curRoom.num;
this->actor.flags &= ~ACTOR_FLAG_100000;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
Math_Vec3s_ToVec3f(&this->actor.prevPos, &this->actor.home.rot);
if (this->isPowderKeg) {
gSaveContext.powderKegTimer = 0;
@ -579,8 +579,8 @@ void EnBom_Update(Actor* thisx, PlayState* play) {
thisx->velocity.y = (KREG(83) * 0.1f) + -2.0f;
thisx->gravity = (KREG(84) * 0.1f) + -0.5f;
this->unk_1FC = KREG(81) + 10;
} else if (thisx->bgCheckFlags & 0x40) {
thisx->bgCheckFlags &= ~0x40;
} else if (thisx->bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
thisx->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
Actor_PlaySfx(thisx, NA_SE_EV_BOMB_DROP_WATER);
}
}

View File

@ -512,23 +512,23 @@ void EnBomChu_Update(Actor* thisx, PlayState* play) {
this->actor.depthInWater = waterY - this->actor.world.pos.y;
if (this->actor.depthInWater < 0.0f) {
if (this->actor.bgCheckFlags & 0x20) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
EnBomChu_SpawnRipplesAndSplashes(this, play, waterY, true);
}
this->actor.bgCheckFlags &= ~0x20;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER;
return;
}
if (!(this->actor.bgCheckFlags & 0x20) && (this->timer != 120)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->timer != 120)) {
EnBomChu_SpawnRipplesAndSplashes(this, play, waterY, true);
} else {
EffectSsBubble_Spawn(play, &this->actor.world.pos, 0.0f, 3.0f, 15.0f, 0.25f);
}
this->actor.bgCheckFlags |= 0x20;
this->actor.bgCheckFlags |= BGCHECKFLAG_WATER;
} else {
this->actor.bgCheckFlags &= ~0x20;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER;
this->actor.depthInWater = BGCHECK_Y_MIN;
}
}

View File

@ -232,17 +232,17 @@ void func_808AEE3C(EnBombf* this, PlayState* play) {
}
this->unk_204 = 1.0f;
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.025f, 0.0f);
return;
}
Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 1.5f, 0.0f);
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
func_800B8EF4(play, &this->actor);
if (this->actor.velocity.y < -6.0f) {
this->actor.velocity.y *= -0.3f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
} else if (this->timer >= 4) {
Actor_LiftActor(&this->actor, play);
@ -252,7 +252,7 @@ void func_808AEE3C(EnBombf* this, PlayState* play) {
void func_808AEF68(EnBombf* this, PlayState* play) {
if (Actor_HasNoParent(&this->actor, play)) {
EnBombf_SetupAction(this, func_808AEE3C);
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
func_808AEE3C(this, play);
} else {
this->actor.velocity.y = 0.0f;
@ -341,11 +341,11 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
}
if (ENBOMBF_GET(&this->actor) == ENBOMBF_0) {
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;
}
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y);
if (ABS_ALT(yDiff) > 0x4000) {
@ -358,7 +358,7 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 10.0f, 0.0f, 0x1F);
DREG(6) = 0;
this->actor.speed *= 0.7f;
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
}
if ((this->colliderCylinder.base.acFlags & AC_HIT) ||
@ -443,8 +443,8 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
return;
}
if (this->actor.bgCheckFlags & 0x40) {
this->actor.bgCheckFlags &= ~0x40;
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER);
}
}

View File

@ -383,7 +383,7 @@ void func_80C01A24(EnBomjimb* this, PlayState* play) {
Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f);
}
if ((this->unk_2C0 != 0) && !(this->actor.bgCheckFlags & 1)) {
if ((this->unk_2C0 != 0) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
func_80C01B40(this);
}
}
@ -396,7 +396,7 @@ void func_80C01B40(EnBomjimb* this) {
void func_80C01B74(EnBomjimb* this, PlayState* play) {
Math_ApproachF(&this->actor.speed, 6.0f, 0.5f, 2.0f);
if ((this->collider.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) {
if ((this->collider.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) {
((EnNiw*)this->unk_2E4)->unk2BC.z = 90000.0f;
@ -450,7 +450,7 @@ void func_80C01CD0(EnBomjimb* this, PlayState* play) {
this->actor.draw = NULL;
}
if ((this->unk_2C0 == 0) && (this->unk_2E4->bgCheckFlags & 1)) {
if ((this->unk_2C0 == 0) && (this->unk_2E4->bgCheckFlags & BGCHECKFLAG_GROUND)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX);
this->unk_2C0 = 1;
}
@ -840,7 +840,7 @@ void EnBomjimb_Update(Actor* thisx, PlayState* play2) {
if (this->unk_2CA == 0) {
if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) {
Math_Vec3f_Copy(&this->unk_2E4->world.pos, &this->actor.world.pos);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->unk_2E4->world.pos.y = this->actor.world.pos.y + 35.0f;
} else {
this->unk_2E4->world.pos.y = this->actor.world.pos.y + 25.0f;

View File

@ -63,22 +63,23 @@ void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc) {
void func_808A24DC(EnBoom* this, PlayState* play) {
WaterBox* sp54;
f32 sp50 = this->actor.world.pos.y;
u16 sp4E = this->actor.bgCheckFlags & 0x20;
u16 sp4E = this->actor.bgCheckFlags & BGCHECKFLAG_WATER;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) &&
(this->actor.world.pos.y < sp50)) {
Vec3f sp40;
this->actor.bgCheckFlags |= 0x20;
this->actor.bgCheckFlags |= BGCHECKFLAG_WATER;
sp40.x = this->actor.world.pos.x;
sp40.y = this->actor.world.pos.y - 20.0f;
sp40.z = this->actor.world.pos.z;
EffectSsBubble_Spawn(play, &sp40, 20.0f, 10.0f, 20.0f, 0.13f);
} else {
this->actor.bgCheckFlags &= ~0x20;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER;
}
if ((this->actor.bgCheckFlags & 0x40) && ((this->actor.bgCheckFlags & 0x20) != sp4E)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) &&
((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) != sp4E)) {
Vec3f sp34;
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &sp34);
@ -102,7 +103,7 @@ void func_808A24DC(EnBoom* this, PlayState* play) {
EffectSsGRipple_Spawn(play, &sp34, 100, 500, 8);
}
this->actor.bgCheckFlags |= 0x40;
this->actor.bgCheckFlags |= BGCHECKFLAG_WATER_TOUCH;
}
void EnBoom_Init(Actor* thisx, PlayState* play) {
@ -262,7 +263,7 @@ void func_808A2918(EnBoom* this, PlayState* play) {
Math_Vec3f_Copy(&sp7C->world.pos, &player->actor.world.pos);
if (sp7C->id == ACTOR_EN_ITEM00) {
sp7C->gravity = -0.9f;
sp7C->bgCheckFlags &= ~3;
sp7C->bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
} else {
sp7C->flags &= ~ACTOR_FLAG_2000;
}

View File

@ -345,7 +345,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) {
this->alpha = 255;
this->movementFlags &= ~ENBOX_MOVE_IMMOBILE;
if (this->dyna.actor.bgCheckFlags & 1) {
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->movementFlags |= ENBOX_MOVE_UNUSED;
if (this->movementFlags & ENBOX_MOVE_FALL_ANGLE_SIDE) {
this->movementFlags &= ~ENBOX_MOVE_FALL_ANGLE_SIDE;

View File

@ -250,7 +250,7 @@ void EnBubble_Fly(EnBubble* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_AWA_BOUND);
this->modelRotSpeed = 128.0f;
this->modelEllipticity = 0.48f;
} else if ((this->actor.bgCheckFlags & 0x20) && (bounceDirection.y < 0.0f)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (bounceDirection.y < 0.0f)) {
normal.x = normal.z = 0.0f;
normal.y = 1.0f;
EnBubble_Vec3fNormalizedReflect(&bounceDirection, &normal, &bounceDirection);

View File

@ -468,7 +468,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) {
EnClearTag_CreateFlashEffect(this, &pos, sFlashMaxScale[thisx->params], this->actor.floorHeight);
// Is not underwater
if (!(this->actor.bgCheckFlags & 0x20)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
if (thisx->params < 10) {
pos.y = this->actor.world.pos.y - 40.0f;

View File

@ -114,7 +114,7 @@ void func_80AFDD60(EnColMan* this) {
}
void func_80AFDE00(EnColMan* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.params == EN_COL_MAN_HEART_PIECE) {
this->actor.params = EN_COL_MAN_RECOVERY_HEART;
this->actor.speed = 2.0f;
@ -161,7 +161,7 @@ void func_80AFDFB4(EnColMan* this, PlayState* play) {
this->scale = (BREG(55) / 10000.0f) + 0.0015f;
if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) {
if (!this->hasSetRandomValues) {
this->actor.world.rot.y = randPlusMinusPoint5Scaled(30000.0f);
this->actor.speed = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f);

View File

@ -174,7 +174,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_1;
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->yawTarget = this->actor.wallYaw;
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->yawTarget = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -192,7 +192,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_CRY);
}
if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) {
if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->pitchTarget = -0x1000;
} else if (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f)) {
this->pitchTarget = -Rand_S16Offset(0x800, 0x800);
@ -211,7 +211,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
this->pitchTarget = CLAMP(this->pitchTarget, -0x1000, 0x1000);
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_ScaledStepToS(&this->actor.shape.rot.x, -0x100, 0x400);
}
@ -273,7 +273,8 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
if (((this->timer == 0) || ((&player->actor != this->actor.child) && (this->actor.child->home.rot.z != 0)) ||
((&player->actor == this->actor.child) &&
((Player_GetMask(play) == PLAYER_MASK_STONE) || (player->stateFlags1 & PLAYER_STATE1_800000))) ||
((this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 9))) ||
((this->collider.base.atFlags & AT_HIT) ||
(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)))) ||
(this->actor.depthInWater > -40.0f)) {
if (this->collider.base.atFlags & AT_HIT) {
@ -300,7 +301,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) {
Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f);
this->actor.shape.yOffset = 0.0f;
this->actor.targetArrowOffset = 0.0f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
scale = (this->actor.scale.x * 100.0f);
this->actor.world.pos.y += 20.0f * scale;
Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD);
@ -343,7 +344,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200);
this->actor.shape.rot.z += 0x1780;
}
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
EnCrow_CheckIfFrozen(this, play);
func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, this->actor.scale.x * 10000.0f, 0, 0);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT);
@ -400,7 +401,7 @@ void EnCrow_SetupTurnAway(EnCrow* this) {
void EnCrow_TurnAway(EnCrow* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->yawTarget = this->actor.wallYaw;
} else {
this->yawTarget = this->actor.yawTowardsPlayer + 0x8000;

View File

@ -861,7 +861,8 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) {
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, (s32)(this->size * 12.0f),
(s32)(this->size * 5.0f), 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) {
if ((this->actor.scale.x > 0.005f) &&
((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) {
this->actor.scale.z = 0.0f;
this->actor.scale.y = 0.0f;
this->actor.scale.x = 0.0f;
@ -871,7 +872,7 @@ void EnDekubaba_PrunedSomersaultDie(EnDekubaba* this, PlayState* play) {
(s32)(this->size * 5.0f), 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK);
this->timer = 1;
}

View File

@ -413,9 +413,9 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 7.5f, 1.0f);
if (!Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_192, 1, 0xE38, 0xB6)) {
if (this->actor.bgCheckFlags & 0x20) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->unk_192 = this->actor.wallYaw;
} else if (this->unk_18D == 0) {
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);

View File

@ -322,7 +322,7 @@ void EnDg_MoveAlongPath(EnDg* this, PlayState* play) {
if (this->path != NULL) {
yRotation = EnDg_GetYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSq);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
yRotation = this->actor.wallYaw;
}
@ -397,7 +397,7 @@ void EnDg_PlaySfxGrowl(EnDg* this, f32 frame) {
}
void EnDg_SetupIdleMove(EnDg* this, PlayState* play) {
if (!(this->actor.bgCheckFlags & 0x20)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
if ((this->index == ENDG_INDEX_SWAMP_SPIDER_HOUSE) ||
((this->index == ENDG_INDEX_ROMANI_RANCH) && (play->sceneId == SCENE_OMOYA))) {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_WALK);
@ -608,7 +608,7 @@ s32 EnDg_ShouldReactToNonHumanPlayer(EnDg* this, PlayState* play) {
void EnDg_ChooseActionForForm(EnDg* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (!(this->actor.bgCheckFlags & 0x20)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
switch (player->transformation) {
case PLAYER_FORM_HUMAN:
if (this->behavior != DOG_BEHAVIOR_HUMAN) {
@ -680,7 +680,7 @@ void EnDg_IdleMove(EnDg* this, PlayState* play) {
EnDg_CheckForBremenMaskMarch(this, play);
EnDg_PlaySfxWalk(this);
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actionFunc = EnDg_Fall;
}
@ -704,7 +704,7 @@ void EnDg_IdleBark(EnDg* this, PlayState* play) {
EnDg_PlaySfxBark(this, 13.0f);
EnDg_PlaySfxBark(this, 19.0f);
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actionFunc = EnDg_Fall;
}
@ -728,7 +728,7 @@ void EnDg_BackAwayFromGoron(EnDg* this, PlayState* play) {
this->actionFunc = EnDg_RunAwayFromGoron;
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.shape.rot.y = this->actor.wallYaw;
}
@ -752,7 +752,7 @@ void EnDg_RunAwayFromGoron(EnDg* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 250.0f) {
Math_ApproachS(&this->actor.shape.rot.y, -this->actor.yawTowardsPlayer, 4, 0xC00);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
yRotation = this->actor.wallYaw;
} else {
yRotation = 0;
@ -805,7 +805,7 @@ void EnDg_ApproachPlayerToAttack(EnDg* this, PlayState* play) {
this->actor.velocity.y = 0.0f;
this->actor.gravity = -3.0f;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.shape.rot.y = this->actor.wallYaw;
}
@ -859,7 +859,7 @@ void EnDg_RunAfterAttacking(EnDg* this, PlayState* play) {
void EnDg_SitNextToPlayer(EnDg* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actionFunc = EnDg_Fall;
}
@ -966,7 +966,7 @@ void EnDg_SetupBremenMaskApproachPlayer(EnDg* this, PlayState* play) {
}
void EnDg_Fall(EnDg* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_RUN);
this->actionFunc = EnDg_IdleMove;
}
@ -1026,7 +1026,7 @@ void EnDg_SlowlyBackUpBeforeAttacking(EnDg* this, PlayState* play) {
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.shape.rot.y = this->actor.wallYaw;
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_JUMP_ATTACK);
this->actionFunc = EnDg_JumpAttack;
@ -1054,7 +1054,7 @@ void EnDg_BackAwayFromPlayer(EnDg* this, PlayState* play) {
this->actionFunc = EnDg_BarkAtPlayer;
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.shape.rot.y = this->actor.wallYaw;
}
@ -1158,7 +1158,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) {
// over. For example, if the player throws the dog at a tall wall next to some water,
// this code will make the dog "skip" along the water's surface, assuming the floor
// height is low enough to make it try to jump out.
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (!WaterBox_GetSurface1(play, &play->colCtx, pos.x, pos.z, &waterSurface, &waterBox)) {
if (floorHeight > -100.0f) {
this->dogFlags &= ~DOG_FLAG_SWIMMING;
@ -1176,7 +1176,7 @@ void EnDg_Swim(EnDg* this, PlayState* play) {
} else {
yRotation = this->actor.wallYaw;
}
} else if ((this->actor.bgCheckFlags & 1) && !(this->actor.bgCheckFlags & 0x20)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->actor.gravity = -3.0f;
this->dogFlags &= ~DOG_FLAG_SWIMMING;
this->behavior = DOG_BEHAVIOR_DEFAULT;
@ -1216,13 +1216,13 @@ void EnDg_JumpOutOfWater(EnDg* this, PlayState* play) {
this->actor.velocity.y = -1.0f;
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.world.pos.y = pos.y;
this->actor.velocity.y = 10.0f;
EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 800);
}
if (!(this->actor.bgCheckFlags & 0x20)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->behavior = DOG_BEHAVIOR_DEFAULT;
this->actor.velocity.y = 10.0f;
this->actor.gravity = -3.0f;
@ -1260,7 +1260,7 @@ void EnDg_Held(EnDg* this, PlayState* play) {
void EnDg_Thrown(EnDg* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->dogFlags & DOG_FLAG_THROWN) {
this->dogFlags &= ~DOG_FLAG_THROWN;
Actor_PlaySfx(&this->actor, NA_SE_EV_MONKEY_WALK);
@ -1350,7 +1350,7 @@ void EnDg_Update(Actor* thisx, PlayState* play) {
EnDg_SetupIdleMove(this, play);
}
if ((this->actor.bgCheckFlags & 0x40) && Actor_HasNoParent(&this->actor, play)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) && Actor_HasNoParent(&this->actor, play)) {
EnDg_ChangeAnim(&this->skelAnime, sAnimationInfo, DOG_ANIM_SWIM);
this->actionFunc = EnDg_SetupSwim;
}

View File

@ -523,7 +523,7 @@ void func_8089B3D4(EnDinofos* this, PlayState* play) {
}
Play_SetCameraAtEye(play, this->subCamId, &subCamAt, &subCam->eye);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_8089B4A4(this);
}
}
@ -733,7 +733,7 @@ void func_8089BD28(EnDinofos* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8);
if (!func_8089AE00(this, play)) {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->actor.speed >= 0.0f) {
phi_v0 = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
} else {
@ -835,20 +835,20 @@ void func_8089C164(EnDinofos* this) {
}
}
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP);
this->actionFunc = func_8089C1F8;
}
void func_8089C1F8(EnDinofos* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_8089C398(this);
}
}
void func_8089C244(EnDinofos* this) {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.speed = 8.0f;
this->actor.velocity.y = 16.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_RIZA_JUMP);
@ -867,7 +867,7 @@ void func_8089C2A8(EnDinofos* this, PlayState* play) {
Animation_Change(&this->skelAnime, &object_dinofos_Anim_0025B4, 1.0f, 7.0f, 13.0f, ANIMMODE_ONCE, -2.0f);
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->colliderQuad.base.atFlags &= ~AT_ON;
func_8089C398(this);
}
@ -947,7 +947,7 @@ void func_8089C690(EnDinofos* this) {
}
void func_8089C724(EnDinofos* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
}
@ -1002,7 +1002,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) {
void func_8089C938(EnDinofos* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 0.0f, 0.5f);
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (this->actor.colChkInfo.health == 0) {
if (this->actor.cutscene == -1) {
func_8089CFAC(this);

View File

@ -370,7 +370,7 @@ void func_80B3D3F8(EnDnp* this, PlayState* play) {
}
void func_80B3D47C(EnDnp* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_SmoothStepToF(&this->actor.scale.x, 0.0085f, 0.1f, 0.01f, 0.001f);
if ((s32)(this->actor.scale.x * 10000.0f) >= 85) {
this->actor.flags |= ACTOR_FLAG_1;

View File

@ -272,7 +272,8 @@ s32 func_8092CC68(PlayState* play) {
s32 ret = false;
s16 bgId;
if (!Play_InCsMode(play) && (player->actor.bgCheckFlags & 1) && (player->transformation != PLAYER_FORM_DEKU)) {
if (!Play_InCsMode(play) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(player->transformation != PLAYER_FORM_DEKU)) {
bgId = player->actor.floorBgId;
if (SurfaceType_GetSceneExitIndex(&play->colCtx, player->actor.floorPoly, bgId) != 4) {
ret = true;

View File

@ -1025,7 +1025,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play2) {
this->actionFunc(this, play);
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D);
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN);
}

View File

@ -121,8 +121,9 @@ void EnEstone_Active(EnEstone* this, PlayState* play) {
Actor_Kill(&this->actor);
return;
}
if (((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) || (this->collider.base.atFlags & 4)) {
this->collider.base.atFlags &= ~4;
if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) ||
(this->collider.base.atFlags & AT_BOUNCED)) {
this->collider.base.atFlags &= ~AT_BOUNCED;
if (this->actor.params == ENESTONE_TYPE_LARGE) {
for (i = 0; i < 2; i++) {
accel.x = 2.0f * (Rand_ZeroOne() - 0.5f);

View File

@ -544,7 +544,7 @@ void EnFamos_Attack(EnFamos* this, PlayState* play) {
}
surfaceType = func_800C9B18(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
hitFloor = this->actor.bgCheckFlags & 1;
hitFloor = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND;
if (hitFloor || (this->actor.floorHeight == BGCHECK_Y_MIN) || (surfaceType == 0xC) || (surfaceType == 0xD)) {
this->collider1.base.atFlags &= ~AT_ON;
this->collider2.base.atFlags |= AT_ON;
@ -617,7 +617,7 @@ void EnFamos_AttackRebound(EnFamos* this, PlayState* play) {
}
}
if ((this->baseHeight < this->actor.world.pos.y) || (this->actor.bgCheckFlags & 0x10)) { // touching ceiling
if ((this->baseHeight < this->actor.world.pos.y) || (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) {
this->actor.speed = 0.0f;
EnFamos_SetupChase(this);
}
@ -768,7 +768,7 @@ void EnFamos_Update(Actor* thisx, PlayState* play) {
if (this->flippedTimer >= 0) {
Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 30.0f, 80.0f, 0x1F);
if ((this->actionFunc == EnFamos_Attack) && (this->animatedMaterialIndex != FAMOS_ANIMATED_MAT_NORMAL) &&
(this->actor.bgCheckFlags & 1)) { // touch floor
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.world.pos.y -= 60.0f;
}
}

View File

@ -275,7 +275,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) {
this->skelAnime.playSpeed = 0.0f;
}
if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) {
if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
EnFg_ChangeAnim(&this->skelAnime, 0);
this->actionFunc = EnFg_Idle;
this->actor.velocity.y = 0.0f;
@ -289,7 +289,7 @@ void EnFg_DoNothing(EnFg* this, PlayState* play) {
}
void EnFg_Knockback(EnFg* this, PlayState* play) {
if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) {
if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->bounceCounter++;
if (this->bounceCounter < 4) {
this->actor.shape.rot.x += 0x1000;
@ -298,7 +298,7 @@ void EnFg_Knockback(EnFg* this, PlayState* play) {
this->actionFunc = EnFg_DoNothing;
}
} else {
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.world.rot.y = this->actor.wallYaw;
this->actor.shape.rot = this->actor.world.rot;
}

View File

@ -317,9 +317,10 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
this->pitchTarget = 0x2154;
}
} else {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->pitchTarget = 0x954;
} else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) ||
(this->maxAltitude < this->actor.world.pos.y)) {
this->pitchTarget = 0x2154;
}
}
@ -327,7 +328,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100);
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
}
@ -389,7 +390,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) {
this->actor.shape.rot.y -= 0x300;
}
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
EnFirefly_SpawnIceEffects(this, play);
EnFirefly_SetupDie(this);
}
@ -436,7 +437,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 4.0f, 0.5f);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100);
} else if (Actor_IsFacingPlayer(&this->actor, 0x2800)) {
@ -457,11 +458,11 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300);
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->pitchTarget = 0x954;
}
if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->maxAltitude < this->actor.world.pos.y)) {
this->pitchTarget = 0x2154;
} else {
this->pitchTarget = 0x954;
@ -523,15 +524,15 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 3.0f, 0.3f);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->pitchTarget = 0x954;
} else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->maxAltitude < this->actor.world.pos.y)) {
this->pitchTarget = 0x2154;
} else {
this->pitchTarget = 0x954;
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
} else {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
@ -560,7 +561,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) {
void EnFirefly_Stunned(EnFirefly* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1554, 0x100);
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if (this->timer != 0) {
this->timer--;
}

View File

@ -507,10 +507,10 @@ void func_8091E880(Actor* thisx, PlayState* play) {
this->unk_272 = 0x43;
this->unk_268 = 0x4000;
this->unk_26C = -0x4000;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->unk_240 = 400;
func_8091E9A4(this);
} else if (this->actor.bgCheckFlags & 0x20) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L);
func_8091D840(thisx, play, 10, 15.0f);
if (func_8091DA14(this, play)) {
@ -592,13 +592,13 @@ void func_8091EAF0(Actor* thisx, PlayState* play) {
} else {
this->actor.draw = NULL;
}
} else if (this->actor.bgCheckFlags & 0x20) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
if (func_8091DA14(this, play)) {
func_8091EF30(this);
} else {
func_8091ECF4(this);
}
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_8091E9A4(this);
}
}
@ -627,7 +627,7 @@ void func_8091ED70(Actor* thisx, PlayState* play) {
Math_SmoothStepToF(&thisx->speed, 2.8f, 0.1f, 0.4f, 0.0f);
if ((thisx->bgCheckFlags & 8) || !(thisx->bgCheckFlags & 0x20)) {
if ((thisx->bgCheckFlags & BGCHECKFLAG_WALL) || !(thisx->bgCheckFlags & BGCHECKFLAG_WATER)) {
sp2E = Math_Vec3f_Yaw(&thisx->world.pos, &thisx->home.pos);
thisx->home.rot.y = Rand_S16Offset(-100, 100) + sp2E;
thisx->speed *= 0.5f;
@ -640,7 +640,7 @@ void func_8091ED70(Actor* thisx, PlayState* play) {
this->unk_270 = 2000;
this->unk_272 = 0x29B;
if (thisx->bgCheckFlags & 1) {
if (thisx->bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 4.0f, 2.0f);
} else {
Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 10.0f, 2.0f);
@ -706,12 +706,13 @@ void func_8091EFE8(Actor* thisx, PlayState* play) {
}
}
if ((this->actor.bgCheckFlags & 8) && !(this->actor.bgCheckFlags & 0x20)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->actor.speed *= 0.5f;
}
if (((Rand_Next() >> 0x1B) == 0) || ((this->actor.bgCheckFlags & 8) && ((Rand_Next() >> 0x1E) == 0)) ||
!(this->actor.bgCheckFlags & 0x20)) {
if (((Rand_Next() >> 0x1B) == 0) ||
((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && ((Rand_Next() >> 0x1E) == 0)) ||
!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
temp_f0 = Rand_ZeroOne();
sp34 = (1.0f - SQ(temp_f0)) * sp3C->home.rot.x;
sp30 = Rand_ZeroOne() * sp3C->home.rot.z;

View File

@ -404,7 +404,7 @@ void func_80B28C14(EnFish2* this, PlayState* play) {
} else if ((itemAction->update != NULL) && (itemAction->params == 0) &&
(fabsf(itemAction->world.pos.x - this->actor.world.pos.x) < 100.0f) &&
(fabsf(itemAction->world.pos.z - this->actor.world.pos.z) < 100.0f) &&
(itemAction->bgCheckFlags & 0x20)) {
(itemAction->bgCheckFlags & BGCHECKFLAG_WATER)) {
this->unk_350 = itemAction;
if (D_80B2B2E0 == 0) {
EnFish2* fish;

View File

@ -946,7 +946,7 @@ void EnFishing_Init(Actor* thisx, PlayState* play2) {
return;
}
thisx->bgCheckFlags |= 0x800; // Added in MM
thisx->bgCheckFlags |= BGCHECKFLAG_PLAYER_800; // Added in MM
if ((thisx->params < 115) || (thisx->params == 200)) {
SkelAnime_InitFlex(play, &this->skelAnime, &gFishingFishSkel, &gFishingFishAnim, NULL, NULL, 0);
@ -2234,10 +2234,10 @@ void EnFishing_UpdateLure(EnFishing* this, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 30.0f, 30.0f, 0x43);
this->actor.world.pos = sp80;
if (this->actor.bgCheckFlags & 0x10) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) {
D_80917238.y = -0.5f;
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (D_80917238.y > 0.0f) {
D_80917238.y = 0.0f;
}
@ -4104,11 +4104,11 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) {
this->actor.velocity.y = velocityY;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->unk_198 = 20;
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.world.pos.y > WATER_SURFACE_Y(play)) {
this->unk_17C = Rand_ZeroFloat(3.0f) + 3.0f;
this->actor.velocity.x = this->actor.world.pos.x * -0.003f;

View File

@ -321,7 +321,7 @@ void func_808D0D70(EnFloormas* this, PlayState* play) {
if ((this->actor.xzDistToPlayer < 320.0f) && Actor_IsFacingPlayer(&this->actor, 0x4000)) {
func_808D0F50(this);
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->unk_190 = this->actor.wallYaw;
func_808D108C(this);
} else if ((this->actor.xzDistToPlayer < 400.0f) && !Actor_IsFacingPlayer(&this->actor, 0x4000)) {
@ -360,7 +360,7 @@ void func_808D0F80(EnFloormas* this, PlayState* play) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C);
if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsFacingPlayer(&this->actor, 0x2000) &&
!(this->actor.bgCheckFlags & 8)) {
!(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
func_808D1380(this, play);
} else if (this->actor.xzDistToPlayer > 400.0f) {
func_808D0CE4(this);
@ -485,7 +485,7 @@ void func_808D1650(EnFloormas* this, PlayState* play) {
func_808D14DC(this, play);
}
if ((this->actor.bgCheckFlags & 8) || (this->unk_18E == 0)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_18E == 0)) {
func_808D1740(this);
}
}
@ -502,9 +502,9 @@ void func_808D1740(EnFloormas* this) {
}
void func_808D17EC(EnFloormas* this, PlayState* play) {
s32 sp24 = this->actor.bgCheckFlags & 1;
s32 sp24 = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND;
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
if (this->actor.params != ENFLOORMAS_GET_7FFF_40) {
func_808D0908(this);
}
@ -518,7 +518,7 @@ void func_808D17EC(EnFloormas* this, PlayState* play) {
}
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.speed = 0.0f;
}
@ -581,7 +581,7 @@ void func_808D19D4(EnFloormas* this) {
}
void func_808D1B44(EnFloormas* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (SkelAnime_Update(&this->skelAnime)) {
this->actor.flags |= ACTOR_FLAG_1;
this->unk_194 = 50;
@ -589,7 +589,7 @@ void func_808D1B44(EnFloormas* this, PlayState* play) {
}
Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
}
}
@ -612,7 +612,7 @@ void func_808D1C1C(EnFloormas* this, PlayState* play) {
if (this->unk_194 == 0) {
func_808D1D0C(this);
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->unk_190 = this->actor.wallYaw;
func_808D108C(this);
} else if (this->actor.xzDistToPlayer < 120.0f) {
@ -637,7 +637,7 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK);
}
flags = this->actor.bgCheckFlags & 8;
flags = this->actor.bgCheckFlags & BGCHECKFLAG_WALL;
if (flags) {
this->unk_190 = this->actor.wallYaw;
func_808D108C(this);
@ -699,7 +699,7 @@ void func_808D2040(EnFloormas* this, PlayState* play) {
} else if (Animation_OnFrame(&this->skelAnime, 20.0f)) {
this->actor.speed = 5.0f;
this->actor.velocity.y = 7.0f;
} else if (this->actor.bgCheckFlags & 2) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->unk_18E = 50;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
@ -783,7 +783,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) {
} else if (this->actor.child->params == ENFLOORMAS_GET_7FFF_40) {
phi_s1 = this->actor.child;
} else {
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.params = ENFLOORMAS_GET_7FFF_10;
func_808D1740(this);
}
@ -800,7 +800,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) {
(fabsf(this->actor.world.pos.z - phi_s1->world.pos.z) < 10.0f)) {
func_808D2A20(this);
this->collider.base.ocFlags1 |= OC1_ON;
} else if (this->actor.bgCheckFlags & 2) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
func_808D1740(this);
@ -944,7 +944,7 @@ void func_808D2B18(EnFloormas* this) {
}
void func_808D2C08(EnFloormas* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (this->actor.colChkInfo.health == 0) {
func_808D0930(this, play);
} else {

View File

@ -254,7 +254,7 @@ void func_80961D7C(PlayState* play) {
Actor* explosive = play->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first;
while (explosive != NULL) {
if ((explosive->id == ACTOR_EN_BOM) && (explosive->bgCheckFlags & 1)) {
if ((explosive->id == ACTOR_EN_BOM) && (explosive->bgCheckFlags & BGCHECKFLAG_GROUND)) {
EnBom* bomb = (EnBom*)explosive;
if (bomb->actor.floorBgId != BGCHECK_SCENE) {
@ -776,7 +776,7 @@ void func_80962F4C(EnFu* this, PlayState* play) {
}
if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) &&
(player->actor.bgCheckFlags & 1)) ||
(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) ||
(gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] <= SECONDS_TO_TIMER(0)) || (this->unk_548 == this->unk_54C)) {
player->stateFlags3 &= ~PLAYER_STATE3_400000;
func_80961E88(play);

View File

@ -187,7 +187,7 @@ void func_80ACE718(EnFuMato* this, PlayState* play) {
Actor_UpdatePos(&this->dyna.actor);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 15.0f, 30.0f, 60.0f, 5);
if ((this->dyna.actor.bgCheckFlags & 1) || (this->dyna.actor.world.pos.y < -500.0f)) {
if ((this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->dyna.actor.world.pos.y < -500.0f)) {
Vec3f sp3C = { 0.0f, 0.0f, 0.0f };
Vec3f sp30 = { 0.0f, 2.0f, 0.0f };
@ -330,7 +330,7 @@ void func_80ACECFC(EnFuMato* this, PlayState* play) {
if (this->unk_302 == 1) {
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 15.0f, 30.0f, 60.0f, 5);
if (this->dyna.actor.bgCheckFlags & 1) {
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_80ACEB2C(this);
}
}

View File

@ -359,9 +359,9 @@ void func_80932C98(EnFz* this, PlayState* play) {
Vec3f sp3C;
if (this->unk_BCD != 0) {
if ((this->actor.bgCheckFlags & 8) ||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
!Actor_TestFloorInDirection(&this->actor, play, 60.0f, this->actor.world.rot.y)) {
this->actor.bgCheckFlags &= ~0x8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
this->unk_BCD = 0;
this->unk_BBC = 0.0f;
this->actor.speed = 0.0f;

View File

@ -405,7 +405,7 @@ void EnGe2_Charge(EnGe2* this, PlayState* play) {
if (this->picto.actor.xzDistToPlayer < 50.0f) {
EnGe2_SetupCapturePlayer(this);
} else if (!(this->picto.actor.bgCheckFlags & 1)) {
} else if (!(this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->picto.actor.world.pos = this->picto.actor.prevPos;
EnGe2_SetupCapturePlayer(this);
}

View File

@ -222,7 +222,7 @@ void func_80BB178C(EnGeg* this, PlayState* play) {
}
s32 func_80BB18FC(EnGeg* this, Actor* actor) {
if (actor->bgCheckFlags & 1) {
if (actor->bgCheckFlags & BGCHECKFLAG_GROUND) {
f32 sp24 = Math_Vec3f_DistXZ(&this->actor.world.pos, &actor->world.pos);
f32 sp20 = Math_Vec3f_DiffY(&this->actor.world.pos, &actor->world.pos);
@ -739,7 +739,7 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
if ((this->actor.xzDistToPlayer < 150.0f) && (fabsf(this->actor.playerHeightRel) < 10.0f) &&
(this->actor.bgCheckFlags & 1)) {
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->unk_4AC = 2;
this->actor.speed = 0.0f;
this->unk_230 &= ~1;
@ -751,7 +751,7 @@ void func_80BB2F7C(EnGeg* this, PlayState* play) {
Actor_MoveWithGravity(&this->actor);
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->unk_230 & 0x80) {
func_800B9010(&this->actor, NA_SE_EN_GOLON_SIRLOIN_ROLL - SFX_FLAG);
} else {

View File

@ -652,7 +652,7 @@ void EnGg_Init(Actor* thisx, PlayState* play) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->actor.bgCheckFlags |= 0x400;
this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400;
SkelAnime_InitFlex(play, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable,
this->morphTable, 20);

View File

@ -366,7 +366,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->actor.bgCheckFlags |= 0x400;
this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400;
SkelAnime_InitFlex(play, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable,
this->morphTable, 20);
this->unk_1D8 = SubS_GetPathByIndex(play, ENGG2_GET_FC00(&this->actor), 0x3F);

View File

@ -816,7 +816,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) {
}
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
sp38.y = this->actor.wallYaw;
}

View File

@ -1012,7 +1012,7 @@ s32 func_80A13564(EnGo* this, f32 arg1, f32 arg2, s32 arg3) {
f32 temp_f14 = this->actor.velocity.y + this->actor.gravity;
s32 ret;
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
ret = true;
} else {
if (temp_f14 > 0.0f) {
@ -1801,7 +1801,7 @@ void func_80A153FC(EnGo* this, PlayState* play) {
Math_ApproachS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&sp50, &sp44), 4, 0x38E);
this->actor.shape.rot.y = this->actor.world.rot.y;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Actor_PlaySfx(&this->actor, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG);
func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_3E8), &this->actor.world.pos, 18.0f,
this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId);

View File

@ -1207,7 +1207,7 @@ void func_80941A10(EnGoroiwa* this, PlayState* play) {
}
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Actor_PlaySfx(&this->actor, D_80942E9C[this->unk_1E4][this->actor.home.rot.x & 1]);
}
}
@ -1225,7 +1225,7 @@ void func_80941DB4(EnGoroiwa* this) {
void func_80941E28(EnGoroiwa* this, PlayState* play) {
func_8093F34C(this);
if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) {
if ((this->unk_1E5 & 8) && ((this->actor.home.rot.z & 3) == 1)) {
func_8093EDB0(this);
}
@ -1440,7 +1440,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) {
this->unk_1CC--;
}
if ((ENGOROIWA_GET_3000(&this->actor) == ENGOROIWA_3000_2) && (this->actor.bgCheckFlags & 1) &&
if ((ENGOROIWA_GET_3000(&this->actor) == ENGOROIWA_3000_2) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(this->actionFunc == func_80941A10) && (this->actor.speed > 2.0f)) {
Math_StepToF(&this->actor.scale.x, 0.16f,
(this->actor.xzDistToPlayer < 400.0f) ? this->unk_1E0 * 1.4f : this->unk_1E0);
@ -1497,12 +1497,12 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) {
if (this->actor.floorHeight > BGCHECK_Y_MIN) {
this->actor.floorBgId = bgId;
if (this->actor.world.pos.y <= (this->actor.floorHeight + 2.0f)) {
this->actor.bgCheckFlags |= 1;
this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND;
} else {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
} else {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.floorBgId = 50;
}
break;

View File

@ -450,7 +450,8 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) {
collisionCheckPos.y = this->actor.world.pos.y;
collisionCheckPos.z = (Math_CosS(this->actor.shape.rot.y) * 100.0f) + this->actor.world.pos.z;
if ((this->actor.bgCheckFlags & 8) || BgCheck_SphVsFirstPoly(&play->colCtx, &collisionCheckPos, 10.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
BgCheck_SphVsFirstPoly(&play->colCtx, &collisionCheckPos, 10.0f)) {
EnGrasshopper_SetupBank(this);
} else if (player->stateFlags1 & PLAYER_STATE1_8000000) {
this->collider.elements[0].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD);

View File

@ -843,7 +843,7 @@ s32 func_809995A4(EnGs* this, PlayState* play) {
if (this->unk_19D == 4) {
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 60.0f, 3);
if (this->actor.bgCheckFlags & (0x10 | 0x8)) {
if (this->actor.bgCheckFlags & (BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) {
Vec3f sp54;
sp54.x = this->actor.world.pos.x;

View File

@ -165,7 +165,7 @@ void func_80B21EA4(EnHakurock* this, s32 arg1) {
}
void func_80B21FFC(EnHakurock* this) {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->collider.base.atFlags &= ~AT_HIT;
this->collider.base.ocFlags1 &= ~OC1_HIT;
this->actor.draw = NULL;
@ -210,7 +210,7 @@ void func_80B221E8(EnHakurock* this, PlayState* play) {
this->actor.shape.rot.z += 0xB00;
if ((this->collider.base.atFlags & AT_HIT) || ((this->counter == 0) && (this->collider.base.ocFlags1 & OC1_HIT)) ||
((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f))) {
((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f))) {
Actor_PlaySfx(&this->actor, NA_SE_EV_ROCK_BROKEN);
func_80B21EA4(this, 0);
func_80B21FFC(this);
@ -244,7 +244,7 @@ void func_80B2242C(EnHakurock* this, PlayState* play) {
if ((this->collider.base.ocFlags1 & OC1_HIT) && (this->collider.base.oc == this->actor.parent)) {
func_80B21EA4(this, 1);
func_80B21FFC(this);
} else if ((this->actor.bgCheckFlags & 1)) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
func_80B21EA4(this, 2);
Actor_PlaySfx(&this->actor, NA_SE_EV_OBJECT_STICK);
func_80B224C0(this);

View File

@ -241,7 +241,7 @@ void func_80C200B8(EnHintSkb* this, PlayState* play) {
}
void func_80C2011C(EnHintSkb* this) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = 0.0f;
}
Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE);
@ -249,15 +249,15 @@ void func_80C2011C(EnHintSkb* this) {
}
void func_80C2016C(EnHintSkb* this, PlayState* play) {
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->actor.speed = 0.0f;
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.speed < 0.0f) {
this->actor.speed += 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) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
func_80C20484(this);
@ -280,7 +280,7 @@ void func_80C20274(EnHintSkb* this) {
} else {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = -4.0f;
}
}
@ -289,7 +289,7 @@ void func_80C20274(EnHintSkb* this) {
}
void func_80C20334(EnHintSkb* this, PlayState* play) {
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
s32 i;
for (i = 0; i < 10; i++) {
@ -298,7 +298,7 @@ void func_80C20334(EnHintSkb* this, PlayState* play) {
this->actor.speed = 0.0f;
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.speed < 0.0f) {
this->actor.speed += 0.05f;
} else if (this->actor.speed != 0.0f) {
@ -309,7 +309,8 @@ void func_80C20334(EnHintSkb* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 16, 2000, 100);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->actor.bgCheckFlags & 1)) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) &&
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.world.rot = this->actor.shape.rot;
func_80C1FE30(this);
}
@ -318,7 +319,7 @@ void func_80C20334(EnHintSkb* this, PlayState* play) {
void func_80C20484(EnHintSkb* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4);
this->unk_3E8 |= 4;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = -6.0f;
}
this->actionFunc = func_80C204F0;
@ -334,7 +335,7 @@ void func_80C204F0(EnHintSkb* this, PlayState* play) {
}
void func_80C20540(EnHintSkb* this) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = 0.0f;
}
Actor_PlaySfx(&this->actor, NA_SE_EN_COMMON_FREEZE);
@ -362,7 +363,7 @@ void func_80C20590(EnHintSkb* this, PlayState* play) {
}
void func_80C2066C(EnHintSkb* this) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = 0.0f;
}
this->actionFunc = func_80C2069C;
@ -452,7 +453,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) {
}
if (this->unk_3E6 == 0x1147) {
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
s32 i;
this->actor.speed = 0.0f;
@ -470,7 +471,7 @@ void func_80C208D0(EnHintSkb* this, PlayState* play) {
}
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x71C, 0xB6);
this->actor.shape.rot.y = this->actor.world.rot.y;
}
@ -611,7 +612,8 @@ void func_80C20D64(EnHintSkb* this, PlayState* play) {
void func_80C20E90(EnHintSkb* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((this->actor.bgCheckFlags & 0x60) && (this->actor.depthInWater >= 40.0f)) {
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
(this->actor.depthInWater >= 40.0f)) {
this->actor.colChkInfo.health = 0;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
func_80C20484(this);

View File

@ -345,7 +345,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) {
func_8017D7C0(this->actor.world.pos.x, this->actor.world.pos.z, sp80.x, sp80.z, sp8C.x, sp8C.z, &sp70);
if ((this->actor.bgCheckFlags & 8) || (this->unk_1EC & 4)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_1EC & 4)) {
EnHorse_RotateToPoint(this, play, &sp8C, 0xC80);
if (this->unk_1EC & 4) {
this->unk_1EC &= ~4;
@ -3744,7 +3744,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 40.0f, 35.0f, 100.0f, 0x1C);
}
if ((this->actor.bgCheckFlags & 8) && (Math_CosS(this->actor.wallYaw - this->actor.world.rot.y) < -0.3f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
(Math_CosS(this->actor.wallYaw - this->actor.world.rot.y) < -0.3f)) {
if (this->actor.speed > 4.0f) {
this->actor.speed -= 1.0f;
if (this->type == HORSE_TYPE_2) {

View File

@ -410,7 +410,7 @@ void EnIk_WalkTowardsPlayer(EnIk* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK);
}
yawDiff = this->actor.wallYaw - this->actor.shape.rot.y;
if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(yawDiff) >= 0x4000)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(yawDiff) >= 0x4000)) {
yawDiff = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000;
Math_ScaledStepToS(&this->actor.shape.rot.y, yawDiff, 0x320);
} else {
@ -438,7 +438,7 @@ void EnIk_RunTowardsPlayer(EnIk* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_WALK);
}
yawDiff = this->actor.wallYaw - this->actor.shape.rot.y;
if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(yawDiff) >= 0x4000)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(yawDiff) >= 0x4000)) {
yawDiff = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000;
Math_ScaledStepToS(&this->actor.shape.rot.y, yawDiff, 0x4B0);
} else {

View File

@ -201,7 +201,7 @@ void func_8091ACC4(EnInsect* this, PlayState* play) {
if ((this->unk_30C & 4) && (this->unk_314 <= 0)) {
func_8091B3D0(this);
} else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) {
} else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
func_8091B618(this);
} else if (this->actor.xzDistToPlayer < 40.0f) {
func_8091B030(this);
@ -241,7 +241,7 @@ void func_8091AE5C(EnInsect* this, PlayState* play) {
if ((this->unk_30C & 4) && (this->unk_314 <= 0)) {
func_8091B3D0(this);
} else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) {
} else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
func_8091B618(this);
} else if (this->actor.xzDistToPlayer < 40.0f) {
func_8091B030(this);
@ -290,7 +290,7 @@ void func_8091B07C(EnInsect* this, PlayState* play) {
if ((this->unk_312 <= 0) || !sp38) {
func_8091AC78(this);
} else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) {
} else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
func_8091B618(this);
}
}
@ -409,7 +409,7 @@ void func_8091B670(EnInsect* this, PlayState* play) {
if ((this->unk_312 <= 0) || ((this->unk_30C & 4) && (this->unk_314 <= 0))) {
func_8091B928(this);
} else if (!(this->actor.bgCheckFlags & 0x40)) {
} else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
func_8091AC78(this);
}
}
@ -462,7 +462,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) {
Actor_MoveWithGravity(&this->actor);
if (this->unk_30C & 0x100) {
if (this->unk_30C & 1) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_8091A9E4(this);
}
} else {

View File

@ -1076,10 +1076,10 @@ void func_80B447C0(EnInvadepoh* this, PlayState* play) {
}
void func_80B44A90(EnInvadepoh* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.velocity.y *= 0.3f;
this->actor.speed *= 0.8f;
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.velocity.y *= 0.8f;
this->actor.speed *= 0.3f;
} else {

View File

@ -191,11 +191,11 @@ void func_8095D804(Actor* thisx, PlayState* play) {
spB8.z = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.z;
Math_Vec3f_Copy(&spC4, &this->actor.velocity);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
spC4.x *= 0.6f;
spC4.y *= -0.3f;
spC4.z *= 0.6f;
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
spC4.x *= -0.5f;
spC4.y *= 0.5f;
spC4.z *= -0.5f;
@ -230,11 +230,11 @@ void func_8095DABC(Actor* thisx, PlayState* play) {
Math_Vec3f_Copy(&spD8, &this->actor.velocity);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
spD8.x *= 0.9f;
spD8.y *= -0.8f;
spD8.z *= 0.9f;
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
spD8.x *= -0.9f;
spD8.y *= 0.8f;
spD8.z *= -0.9f;
@ -265,11 +265,11 @@ void func_8095DDA8(EnIshi* this, PlayState* play) {
Vec3f sp2C;
Math_Vec3f_Copy(&sp2C, &this->actor.world.pos);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
sp2C.x += 2.0f * this->actor.velocity.x;
sp2C.y -= 2.0f * this->actor.velocity.y;
sp2C.z += 2.0f * this->actor.velocity.z;
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
sp2C.x -= 2.0f * this->actor.velocity.x;
sp2C.y += 2.0f * this->actor.velocity.y;
sp2C.z -= 2.0f * this->actor.velocity.z;
@ -281,11 +281,11 @@ void func_8095DE9C(EnIshi* this, PlayState* play) {
Vec3f sp2C;
Math_Vec3f_Copy(&sp2C, &this->actor.world.pos);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
sp2C.x += 2.0f * this->actor.velocity.x;
sp2C.y -= 2.0f * this->actor.velocity.y;
sp2C.z += 2.0f * this->actor.velocity.z;
} else if (this->actor.bgCheckFlags & 8) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
sp2C.x -= 2.0f * this->actor.velocity.x;
sp2C.y += 2.0f * this->actor.velocity.y;
sp2C.z -= 2.0f * this->actor.velocity.z;
@ -585,11 +585,11 @@ void func_8095EBDC(EnIshi* this, PlayState* play) {
this->unk_194--;
if ((this->actor.bgCheckFlags & 9) || temp_v0 || (this->unk_194 <= 0)) {
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) || temp_v0 || (this->unk_194 <= 0)) {
func_8095DF90(this, play);
D_8095F6D8[sp70](&this->actor, play);
if (!(this->actor.bgCheckFlags & 0x20)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, D_8095F6D4[sp70], D_8095F6D0[sp70]);
D_8095F6E0[sp70](this, play);
}
@ -608,7 +608,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) {
return;
}
if (this->actor.bgCheckFlags & 0x40) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
if (sp70 == 0) {
sp58.x = this->actor.world.pos.x;
sp58.y = this->actor.world.pos.y + this->actor.depthInWater;
@ -639,7 +639,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) {
D_8095F694 >>= 2;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L);
this->actor.bgCheckFlags &= ~0x40;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
}
Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f);

View File

@ -445,7 +445,7 @@ void EnJg_Walk(EnJg* this, PlayState* play) {
if (this->path != NULL) {
yRotation = EnJg_GetWalkingYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSQ);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
yRotation = this->actor.wallYaw;
}

View File

@ -189,11 +189,12 @@ void func_80C13BB8(EnJgameTsn* this, PlayState* play) {
func_800B8614(&this->actor, play, 80.0f);
}
if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & PLAYER_STATE1_2000) && (this->unk_2FE == 0) &&
(gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) && func_80C149B0(play, &this->unk_1F8)) {
if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(player->stateFlags1 & PLAYER_STATE1_2000) &&
(this->unk_2FE == 0) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) &&
func_80C149B0(play, &this->unk_1F8)) {
this->unk_2FE = 1;
func_80C13E6C(this);
} else if (!(player->actor.bgCheckFlags & 1)) {
} else if (!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->unk_2FE = 0;
}
@ -334,7 +335,7 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
this->unk_2FC++;
if ((player->actor.bgCheckFlags & 2) && func_80C149B0(play, &this->unk_200)) {
if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && func_80C149B0(play, &this->unk_200)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x109F, &this->actor);
this->unk_300 = 0x109F;
@ -342,7 +343,8 @@ void func_80C14230(EnJgameTsn* this, PlayState* play) {
*this->unk_208[this->unk_218] &= ~OBJLUPYGAMELIFT_IGNITE_FIRE;
func_801A2C20();
func_80C14030(this);
} else if ((player->actor.bgCheckFlags & 0x40) || (player->actor.bgCheckFlags & 0x20)) {
} else if ((player->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) ||
(player->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2);
Message_StartTextbox(play, 0x10A0, &this->actor);
this->unk_300 = 0x10A0;
@ -549,7 +551,7 @@ s32 func_80C14BCC(EnJgameTsn* this, PlayState* play) {
s32 i;
s32 phi_s3 = -1;
if (player->actor.bgCheckFlags & 2) {
if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
for (i = 0; i < ARRAY_COUNT(this->unk_1D8); i++) {
if (func_80C149B0(play, &this->unk_1D8[i])) {
phi_s3 = i;

View File

@ -371,7 +371,7 @@ s32 func_80B85A00(EnKaizoku* this, PlayState* play, s16 arg2) {
}
} else if (func_800BE184(play, &this->picto.actor, 100.0f, 0x5DC0, 0x2AA8, this->picto.actor.shape.rot.y)) {
this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer;
if ((this->picto.actor.bgCheckFlags & 8) && (ABS_ALT(sp32) < 0x2EE0) &&
if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(sp32) < 0x2EE0) &&
(this->picto.actor.xzDistToPlayer < 90.0f)) {
if (this->action != KAIZOKU_ACTION_6) {
func_80B87C7C(this);
@ -393,7 +393,8 @@ s32 func_80B85A00(EnKaizoku* this, PlayState* play, s16 arg2) {
if (explosiveActor != NULL) {
this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer;
if (((this->picto.actor.bgCheckFlags & 8) && (sp32 < 0x2EE0)) || (explosiveActor->id == ACTOR_EN_BOM_CHU)) {
if (((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) && (sp32 < 0x2EE0)) ||
(explosiveActor->id == ACTOR_EN_BOM_CHU)) {
if ((explosiveActor->id == ACTOR_EN_BOM_CHU) &&
(Actor_WorldDistXYZToActor(&this->picto.actor, explosiveActor) < 80.0f) &&
(BINANG_ADD(this->picto.actor.shape.rot.y - explosiveActor->world.rot.y, 0x8000) < 0x4000)) {
@ -531,7 +532,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) {
break;
case 2:
if (this->picto.actor.bgCheckFlags & 1) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->unk_2D8 != 0) {
this->unk_2D8 = 0;
this->picto.actor.world.pos.y = this->picto.actor.floorHeight;
@ -951,10 +952,10 @@ void func_80B8760C(EnKaizoku* this, PlayState* play) {
s32 temp_ft1;
this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer + 0x3A98;
if ((this->picto.actor.bgCheckFlags & 8) ||
if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
!Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed,
this->picto.actor.shape.rot.y + 0x4000)) {
if (this->picto.actor.bgCheckFlags & 8) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->picto.actor.speed >= 0.0f) {
var_v0 = this->picto.actor.shape.rot.y + 0x4000;
} else {
@ -1120,7 +1121,8 @@ void func_80B87D3C(EnKaizoku* this, PlayState* play) {
}
this->unk_2D8 = 0;
if ((this->frameCount <= curFrame) && (this->picto.actor.bgCheckFlags & 3)) {
if ((this->frameCount <= curFrame) &&
(this->picto.actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) {
this->bodyCollider.info.elemType = ELEMTYPE_UNK1;
this->bodyCollider.base.colType = COLTYPE_HIT3;
this->swordCollider.info.elemType = ELEMTYPE_UNK2;
@ -1485,11 +1487,11 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) {
}
}
if ((this->picto.actor.bgCheckFlags & 8) ||
if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
!Actor_TestFloorInDirection(&this->picto.actor, play, this->picto.actor.speed,
this->picto.actor.shape.rot.y + 0x4000)) {
if (this->picto.actor.bgCheckFlags & 8) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (this->picto.actor.speed >= 0.0f) {
yaw = this->picto.actor.shape.rot.y + 0x4000;
} else {
@ -1550,7 +1552,7 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) {
// EnKaizoku_SetupStunned
void func_80B891B8(EnKaizoku* this) {
if (this->picto.actor.bgCheckFlags & 1) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->picto.actor.speed = 0.0f;
}
@ -1585,18 +1587,18 @@ void func_80B89280(EnKaizoku* this, PlayState* play) {
}
}
if (this->picto.actor.bgCheckFlags & 2) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->picto.actor.speed = 0.0f;
}
if (this->picto.actor.bgCheckFlags & 1) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->picto.actor.speed < 0.0f) {
this->picto.actor.speed += 0.05f;
}
}
if ((this->unk_2B6 == 0) && (this->unk_2B8 == 0) && !CHECK_FLAG_ALL(this->picto.actor.flags, ACTOR_FLAG_2000) &&
(this->picto.actor.bgCheckFlags & 1)) {
(this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->unk_2D8 = 0;
func_80B85A00(this, play, true);
@ -1644,7 +1646,7 @@ void func_80B894C0(EnKaizoku* this, PlayState* play) {
if (!func_80B85858(this, play) && !func_80B85A00(this, play, false) && (this->unk_3C4.x < 1.0f) &&
(this->unk_3C4.z < 1.0f)) {
temp_v0 = this->picto.actor.wallYaw - this->picto.actor.shape.rot.y;
if (this->picto.actor.bgCheckFlags & 8) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (ABS_ALT(temp_v0) < 0x3000 && (this->picto.actor.xzDistToPlayer < 90.0f)) {
func_80B87C7C(this);
return;
@ -1692,11 +1694,11 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) {
f32 curFrame = this->skelAnime.curFrame;
Player* player;
if (this->picto.actor.bgCheckFlags & 2) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
this->picto.actor.speed = 0.0f;
}
if (this->picto.actor.bgCheckFlags & 1) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_SmoothStepToF(&this->picto.actor.speed, 0.0f, 1.0f, 0.5f, 0.0f);
}
@ -1809,7 +1811,7 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) {
}
}
if ((this->picto.actor.bgCheckFlags & 8) && (this->picto.actor.wallBgId != BG_ACTOR_MAX) &&
if ((this->picto.actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->picto.actor.wallBgId != BG_ACTOR_MAX) &&
((this->action == KAIZOKU_ACTION_2) || (this->action == KAIZOKU_ACTION_3) ||
(this->action == KAIZOKU_ACTION_4) || (this->action == KAIZOKU_ACTION_1))) {
func_80B87F70(this);
@ -2015,7 +2017,7 @@ void EnKaizoku_Update(Actor* thisx, PlayState* play2) {
}
}
if (this->picto.actor.bgCheckFlags & 1) {
if (this->picto.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Matrix_RotateYS(this->picto.actor.shape.rot.y + this->unk_2F4, 0);
Matrix_MultVecZ(this->unk_2F0, &sp34);
this->picto.actor.world.pos.x += this->unk_3C4.x + sp34.x;

View File

@ -287,7 +287,7 @@ void func_80AD75A8(EnKame* this, PlayState* play) {
static Color_RGBA8 D_80AD8E58 = { 180, 180, 180, 255 };
static Vec3f D_80AD8E5C = { 0.0f, 0.75f, 0.0f };
if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 3.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed >= 3.0f)) {
if ((play->gameplayFrames % 2) == 0) {
u32 temp_v0 = func_800C9BB8(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
@ -367,7 +367,7 @@ void func_80AD7948(EnKame* this, PlayState* play) {
temp_v1 = ABS_ALT(temp_v0);
if ((this->actor.bgCheckFlags & 8) || (temp_v1 > 0x3000) ||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (temp_v1 > 0x3000) ||
(Actor_WorldDistXZToPoint(&this->actor, &this->unk_2BC) < 50.0f)) {
s8 pad;
@ -554,7 +554,7 @@ void func_80AD8148(EnKame* this, PlayState* play) {
func_800BE504(&this->actor, &this->collider);
}
}
this->actor.bgCheckFlags &= ~0x1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.flags |= ACTOR_FLAG_10;
Actor_PlaySfx(&this->actor, NA_SE_EN_PAMET_DEAD);
@ -564,7 +564,7 @@ void func_80AD8148(EnKame* this, PlayState* play) {
void func_80AD825C(EnKame* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime1);
if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y < 0.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_HIPLOOP_LAND);
func_80AD8364(this);
} else {

View File

@ -423,7 +423,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
f32 tempY;
f32 tempZ;
f32 tempWaterDepth;
u16 tempBgFlags;
u16 bgCheckFlags;
u8 onGround;
if (this->unk_198 != 0) {
@ -438,7 +438,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
tempX = this->actor.world.pos.x;
tempY = this->actor.world.pos.y;
tempZ = this->actor.world.pos.z;
tempBgFlags = this->actor.bgCheckFlags;
bgCheckFlags = this->actor.bgCheckFlags;
tempWaterDepth = this->actor.depthInWater;
this->actor.world.pos.z += ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f;
@ -448,12 +448,12 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->actor.world.pos.x = tempX;
this->actor.world.pos.y = tempY;
this->actor.world.pos.z = tempZ;
this->actor.bgCheckFlags = tempBgFlags;
this->actor.bgCheckFlags = bgCheckFlags;
this->actor.depthInWater = tempWaterDepth;
if (1) {}
onGround = (this->actor.bgCheckFlags & 1);
onGround = (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND);
if (this->spinXFlag != 0) {
this->spinRot.x += this->spinVel.x;
@ -495,14 +495,14 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->spinVel.z = -0xC00;
}
if (this->actor.bgCheckFlags & 8) {
if (!(this->actor.bgCheckFlags & 1)) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND);
}
this->actor.speed *= -0.5f;
}
if (this->actor.bgCheckFlags & 0x40) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
this->actionState = ENKANBAN_WATER;
Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER);
this->bounceX = this->bounceZ = 0;
@ -542,7 +542,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
this->actor.speed = 0.0f;
} else if ((this->floorRot.x > 0.1f) || (this->floorRot.z > 0.1f)) {
this->airTimer = 10;
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actionState = ENKANBAN_GROUND;
this->actor.speed = 0.0f;
goto nextCase;
@ -702,7 +702,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
}
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = 0.0f;
}
@ -710,7 +710,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
if (this->actor.speed != 0.0f) {
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, 5);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.speed *= -0.5f;
if (this->spinVel.y > 0) {
this->spinVel.y = -2000;

View File

@ -413,7 +413,8 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL);
if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) {
if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) ||
(this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) {
this->actor.scale.z = 0.0f;
this->actor.scale.y = 0.0f;
this->actor.scale.x = 0.0f;
@ -423,7 +424,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) {
NULL);
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK);
this->timer = 1;
}

View File

@ -552,8 +552,9 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) {
this->collider.base.atFlags &= ~AT_HIT;
}
this->timer++;
if ((this->actor.bgCheckFlags & 0xB) || wasHit || (this->timer >= 100)) {
if (!(this->actor.bgCheckFlags & 0x20)) {
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || wasHit ||
(this->timer >= 100)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN);
}
EnKusa_SpawnFragments(this, play);
@ -571,7 +572,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) {
}
} else {
if (this->actor.bgCheckFlags & 0x40) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
contactPos.y = this->actor.world.pos.y + this->actor.depthInWater;
for (angleOffset = 0, i = 0; i < 4; i++, angleOffset += 0x4000) {
contactPos.x =
@ -593,7 +594,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) {
rotSpeedXtarget >>= 1;
rotSpeedY >>= 1;
rotSpeedYtarget >>= 1;
this->actor.bgCheckFlags &= ~0x40;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L);
}
EnKusa_UpdateVelY(this);

View File

@ -1087,12 +1087,12 @@ void func_80A5DC98(EnKusa2* this, PlayState* play) {
func_80A5BF38(this, 4);
func_80A5BF84(this, play);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_80A5CD0C(this);
func_80A5BB40(this, play, 1);
Actor_PlaySfx(&this->actor, NA_SE_EN_NUTS_WALK);
func_80A5DE18(this);
} else if (this->actor.bgCheckFlags & 0x20) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
func_80A5BDB0(this, play);
func_80A5E418(this);
} else if (this->unk_1CA > 0) {
@ -1157,7 +1157,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) {
func_80A5CD0C(this);
}
if (this->actor.bgCheckFlags & 0x20) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
func_80A5BDB0(this, play);
func_80A5E418(this);
} else {
@ -1168,7 +1168,7 @@ void func_80A5DEB4(EnKusa2* this, PlayState* play) {
this->actor.speed += 4.0f;
this->actor.velocity.y = (Rand_ZeroOne() * 4.0f) + 15.0f;
func_80A5E1D8(this);
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->unk_1CA--;
if (this->unk_1CA <= 0) {
func_80A5CD0C(this);
@ -1200,9 +1200,9 @@ void func_80A5E1D8(EnKusa2* this) {
void func_80A5E210(EnKusa2* this, PlayState* play) {
Math_StepToF(&this->actor.gravity, -4.0f, 0.5f);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed *= 0.4f;
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
func_80A5D178(this);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_KUSAMUSHI_HIDE);
}
@ -1229,7 +1229,7 @@ void func_80A5E210(EnKusa2* this, PlayState* play) {
if (this->actor.velocity.y > 1.0f) {
Math_StepToF(&this->actor.scale.y, 0.24000001f, 0.080000006f);
Math_StepToF(&this->actor.scale.x, 0.32000002f, 0.040000003f);
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Math_StepToF(&this->actor.scale.y, 0.0f, 0.120000005f);
Math_StepToF(&this->actor.scale.x, 0.48000002f, 0.120000005f);
} else {
@ -1269,7 +1269,8 @@ void func_80A5E4BC(EnKusa2* this, PlayState* play) {
this->actor.shape.rot.x -= 0x5DC;
this->actor.shape.rot.y += this->unk_1CC;
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 5.0f) && (Rand_ZeroOne() < 0.8f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 5.0f) &&
(Rand_ZeroOne() < 0.8f)) {
EffectSsBubble_Spawn(play, &this->actor.world.pos, 20.0f, 10.0f, 20.0f, (Rand_ZeroOne() * 0.08f) + 0.04f);
}

View File

@ -772,7 +772,7 @@ void func_80AEB280(EnLiftNuts* this) {
void func_80AEB294(EnLiftNuts* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (((player->actor.bgCheckFlags & 1) && (player->actor.floorBgId == BG_ACTOR_MAX) &&
if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (player->actor.floorBgId == BG_ACTOR_MAX) &&
player->actor.world.pos.y < 20.0f) ||
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] >= 0x2EE0) {
player->stateFlags1 |= PLAYER_STATE1_20;

View File

@ -187,14 +187,14 @@ void EnMinifrog_Jump(EnMinifrog* this) {
switch (this->jumpState) {
case MINIFROG_STATE_JUMP:
if (Animation_OnFrame(&this->skelAnime, 4.0f)) {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.velocity.y = 6.0f;
Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_JUMP);
this->jumpState = MINIFROG_STATE_AIR;
}
break;
case MINIFROG_STATE_AIR:
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->jumpState = MINIFROG_STATE_GROUND;
Animation_MorphToLoop(&this->skelAnime, &object_fr_Anim_001534, -2.5f);
SkelAnime_Update(&this->skelAnime);

View File

@ -140,36 +140,36 @@ void EnMinislime_CheckBackgroundCollision(EnMinislime* this) {
f32 scaleY = this->actor.scale.y * 400.0f;
f32 scaleZ = this->actor.scale.z * 400.0f;
this->actor.bgCheckFlags &= ~(0x10 | 0x8 | 0x2);
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING);
if ((this->actor.world.pos.y + scaleY) > GBT_ROOM_5_MAX_Y) {
this->actor.bgCheckFlags |= 0x10;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags |= BGCHECKFLAG_CEILING;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.world.pos.y = GBT_ROOM_5_MAX_Y - scaleY;
} else if ((this->actor.world.pos.y - scaleY) < GBT_ROOM_5_MIN_Y) {
this->actor.world.pos.y = GBT_ROOM_5_MIN_Y + scaleY;
if (!(this->actor.bgCheckFlags & 1)) {
this->actor.bgCheckFlags |= 2;
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH;
}
this->actor.bgCheckFlags |= 1;
this->actor.bgCheckFlags |= BGCHECKFLAG_GROUND;
} else {
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
if ((this->actor.world.pos.x + scaleX) > GBT_ROOM_5_MAX_X) {
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
this->actor.world.pos.x = GBT_ROOM_5_MAX_X - scaleX;
} else if ((this->actor.world.pos.x - scaleX) < GBT_ROOM_5_MIN_X) {
this->actor.world.pos.x = GBT_ROOM_5_MIN_X + scaleX;
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
}
if ((this->actor.world.pos.z + scaleZ) > GBT_ROOM_5_MAX_Z) {
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
this->actor.world.pos.z = GBT_ROOM_5_MAX_Z - scaleZ;
} else if ((this->actor.world.pos.z - scaleZ) < GBT_ROOM_5_MIN_Z) {
this->actor.world.pos.z = GBT_ROOM_5_MIN_Z + scaleZ;
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
}
}
@ -259,7 +259,7 @@ void EnMinislime_Fall(EnMinislime* this, PlayState* play) {
Math_StepToF(&this->actor.scale.x, 0.17999999f, 0.003f);
Math_StepToF(&this->actor.scale.y, 0.05f, 0.003f);
this->actor.scale.z = this->actor.scale.x;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnMinislime_SetupGrowAndShrink(this);
}
}
@ -271,7 +271,7 @@ void EnMinislime_SetupBreakFromBigslime(EnMinislime* this) {
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.speed = Math_CosS(this->actor.world.rot.x) * 15.0f;
velY = Math_SinS(this->actor.world.rot.x) * 15.0f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.velocity.y = velY + 2.0f;
this->actor.gravity = -1.0f;
this->frozenScale = 0.1f;
@ -289,7 +289,7 @@ void EnMinislime_BreakFromBigslime(EnMinislime* this, PlayState* play) {
this->actor.shape.rot.x += this->actor.world.rot.x;
if (this->actor.velocity.y < 0.0f) {
this->collider.base.ocFlags1 |= OC1_ON;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnMinislime_AddIceShardEffect(this);
this->attackTimer = 40;
EnMinislime_SetupGrowAndShrink(this);
@ -341,7 +341,7 @@ void EnMinislime_IceArrowDamage(EnMinislime* this, PlayState* play) {
return;
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
EnMinislime_AddIceShardEffect(this);
EnMinislime_SetupGrowAndShrink(this);
}
@ -478,7 +478,7 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) {
} else {
Math_StepToF(&this->actor.scale.x, 0.17999999f, 0.003f);
Math_StepToF(&this->actor.scale.y, 0.05f, 0.003f);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnMinislime_SetupGrowAndShrink(this);
return;
}
@ -661,7 +661,7 @@ void EnMinislime_SetupGekkoThrow(EnMinislime* this) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.gravity = -1.0f;
this->actor.velocity.y = ((xzDistToPlayer - 200.0f) * 0.01f) + 3.0f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->throwTimer = 10;
this->actionFunc = EnMinislime_GekkoThrow;
}
@ -678,7 +678,7 @@ void EnMinislime_GekkoThrow(EnMinislime* this, PlayState* play) {
this->throwTimer = 10;
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnMinislime_SetupGrowAndShrink(this);
}
}
@ -713,7 +713,7 @@ void EnMinislime_Update(Actor* thisx, PlayState* play) {
s32 pad;
Vec3f vec1;
if ((this->actor.params == MINISLIME_DEFEAT_IDLE) && (this->actor.bgCheckFlags & 1)) {
if ((this->actor.params == MINISLIME_DEFEAT_IDLE) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
EnMinislime_SetupDefeatIdle(this);
} else if (this->actor.params == MINISLIME_DEFEAT_MELT) {
EnMinislime_SetupDefeatMelt(this, play);
@ -761,7 +761,7 @@ void EnMinislime_Update(Actor* thisx, PlayState* play) {
this->attackTimer--;
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
player = GET_PLAYER(play);
vec1.x = this->actor.world.pos.x;
vec1.z = this->actor.world.pos.z;

View File

@ -256,7 +256,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
s32 sp20;
this->unk_14E--;
if ((this->actor.params == 1) && (this->actor.bgCheckFlags & 1) && (this->actor.speed > 2.5f) &&
if ((this->actor.params == 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed > 2.5f) &&
((play->gameplayFrames % 3) == 0)) {
func_80A4E22C(this, play);
}
@ -280,7 +280,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
this->unk_14B &= ~2;
func_80A4E190(this);
} else if ((this->unk_149 == 0) && (!(player->stateFlags3 & 0x100)) &&
(Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.bgCheckFlags & 1) &&
(Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(Actor_IsFacingPlayer(&this->actor, 0x1800)) && (this->actor.xzDistToPlayer < 120.0f) &&
(fabsf(this->actor.playerHeightRel) < 100.0f)) {
func_80A4E58C(this);
@ -301,7 +301,7 @@ void func_80A4E60C(EnMkk* this, PlayState* play) {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~(AT_ON | AT_HIT);
}
if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & 1)) {
if ((this->actor.velocity.y < 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->unk_149 = 2;
this->collider.base.atFlags &= ~AT_ON;
func_80A4E2B8(this);
@ -320,14 +320,14 @@ void func_80A4E67C(EnMkk* this) {
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.velocity.y = 5.0f;
this->actor.gravity = -1.3f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actionFunc = func_80A4E72C;
}
void func_80A4E72C(EnMkk* this, PlayState* play) {
Vec3f temp;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (this->actor.velocity.y > -1.0f) {
temp.x = this->actor.world.pos.x;
temp.y = this->actor.world.pos.y + 15.0f;
@ -341,7 +341,7 @@ void func_80A4E72C(EnMkk* this, PlayState* play) {
func_80A4EEF4(this);
} else {
this->actor.velocity.y *= -0.8f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
}
}

View File

@ -126,11 +126,11 @@ void func_80965DB4(EnMm* this, PlayState* play) {
func_80965BBC(this);
Actor_PlaySfx(&this->actor, NA_SE_PL_PULL_UP_ROCK);
} else {
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 = 0.0f;
}
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & 8)) {
if ((this->actor.speed != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
angle = BINANG_SUB(this->actor.world.rot.y, BINANG_ROT180(this->actor.wallYaw));
this->actor.world.rot.y += BINANG_SUB(0x8000, (s16)(angle * 2));
this->actor.speed *= 0.5f;
@ -138,7 +138,7 @@ void func_80965DB4(EnMm* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND);
}
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Math_StepToF(&this->actor.speed, 0.0f, 0.08f);
} else {
temp_f14 = Math_SinS(this->actor.world.rot.y) * this->actor.speed;
@ -163,10 +163,10 @@ void func_80965DB4(EnMm* this, PlayState* play) {
this->unk_190 += (s16)(this->actor.speed * 800.0f);
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
if (this->actor.velocity.y < -6.0f) {
this->actor.velocity.y *= -0.3f;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
}
Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND);
@ -186,7 +186,7 @@ void func_8096611C(EnMm* this, PlayState* play) {
if (Actor_HasNoParent(&this->actor, play)) {
EnMm_SetupAction(this, func_80965DB4);
this->actor.room = play->roomCtx.curRoom.num;
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
Math_Vec3s_ToVec3f(&this->actor.prevPos, &this->actor.home.rot);
gSaveContext.unk_1014 = 0;
} else {

View File

@ -220,7 +220,8 @@ s32 EnMttag_UpdateCheckpoints(EnMttag* this, PlayState* play) {
}
if ((currentCheckpoints[0] > 0) && (currentCheckpoints[0] < highestCurrentCheckpoint) &&
(player->actor.bgCheckFlags & 1) && ((highestCurrentCheckpoint - currentCheckpoints[0]) >= 24)) {
(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
((highestCurrentCheckpoint - currentCheckpoints[0]) >= 24)) {
playerIsLikelyToLose = true;
}

View File

@ -820,9 +820,9 @@ void func_80A6A36C(EnMushi2* this, PlayState* play) {
return;
}
if (this->actor.bgCheckFlags & 0x20) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
func_80A6AAA4(this);
} else if (this->actor.bgCheckFlags & 1) {
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_WALK);
func_80A68F24(this);
func_80A691EC(this, this->actor.floorPoly, -1.0f);
@ -1005,7 +1005,7 @@ void func_80A6AB08(EnMushi2* this, PlayState* play) {
func_80A6A094(this);
func_80A6A0D8(this);
func_80A6AE14(this);
} else if (!(this->actor.bgCheckFlags & 0x20)) {
} else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
func_80A6A794(this);
}
}

View File

@ -81,7 +81,7 @@ void EnNimotsu_Update(Actor* thisx, PlayState* play) {
Actor_MoveWithGravity(&this->actor);
if (!(this->dustDone & 1) && (this->actor.bgCheckFlags & 1)) {
if (!(this->dustDone & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (DECR(this->timer) == 0) {
this->dustDone |= 1;
}

View File

@ -319,8 +319,8 @@ void EnNiw_UpdateRunning(EnNiw* this, PlayState* play, s32 isStormCucco) {
if (this->hopTimer == 0) {
this->hopTimer = 3;
if (this->actor.bgCheckFlags & 1) { // hit floor
this->actor.velocity.y = 3.5f; // hopping up while running away
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.velocity.y = 3.5f; // hopping up while running away
}
}
@ -336,8 +336,7 @@ void EnNiw_UpdateRunning(EnNiw* this, PlayState* play, s32 isStormCucco) {
runningDirection = -runningAngles[isStormCucco];
}
if (isStormCucco == true &&
(this->runAwayTimer == 0 || (this->actor.bgCheckFlags & 8))) { // bgCheckFlags 8: hit a wall
if (isStormCucco == true && (this->runAwayTimer == 0 || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) {
this->runAwayTimer = 150;
if (this->yawTimer == 0) {
this->yawTimer = 70;
@ -414,7 +413,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
} else {
this->unkIdleTimer = 4;
if (this->actor.bgCheckFlags & 1) { // hit floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = 0.0f;
this->actor.velocity.y = 3.5f; // hopping up and down
}
@ -494,7 +493,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) {
void EnNiw_Thrown(EnNiw* this, PlayState* play) {
if (this->unk2EC == 0) {
if (this->actor.bgCheckFlags & 1) { // hit floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->unk2EC = 1;
this->hoppingTimer = 80; // hop timer
this->actor.speed = 0.0f;
@ -503,7 +502,7 @@ void EnNiw_Thrown(EnNiw* this, PlayState* play) {
return; // wait until back on floor
}
} else {
if (this->actor.bgCheckFlags & 1) { // hit floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->sfxTimer1 = 0;
this->actor.velocity.y = 4.0f; // vertical hop
this->unk29E = 1;
@ -545,7 +544,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) {
}
this->actor.speed = 2.0f;
if (this->actor.bgCheckFlags & 0x20) { // touching water
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
this->actor.gravity = 0.0f;
if (this->actor.depthInWater > 15.0f) {
this->actor.world.pos.y += 2.0f;
@ -557,13 +556,13 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) {
EffectSsGRipple_Spawn(play, &ripplePos, 100, 500, 30);
}
if (this->actor.bgCheckFlags & 8) { // hit a wall
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.velocity.y = 10.0f; // fly up in straight line
this->actor.speed = 1.0f;
}
} else {
this->actor.gravity = -2.0f;
if (this->actor.bgCheckFlags & 8) { // hit a wall
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.velocity.y = 10.0f; // fly up in straight line
this->actor.speed = 1.0f;
this->actor.gravity = 0.0f;
@ -571,7 +570,7 @@ void EnNiw_Swimming(EnNiw* this, PlayState* play) {
this->actor.speed = 4.0f;
}
if (this->actor.bgCheckFlags & 1) { // hit floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.gravity = -2.0f;
this->runAwayTimer = 100;
this->swimRippleTimer = 0;
@ -702,7 +701,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) {
}
void EnNiw_LandBeforeIdle(EnNiw* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) { // hit floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnNiw_SetupIdle(this);
}
}
@ -890,8 +889,8 @@ void EnNiw_Update(Actor* thisx, PlayState* play) {
return;
}
if ((this->actor.bgCheckFlags & 0x20) && // touching water
this->actor.depthInWater > 15.0f && this->niwState != NIW_STATE_SWIMMING) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f) &&
(this->niwState != NIW_STATE_SWIMMING)) {
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
Math_Vec3f_Copy(&pos, &this->actor.world.pos);

View File

@ -107,9 +107,9 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) {
this->actor.world.rot.x = Math_Atan2S_XY(spdXZ, this->actor.velocity.y);
}
this->actor.home.rot.z += 0x2AA8;
if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->actor.bgCheckFlags & 16) ||
(this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) ||
(this->collider.base.ocFlags1 & OC1_HIT)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) || (this->collider.base.atFlags & AT_HIT) ||
(this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) {
if ((player->currentShield == PLAYER_SHIELD_HEROS_SHIELD) && (this->collider.base.atFlags & AT_HIT) &&
(this->collider.base.atFlags & AT_TYPE_ENEMY) && (this->collider.base.atFlags & AT_BOUNCED)) {
EnNutsball_InitColliderParams(this);
@ -138,16 +138,16 @@ void EnNutsball_Update(Actor* thisx, PlayState* play2) {
Math_Vec3f_Copy(&worldPos, &this->actor.world.pos);
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 5.0f, 10.0f, 0x7);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
if (func_800C9A4C(&play->colCtx, this->actor.wallPoly, this->actor.wallBgId) & 0x30) {
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.prevPos, &worldPos, &this->actor.world.pos,
&poly, true, false, false, true, &bgId)) {
if (func_800C9A4C(&play->colCtx, poly, bgId) & 0x30) {
this->actor.world.pos.x += this->actor.velocity.x * 0.01f;
this->actor.world.pos.z += this->actor.velocity.z * 0.01f;
} else {
this->actor.bgCheckFlags |= 8;
this->actor.bgCheckFlags |= BGCHECKFLAG_WALL;
}
} else {
Math_Vec3f_Copy(&this->actor.world.pos, &worldPos);

View File

@ -382,7 +382,7 @@ void EnNwc_HopForward(EnNwc* this, PlayState* play) {
}
// they only move forward while off the ground, which gives the visual of them hopping to move
if (this->actor.bgCheckFlags & 0x1) { // touching floor
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actor.speed = 0.0f;
} else {
this->actor.speed = 2.0f;
@ -408,7 +408,7 @@ void EnNwc_RunAway(EnNwc* this, PlayState* play) {
}
this->actor.speed = 2.0f;
if (this->actor.bgCheckFlags & 0x8) { // touching wall
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
EnNwc_ToggleState(this);
}
}
@ -433,7 +433,7 @@ void EnNwc_Turn(EnNwc* this, PlayState* play) {
}
// they only rotate when off the ground, giving the visual that they turn by hopping
if (!(this->actor.bgCheckFlags & 0x1)) { // NOT touching floor
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->fallingRotY, 0xA, 0x1000, 0x800);
this->actor.world.rot.y = this->actor.shape.rot.y;
}

View File

@ -534,7 +534,7 @@ void func_80B5C6DC(EnOt* this, PlayState* play) {
this->unk_360->unk_3A0 = this->unk_3A0;
func_80B5C9A8(this, play);
func_80B5D114(this, play);
} else if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) &&
} else if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !func_801242B4(player) &&
(this->actor.xzDistToPlayer < 130.0f)) {
func_800B8614(&this->actor, play, 130.0f);
}
@ -695,7 +695,8 @@ void func_80B5CEC8(EnOt* this, PlayState* play) {
func_800B8500(&this->actor, play, this->actor.xzDistToPlayer, this->actor.playerHeightRel, PLAYER_IA_NONE);
} else {
this->actor.flags &= ~ACTOR_FLAG_10000;
if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) {
if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !func_801242B4(player) &&
(this->actor.xzDistToPlayer < 130.0f)) {
func_800B8614(&this->actor, play, 130.0f);
}
}
@ -933,7 +934,7 @@ void EnOt_Update(Actor* thisx, PlayState* play) {
}
this->actionFunc(this, play);
if (this->actor.bgCheckFlags & 0x20) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
if (DECR(this->unk_354) == 0) {
if (this->actor.flags & ACTOR_FLAG_40) {
s32 i;

View File

@ -1078,7 +1078,7 @@ void func_8095CCF4(Actor* thisx, PlayState* play) {
this->actor.world.pos.y -= 1.0f;
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 10.0f, 4);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->unk_3DA = (this->unk_3DA >> 3) * 7;
if (this->unk_3DC > 0) {
this->unk_3DC--;

View File

@ -525,7 +525,7 @@ void EnPametfrog_FallOffSnapper(EnPametfrog* this, PlayState* play) {
sin = sin_rad(this->timer * (M_PI / 3)) * ((0.02f * (this->timer * (1.0f / 6.0f))) + 0.005f) + 1.0f;
EnPametfrog_ShakeCamera(this, play, 300.0f * sin, 100.0f * sin);
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnPametfrog_StopCutscene(this, play);
EnPametfrog_SetupJumpToWall(this);
}
@ -535,7 +535,7 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) {
Animation_Change(&this->skelAnime, &gGekkoJumpForwardAnim, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f);
this->actor.shape.rot.x = 0;
this->actor.shape.rot.z = 0;
this->actor.bgCheckFlags &= ~8;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_VOICE2);
this->actionFunc = EnPametfrog_JumpToWall;
}
@ -543,10 +543,10 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) {
void EnPametfrog_JumpToWall(EnPametfrog* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
EnPametfrog_JumpOnGround(this, play);
if ((this->actor.bgCheckFlags & 1) && (this->actor.bgCheckFlags & 8) && (this->actor.wallBgId == BGCHECK_SCENE) &&
(COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y) < 0.5f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
(this->actor.wallBgId == BGCHECK_SCENE) && (COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y) < 0.5f)) {
EnPametfrog_SetupWallCrawl(this);
} else if (!(this->actor.bgCheckFlags & 1) ||
} else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
this->actor.speed = 12.0f;
} else {
@ -712,7 +712,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) {
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actor.world.pos.x += 30.0f * Math_SinS(yaw);
this->actor.world.pos.z += 30.0f * Math_CosS(yaw);
this->actor.bgCheckFlags &= ~1;
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
this->actor.params = GEKKO_RETURN_TO_SNAPPER;
this->actionFunc = EnPametfrog_ClimbDownWall;
}
@ -720,7 +720,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) {
void EnPametfrog_ClimbDownWall(EnPametfrog* this, PlayState* play) {
s16 yaw;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnPametfrog_SetupRunToSnapper(this);
} else if (this->actor.floorHeight == BGCHECK_Y_MIN) {
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
@ -743,7 +743,8 @@ void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) {
EnPametfrog_JumpOnGround(this, play);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
this->actor.speed = 12.0f;
} else {
this->actor.speed = 0.0f;
@ -860,7 +861,7 @@ void EnPametfrog_FallInAir(EnPametfrog* this, PlayState* play) {
&Play_GetCamera(play, this->subCamId)->eye);
}
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
EnPametfrog_SetupFallOnGround(this, play);
}
}
@ -1053,7 +1054,8 @@ void EnPametfrog_JumpToLink(EnPametfrog* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
SkelAnime_Update(&this->skelAnime);
EnPametfrog_JumpOnGround(this, play);
if (!(this->actor.bgCheckFlags & 1) || (this->skelAnime.curFrame > 1.0f && this->skelAnime.curFrame < 12.0f)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(this->skelAnime.curFrame > 1.0f && this->skelAnime.curFrame < 12.0f)) {
this->actor.speed = 8.0f;
} else {
this->actor.speed = 0.0f;

View File

@ -432,10 +432,10 @@ void func_80897A94(EnPeehat* this, PlayState* play) {
this->colliderTris.base.atFlags &= ~(AT_BOUNCED | AT_ON);
this->actor.colChkInfo.health = 0;
func_808982E0(this);
} else if ((this->colliderCylinder.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & 1)) {
} else if ((this->colliderCylinder.base.acFlags & AC_HIT) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 40, 7, 0);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 11, NA_SE_EN_EXTINCT);
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_PIHAT_SM_DEAD);
}
Actor_Kill(&this->actor);

View File

@ -373,7 +373,7 @@ void EnPoSisters_AimlessIdleFlying(EnPoSisters* this, PlayState* play) {
EnPoSisters_SetupAimlessIdleFlying2(this);
}
if (this->actor.bgCheckFlags & 8) { // touching a wall
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
0x71C);
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 600.0f) {
@ -573,7 +573,7 @@ void EnPoSisters_Flee(EnPoSisters* this, PlayState* play) {
DECR(this->fleeTimer);
}
if (this->actor.bgCheckFlags & 8) { // touching a wall
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->actor.world.rot.y = this->actor.shape.rot.y;
this->poSisterFlags |= POE_SISTERS_FLAG_UPDATE_SHAPE_ROT;
EnPoSisters_SetupSpinToInvis(this);

View File

@ -167,7 +167,7 @@ void EnPoh_Init(Actor* thisx, PlayState* play) {
255, 255, 255, 0);
SkelAnime_Init(play, &this->skelAnime, &object_po_Skel_0050D0, &object_po_Anim_000A60, this->jointTable,
this->morphTable, 21);
this->actor.bgCheckFlags |= 0x400;
this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400;
func_80B2D0E8(this);
}
@ -582,7 +582,7 @@ void func_80B2DC50(EnPoh* this, PlayState* play) {
}
void func_80B2DD2C(EnPoh* this, PlayState* play) {
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight <= BGCHECK_Y_MIN)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight <= BGCHECK_Y_MIN)) {
EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO, 10, object_po_DL_002D28);
func_80B2E0B0(this);
}

View File

@ -836,7 +836,7 @@ void EnPp_Jump(EnPp* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetRotY, 1, 0x1388, 0);
if (!this->actionVar.hasLandedFromJump) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
this->actionVar.hasLandedFromJump = true;
EnPp_ChangeAnim(this, EN_PP_ANIM_LAND);
}
@ -1224,7 +1224,7 @@ void EnPp_BodyPart_Move(EnPp* this, PlayState* play) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EV_BOMB_DROP_WATER);
}
if ((this->timer == 0) || (this->actor.bgCheckFlags & 1)) {
if ((this->timer == 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Actor_Kill(&this->actor);
}
}
@ -1413,7 +1413,7 @@ void EnPp_Update(Actor* thisx, PlayState* play) {
if (this->action != EN_PP_ACTION_BODY_PART_MOVE) {
EnPp_UpdateDamage(this, play);
Actor_SetFocus(&this->actor, 40.0f);
if ((this->action == EN_PP_ACTION_DEAD) || (this->actor.bgCheckFlags & 1)) {
if ((this->action == EN_PP_ACTION_DEAD) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.world.pos.x += this->damagedVelocity.x;
this->actor.world.pos.z += this->damagedVelocity.z;
Math_ApproachZeroF(&this->damagedVelocity.x, 1.0f, 2.0f);

View File

@ -173,7 +173,7 @@ void EnPr2_Init(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 20.0f, 20.0f, 0x1D);
if (!(this->actor.bgCheckFlags & 0x60)) {
if (!(this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH))) {
Actor_Kill(&this->actor);
}
}
@ -398,7 +398,8 @@ void func_80A748E8(EnPr2* this, PlayState* play) {
sp3C.x += Math_SinS(this->actor.world.rot.y) * 20.0f;
sp3C.z += Math_CosS(this->actor.world.rot.y) * 20.0f;
if (fabsf(this->actor.world.rot.y - this->unk_1EE) < 100.0f) {
if (BgCheck_SphVsFirstPoly(&play->colCtx, &sp3C, 20.0f) || (this->actor.bgCheckFlags & 8)) {
if (BgCheck_SphVsFirstPoly(&play->colCtx, &sp3C, 20.0f) ||
(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
this->unk_1DC = 0;
this->unk_1F2++;
Math_Vec3f_Copy(&this->unk_21C, &this->unk_228);

View File

@ -393,7 +393,7 @@ void EnRacedog_Race(EnRacedog* this, PlayState* play) {
this->collider.dim.radius = 15;
if (this->path != NULL) {
yRotation = EnRacedog_GetYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSq);
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
yRotation = this->actor.wallYaw;
}
@ -701,7 +701,7 @@ void EnRacedog_Update(Actor* thisx, PlayState* play) {
}
}
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->skelAnime.curFrame = 0.0f;
}

View File

@ -625,7 +625,7 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y,
Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->dyna.actor.world.pos), 1, 0x71C, 0xB6);
if ((this->actor.bgCheckFlags & 1) && (this->unk_22C->dyna.actor.colChkInfo.health == 0)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->unk_22C->dyna.actor.colChkInfo.health == 0)) {
Actor_MoveWithGravity(&this->actor);
} else {
this->actor.velocity.y += this->actor.gravity;
@ -634,12 +634,12 @@ void func_80B71BB8(EnRailSkb* this, PlayState* play) {
Math_SmoothStepToF(&this->actor.world.pos.z, this->unk_22C->dyna.actor.world.pos.z, 0.6f, 1.6f, 0.1f);
}
if (this->actor.bgCheckFlags & 2) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
Actor_Kill(&this->actor);
return;
}
if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) {
if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_ATTACK);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9);
this->actor.velocity.y = 10.0f;

Some files were not shown because too many files have changed in this diff Show More