From 2cce8f67671c7162a946dd11604f83c9630fbc28 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:53:56 -0500 Subject: [PATCH] Introduce BgCheckFlags Defines (#1195) * flags * cleanup * adjust comment --- include/z64actor.h | 30 ++++---- src/code/z_actor.c | 75 ++++++++++--------- src/code/z_bgcheck.c | 4 +- src/code/z_en_hy_code.c | 2 +- src/code/z_en_item00.c | 8 +- src/code/z_player_lib.c | 7 +- .../actors/ovl_Bg_Icicle/z_bg_icicle.c | 4 +- .../ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c | 4 +- .../z_bg_ikana_rotaryroom.c | 2 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 +- .../ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c | 2 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 2 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 26 ++++--- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 6 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 2 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 10 +-- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 4 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 16 ++-- src/overlays/actors/ovl_En_Az/z_en_az.c | 20 ++--- src/overlays/actors/ovl_En_Baguo/z_en_baguo.c | 6 +- src/overlays/actors/ovl_En_Bat/z_en_bat.c | 18 ++--- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 10 +-- .../actors/ovl_En_Bbfall/z_en_bbfall.c | 18 ++--- .../actors/ovl_En_Bigpamet/z_en_bigpamet.c | 10 +-- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 6 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 39 +++++----- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 18 ++--- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 10 +-- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 18 ++--- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 8 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 13 ++-- src/overlays/actors/ovl_En_Box/z_en_box.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 2 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 +- .../actors/ovl_En_Col_Man/z_en_col_man.c | 4 +- src/overlays/actors/ovl_En_Crow/z_en_crow.c | 15 ++-- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 5 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 4 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 36 ++++----- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 16 ++-- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 3 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 2 +- .../actors/ovl_En_Estone/z_en_estone.c | 5 +- src/overlays/actors/ovl_En_Famos/z_en_famos.c | 6 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 6 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 23 +++--- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 19 ++--- src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 2 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 10 +-- .../actors/ovl_En_Floormas/z_en_floormas.c | 28 +++---- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 4 +- .../actors/ovl_En_Fu_Mato/z_en_fu_mato.c | 4 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 4 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 2 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 6 +- src/overlays/actors/ovl_En_Gg/z_en_gg.c | 2 +- src/overlays/actors/ovl_En_Gg2/z_en_gg2.c | 2 +- src/overlays/actors/ovl_En_Gk/z_en_gk.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 4 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 12 +-- .../ovl_En_Grasshopper/z_en_grasshopper.c | 3 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 2 +- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 6 +- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 30 ++++---- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 5 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 4 +- .../actors/ovl_En_Insect/z_en_insect.c | 10 +-- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 4 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 24 +++--- src/overlays/actors/ovl_En_Jg/z_en_jg.c | 2 +- .../actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c | 14 ++-- .../actors/ovl_En_Kaizoku/z_en_kaizoku.c | 36 ++++----- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 8 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 20 ++--- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 5 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 9 ++- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 17 +++-- .../actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c | 2 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 4 +- .../actors/ovl_En_Minislime/z_en_minislime.c | 40 +++++----- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 12 +-- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 12 +-- .../actors/ovl_En_Mt_tag/z_en_mt_tag.c | 3 +- .../actors/ovl_En_Mushi2/z_en_mushi2.c | 6 +- .../actors/ovl_En_Nimotsu/z_en_nimotsu.c | 2 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 27 ++++--- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 12 +-- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 6 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 7 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 22 +++--- .../actors/ovl_En_Peehat/z_en_peehat.c | 4 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 4 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 4 +- src/overlays/actors/ovl_En_Pp/z_en_pp.c | 6 +- src/overlays/actors/ovl_En_Pr2/z_en_pr2.c | 5 +- .../actors/ovl_En_Racedog/z_en_racedog.c | 4 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 6 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 2 +- src/overlays/actors/ovl_En_Rat/z_en_rat.c | 4 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Rg/z_en_rg.c | 10 +-- src/overlays/actors/ovl_En_Ru/z_en_ru.c | 2 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 10 +-- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 16 ++-- .../actors/ovl_En_Scopecrow/z_en_scopecrow.c | 2 +- .../actors/ovl_En_Scopenuts/z_en_scopenuts.c | 6 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 4 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 24 +++--- .../actors/ovl_En_Snowman/z_en_snowman.c | 8 +- src/overlays/actors/ovl_En_St/z_en_st.c | 2 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 10 +-- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 +- .../ovl_En_Syateki_Crow/z_en_syateki_crow.c | 2 +- .../ovl_En_Syateki_Wf/z_en_syateki_wf.c | 10 +-- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 2 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 8 +- .../actors/ovl_En_Tanron5/z_en_tanron5.c | 4 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 22 +++--- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 54 ++++++------- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 4 +- src/overlays/actors/ovl_En_Toto/z_en_toto.c | 4 +- src/overlays/actors/ovl_En_Trt2/z_en_trt2.c | 13 ++-- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 4 +- src/overlays/actors/ovl_En_Twig/z_en_twig.c | 2 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 4 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 30 ++++---- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 6 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 2 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 2 +- .../actors/ovl_En_Zoraegg/z_en_zoraegg.c | 2 +- src/overlays/actors/ovl_En_Zow/z_en_zow.c | 2 +- src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c | 4 +- .../actors/ovl_Obj_Armos/z_obj_armos.c | 2 +- .../ovl_Obj_Bigicicle/z_obj_bigicicle.c | 2 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 8 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 9 ++- .../ovl_Obj_Grass_Carry/z_obj_grass_carry.c | 9 ++- .../actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c | 2 +- .../ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c | 6 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 7 +- .../actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c | 3 +- .../ovl_Obj_Snowball2/z_obj_snowball2.c | 15 ++-- src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c | 2 +- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 10 ++- 149 files changed, 719 insertions(+), 672 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index 249109a448..d2b28cb385 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -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; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 644d933b94..f6039a8edf 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -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; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index eda6437aff..6d4414c38f 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -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 { diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 1affc8df7c..2f508bb948 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -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 { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 987f8b10eb..4423a184d5 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -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; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index a52a7a5c44..4bdd22e0ad 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c index 0e8c0f493d..5a16e6845f 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -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; diff --git a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c index 18eb983259..e76d7217aa 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index 3a0107e11c..8b91992daa 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 55940f3fa7..67fedd58c6 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -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); diff --git a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c index 5a23089a21..7bc3e8544d 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c @@ -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) { diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 2ef6227375..9bb3cdf759 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -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; diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index fba59ca515..a13e18ec12 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -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; diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index a78b7234ec..709ef43f87 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 3ccfd26998..e4fdedaf59 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index acefdf5007..11ad2a9d72 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 9d0600b2e8..b2a6456bc5 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index fa6cd3e757..0c5ae730ff 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 0994ada491..630d0e599d 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 4c611c2734..94be4bdadf 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c index 516219265a..ba4c032bf6 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.c b/src/overlays/actors/ovl_En_Bat/z_en_bat.c index 519043dd83..748b337dec 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -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--; } diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index d122c6d2e6..325b5ad6b8 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c index 745ab6df51..9e246c3abb 100644 --- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c +++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c index 41fd002f51..74fbbfc511 100644 --- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c +++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index c932959a02..6af5b39051 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index a49f161f8a..803aafc3b9 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 134eee5190..f88f4da82b 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index c01dea3048..40e93b861d 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -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; } } diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index aff0579b12..d342e168fc 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index 042b4e332b..e1a5ef42f6 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index afc91770f6..4abfad7b17 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 9529b5fdf9..62767a888b 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 6cfb05c686..db6019b999 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 0353c6b4a8..e75d11bc61 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c index 9dda146c39..3bf81f96e7 100644 --- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c +++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 9e8234c591..187b7c539e 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 911e711c15..d962cad81b 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 580d4bb81c..72b88f1c57 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index 4470505ec8..6df7c314c5 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c index f92bfb4942..3bbe343246 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index f067c3988c..2641d583f0 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 7210e4cc6c..d214482171 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 23a60c5d45..1dc10cc8d6 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Estone/z_en_estone.c b/src/overlays/actors/ovl_En_Estone/z_en_estone.c index 573d386e59..72ac311a7a 100644 --- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c +++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.c b/src/overlays/actors/ovl_En_Famos/z_en_famos.c index dd54a3eded..13831e8a6a 100644 --- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c +++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c @@ -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; } } diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index 0efbf9674c..90f90cf74a 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index bd00c3cbd8..8288b9dc40 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -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--; } diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 60c09ebceb..6a769cdef6 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index 55b6bfca06..646855f012 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index 04b0752599..474957658e 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index eeb1a6bc31..7b4f4dea6d 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index f43d244323..fc687f9193 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c index 712a20428d..88a2c63b27 100644 --- a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c +++ b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 9158009935..1d7cbbb345 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 403a160660..54836f0716 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index ba84c4f56e..d005c5a39c 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index bb14b0dd07..a2ece1010f 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c index fe3e2fb463..d30dd6bd88 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index f0c8508853..431e674ad8 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 8e62b499b9..3f6fee7657 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 9ba8582786..312e1a9d93 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c index 9a506c0ba5..e3278cf259 100644 --- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c +++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 4ff4c1d1b4..935d3aaa3e 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c index a540da68a4..dc5610896f 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index d9df702ce0..863e607428 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 8e5d7a06f1..8c1c771bf7 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -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) { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 727e0f782d..62dab2268a 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 69e3c8eb8d..96ebd83db6 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index ecc6a57c43..2b4bdd09f4 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index b27111ca01..c9c42a10b1 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index 6aea8641b8..5b009f424b 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index 59e860c200..babafb5a04 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c index 49928a3695..d9d4000c55 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c index 234d865bde..dfdd18d7d5 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index ad14e2c189..ba1cf165c0 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 7a3658e2ae..e4e2bba998 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index fb8c87cf1a..11dac60026 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index 108b9e9ae7..30740f563c 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c index ae7ad360ce..88aabcdc96 100644 --- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c +++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index bfe805cb1e..ef3764a773 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c index 02a085e548..4aa052549f 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c index 59cc5249fa..7da0b46e30 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -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; } } } diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index bd8472a4e9..9cef987d6b 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -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 { diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c index 7b2dc9db6a..c7791dea7d 100644 --- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c +++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index 2490c5cc6f..90c3ea51fd 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -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); } } diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c index abaf6c3e07..9c91d7092c 100644 --- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c +++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 87fcf5a4d5..37da82a913 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 37872a491f..193334ff18 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 193d90ed3f..8c19472672 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index 8f5824bb02..ffa4b52016 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 743feb0825..927c709949 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -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--; diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index 54888a7d82..b3d7453c42 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 2ab3024f20..bd1ea7b3f9 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 14c5c62078..78d304094f 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index aeb741bbc9..7e0a7d8868 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -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); } diff --git a/src/overlays/actors/ovl_En_Pp/z_en_pp.c b/src/overlays/actors/ovl_En_Pp/z_en_pp.c index bf9f242b44..da634ab952 100644 --- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c +++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c index ab4aa43150..dd0f308d82 100644 --- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c +++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c @@ -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); diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c index c235c61a0d..a284f240ad 100644 --- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c +++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c @@ -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; } diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index 12af47c7e4..b3ee0d4abb 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -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; diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 0690278f2b..3904ce3b5c 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -907,7 +907,7 @@ void EnRailgibud_MoveGrabbedPlayerAwayFromWall(EnRailgibud* this, PlayState* pla } if ((this->actionFunc == EnRailgibud_Grab) && (this->grabState == EN_RAILGIBUD_GRAB_START) && - (this->actor.bgCheckFlags & 8)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { targetPos = player->actor.world.pos; targetPos.x += 10.0f * Math_SinS(this->actor.wallYaw); targetPos.z += 10.0f * Math_CosS(this->actor.wallYaw); diff --git a/src/overlays/actors/ovl_En_Rat/z_en_rat.c b/src/overlays/actors/ovl_En_Rat/z_en_rat.c index 6d54407895..041199193a 100644 --- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c +++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c @@ -718,7 +718,7 @@ void EnRat_SetupBounced(EnRat* this) { this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; this->actor.gravity = -1.0f; EnRat_UpdateSparkOffsets(this); - this->actor.bgCheckFlags &= ~(0x10 | 0x8 | 0x1); + this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING); this->actionFunc = EnRat_Bounced; } @@ -733,7 +733,7 @@ void EnRat_Bounced(EnRat* this, PlayState* play) { this->timer = 30; } - if (this->actor.bgCheckFlags & (0x10 | 0x8 | 0x1)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) { EnRat_Explode(this, play); } } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 83cdde9a30..7d6ad87a14 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1004,7 +1004,7 @@ void EnRd_Crouch(EnRd* this, PlayState* play) { void EnRd_SetupDamage(EnRd* this) { this->actor.shape.yOffset = 0.0f; Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -2.0f; } diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 58f8f706d9..caa24e8db6 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -318,7 +318,7 @@ void func_80BF40F4(EnRg* this) { } s32 func_80BF416C(EnRg* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed >= 0.01f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed >= 0.01f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG); func_800AE930(&play->colCtx, Effect_GetByIndex(this->unk_340), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); @@ -410,7 +410,7 @@ s32 func_80BF45B4(EnRg* this) { s16 temp_v0; s16 temp_v1; - if ((this->actor.bgCheckFlags & 8) && (this->actor.speed >= 5.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.speed >= 5.0f)) { temp_v1 = this->actor.world.rot.y; temp_v0 = temp_v1 - BINANG_ROT180(this->actor.wallYaw); @@ -533,7 +533,7 @@ void func_80BF4964(EnRg* this) { } if (!(this->unk_310 & 0x400) && !(this->unk_310 & 0x1000) && (this->unk_322 == 0) && (this->unk_324 == 0) && - (this->actor.bgCheckFlags & 1)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->unk_18C == NULL) { Math_Vec3s_ToVec3f(&sp30, &sp3C[this->unk_33C]); } else { @@ -676,7 +676,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { this->unk_344 = func_80BF4560(this, play); if (!Play_InCsMode(play)) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->unk_310 & 0x400) { this->unk_310 &= ~0x400; this->actor.speed = 0.0f; @@ -688,7 +688,7 @@ void func_80BF4FC4(EnRg* this, PlayState* play) { this->unk_33C++; } } - } else if ((this->actor.bgCheckFlags & 1) && !(this->unk_310 & 0x1000) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->unk_310 & 0x1000) && func_80BF4D64(&this->actor.world.pos)) { this->unk_310 |= 0x1000; } diff --git a/src/overlays/actors/ovl_En_Ru/z_en_ru.c b/src/overlays/actors/ovl_En_Ru/z_en_ru.c index fabf053597..0f8c458725 100644 --- a/src/overlays/actors/ovl_En_Ru/z_en_ru.c +++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.c @@ -145,7 +145,7 @@ s32 EnRu_PlayWalkingSound(EnRu* this, PlayState* play) { leftWasGrounded = this->isLeftFootGrounded; rightWasGrounded = this->isRightFootGrounded; - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (this->actor.depthInWater < 20.0f) { waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index 8f231ccfae..bd50d96b17 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -329,7 +329,7 @@ void EnRuppecrow_UpdatePosition(EnRuppecrow* this, PlayState* play) { Vec3s nextPointDirection; EnRuppecrow_GetPointDirection(this->path, this->currentPoint, &this->actor.world, &nextPointDirection); - if (this->actor.bgCheckFlags & 0x8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { nextPointDirection.y = this->actor.wallYaw; } @@ -444,7 +444,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { this->actor.shape.yOffset = 0.0f; this->actor.targetArrowOffset = 0.0f; - this->actor.bgCheckFlags &= ~0x1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; scale = this->actor.scale.x * 100.0f; this->actor.world.pos.y += 20.0f * scale; @@ -492,7 +492,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { Player* player = GET_PLAYER(play); EnRuppecrow_UpdatePosition(this, play); - if (this->actor.xzDistToPlayer < 1000.0f && EnRuppecrow_CheckPlayedMatchingSong(play)) { + if ((this->actor.xzDistToPlayer < 1000.0f) && EnRuppecrow_CheckPlayedMatchingSong(play)) { // If Link is in front, the guay will turn around and go the other way if (Actor_IsFacingPlayer(&this->actor, 0x4000)) { this->isGoingCounterClockwise |= 1; @@ -569,7 +569,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) { } void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, PlayState* play) { - if (this->actor.bgCheckFlags & 0x8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y *= -0x1; } @@ -608,7 +608,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, PlayState* play) { this->actor.shape.rot.z += 0x1780; } - if (this->actor.bgCheckFlags & 0x1 || this->actor.floorHeight == BGCHECK_Y_MIN) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { EnRuppecrow_ShatterIce(this, play); func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, (this->actor.scale.x * 10000.0f), 0x0, 0x0); diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 1a2f84536b..d743318465 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -268,11 +268,11 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) { void EnSb_Lunge(EnSb* this, PlayState* play) { Math_StepToF(&this->actor.speed, 0.0f, 0.2f); - if (this->actor.velocity.y <= -0.1f || this->actor.bgCheckFlags & 2) { + if ((this->actor.velocity.y <= -0.1f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH)) { if (!(this->actor.depthInWater > 0.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } - this->actor.bgCheckFlags &= ~2; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; EnSb_SetupBounce(this); } } @@ -298,8 +298,8 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { } EnSb_SpawnBubbles(play, this); EnSb_SetupLunge(this); - } else if (this->actor.bgCheckFlags & 1) { - this->actor.bgCheckFlags &= ~2; + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH; this->actor.speed = 0.0f; this->attackTimer = 1; EnSb_SetupWaitClosed(this); @@ -310,12 +310,12 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { void EnSb_ReturnToIdle(EnSb* this, PlayState* play) { if (this->attackTimer != 0) { this->attackTimer--; - if (this->actor.bgCheckFlags & 1) { - this->actor.bgCheckFlags &= ~1; + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.speed = 0.0f; } - } else if (this->actor.bgCheckFlags & 1) { - this->actor.bgCheckFlags &= ~1; + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actionFunc = EnSb_Idle; this->actor.speed = 0.0f; } diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c index 4d3c3b7b7d..d7a1df7001 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c @@ -236,7 +236,7 @@ void func_80BCD640(EnScopecrow* this, PlayState* play) { if (this->path != NULL) { func_80BCD4D0(this->path, this->unk_1FC, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index bb52f4425e..a8803b2585 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -208,7 +208,7 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { if (this->path != NULL) { func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 10, 300, 0); @@ -238,7 +238,7 @@ void func_80BCB078(EnScopenuts* this, PlayState* play) { void func_80BCB1C8(EnScopenuts* this, PlayState* play) { this->unk_350 *= 0.92f; Actor_SetScale(&this->actor, this->unk_350); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { SET_WEEKEVENTREG(WEEKEVENTREG_52_40); Actor_Kill(&this->actor); } @@ -564,7 +564,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { if (this->path != NULL) { sp34 = func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp38.y = this->actor.wallYaw; } diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index d0a3fc0e98..bfa90e0f71 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -649,7 +649,7 @@ void func_80ADC37C(EnSellnuts* this, PlayState* play) { this->actor.gravity = 0.0f; if (this->path != NULL) { sp2C = func_80ADCFE8(this->path, this->unk_334, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 0xA, 0x12C, 0); @@ -780,7 +780,7 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { if (this->path != NULL) { func_80ADCFE8(this->path, this->unk_334, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp30.y = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 0xA, 0x12C, 0); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index f127902b69..80c9d9e401 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -526,7 +526,7 @@ void func_80995818(EnSkb* this, PlayState* play) { func_80995A30(this); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; for (i = 0; i < 10; i++) { func_809947B0(play, this, &this->actor.world.pos); @@ -635,7 +635,7 @@ void func_80995DC4(EnSkb* this, PlayState* play) { } void func_80995E08(EnSkb* 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); @@ -645,17 +645,17 @@ void func_80995E08(EnSkb* this) { } void func_80995E64(EnSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { 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; } } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->unk_3DC == 0) { if (this->actor.colChkInfo.health == 0) { func_809961E4(this, play); @@ -693,7 +693,7 @@ void func_80995F98(EnSkb* 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; } } @@ -703,7 +703,7 @@ void func_80995F98(EnSkb* this) { } void func_809960AC(EnSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { s32 i; for (i = 0; i < 10; i++) { @@ -712,7 +712,7 @@ void func_809960AC(EnSkb* 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; } @@ -720,7 +720,8 @@ void func_809960AC(EnSkb* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 0x10, 0x7D0, 0x64); - 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.shape.rot.x = 0; this->actor.world.rot = this->actor.shape.rot; func_80994DA8(this, play); @@ -730,7 +731,7 @@ void func_809960AC(EnSkb* this, PlayState* play) { void func_809961E4(EnSkb* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); this->unk_3D8 |= 0x40; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -6.0f; } this->unk_3E4 = 0; @@ -873,7 +874,8 @@ void func_8099672C(EnSkb* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((this->unk_3DE != 6) && (this->unk_3DE != 7)) { - 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; this->unk_3E4 = 0; func_809961E4(this, play); diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c index 0c4d0d465d..e96f30bd13 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -403,7 +403,7 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) { } this->actor.world.rot.y = this->actor.shape.rot.y; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->snowPileTargetRotY = this->actor.wallYaw; } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 200.0f) { this->snowPileTargetRotY = @@ -1081,9 +1081,9 @@ void EnSnowman_UpdateSnowball(Actor* thisx, PlayState* play) { this->collider.base.ocFlags1 |= OC1_ON; } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->actor.bgCheckFlags & 0x10) || - (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 (EN_SNOWMAN_GET_TYPE(&this->actor) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) { scale = 10; for (i = 0; i < 3; i++) { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index ff34769625..b3ed297221 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -776,7 +776,7 @@ void func_808A6E24(EnSt* this, PlayState* play) { this->unk_2CC = 0.0f; this->unk_2D4 = 0.0f; } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.shape.yOffset = 400.0f; this->actor.world.rot.x = 0x4000; this->actor.shape.rot.x = this->actor.world.rot.x; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 997db1cf12..15d4c78c75 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -632,7 +632,7 @@ void func_80BABA90(EnSuttari* this, s32 arg1, u8 arg2) { if (this->paths[arg1] != NULL) { target = EnSuttari_GetDistSqAndOrient(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &dist); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (arg2 == 2) { this->unk1F4[arg1] = -0x63; } else { @@ -661,7 +661,7 @@ void func_80BABB90(EnSuttari* this, s32 arg1) { if (this->paths[arg1] != NULL) { target = EnSuttari_GetDistSqAndOrient(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { target = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, target, 1, 0xBB8, 0); @@ -1045,7 +1045,7 @@ void func_80BACBB0(EnSuttari* this, PlayState* play) { this->actionFunc = func_80BACA14; } if ((this->actor.playerHeightRel < 60.0f) && (this->actor.xzDistToPlayer < 500.0f)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { target = this->actor.wallYaw; } else if (func_80BAA904(this, play)) { target = -this->actor.world.rot.y; @@ -1060,7 +1060,7 @@ void func_80BACBB0(EnSuttari* this, PlayState* play) { this->actor.speed = 0.0f; } Actor_MoveWithGravity(&this->actor); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; this->actionFunc = func_80BACE4C; @@ -1082,7 +1082,7 @@ void func_80BACD2C(EnSuttari* this, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; } Actor_MoveWithGravity(&this->actor); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; this->actionFunc = func_80BACE4C; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 9606e3d080..41337848a8 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -873,7 +873,7 @@ void func_808DA89C(EnSw* this, PlayState* play) { } else if (ENSW_GET_3(&this->actor)) { this->actionFunc = func_808DAEB4; } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { f32 temp_f2; this->actor.shape.yOffset = 400.0f; @@ -1103,7 +1103,7 @@ void func_808DB25C(EnSw* this, PlayState* play) { void func_808DB2E0(EnSw* this, PlayState* play) { f32 temp_f2; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_808D9F78(this, play, 0); temp_f2 = fabsf(this->actor.velocity.y) * 0.6f; this->actor.velocity.x *= 0.5f; diff --git a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c index ffc8e9d9b9..390a2896f1 100644 --- a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c +++ b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c @@ -225,7 +225,7 @@ void EnSyatekiCrow_SetupDead(EnSyatekiCrow* this) { this->actor.speed *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Actor_PlaySfx(&this->actor, NA_SE_EN_KAICHO_DEAD); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->actionFunc = EnSyatekiCrow_Dead; diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c index 7dd26d9a93..7c32612bf4 100644 --- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c +++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c @@ -291,15 +291,15 @@ void EnSyatekiWf_Run(EnSyatekiWf* this, PlayState* play) { targetPoint.z = this->pathPoints[this->currentPointIndex].z; wallYawDiff = (this->actor.wallYaw - this->actor.world.rot.y) + 0x8000; - if (this->actor.bgCheckFlags & 1) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if ((ABS(wallYawDiff) < 0x1555) && (this->actor.wallPoly != this->actor.floorPoly)) { EnSyatekiWf_SetupJump(this); return; } } - if (this->actor.bgCheckFlags & 4) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_LEAVE) { this->actor.velocity.y = 2.0f; } @@ -345,7 +345,7 @@ void EnSyatekiWf_SetupJump(EnSyatekiWf* this) { } void EnSyatekiWf_Jump(EnSyatekiWf* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { EnSyatekiWf_SetupLand(this); } } @@ -428,7 +428,7 @@ void EnSyatekiWf_Update(Actor* thisx, PlayState* play2) { Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 60.0f, 5); this->actionFunc(this, play); - if (this->actor.bgCheckFlags & 3) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); } else { Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x3E8, 0); diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index ac65fbbe61..691290a078 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -1113,7 +1113,7 @@ void EnTalkGibud_MoveGrabbedPlayerAwayFromWall(EnTalkGibud* this, PlayState* pla Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 20.0f, 35.0f, 29); if (this->actionFunc == EnTalkGibud_Grab && this->grabState == EN_TALK_GIBUD_GRAB_START && - (this->actor.bgCheckFlags & 8)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { targetPos = player->actor.world.pos; targetPos.x += 10.0f * Math_SinS(this->actor.wallYaw); targetPos.z += 10.0f * Math_CosS(this->actor.wallYaw); diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index 1ff73fd9f5..bc8fee2fd8 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -180,7 +180,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { Player* player = GET_PLAYER(play); this->skelAnime.curFrame = 4.0f; - if ((player->actor.bgCheckFlags & 1) && player->actor.shape.feetPos[0].y >= 438.0f) { + if ((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && player->actor.shape.feetPos[0].y >= 438.0f) { // Player is standing on the central platform, so stop chasing them this->isNonHostile = true; } else if (this->isNonHostile && this->workTimer[WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) { @@ -275,13 +275,13 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { this->targetPosWithDeviation.y = this->waterSurfaceYPos - 50.0f; this->workTimer[WORK_TIMER_OUT_OF_WATER] = 25; Math_ApproachS(&this->actor.world.rot.x, 0x3000, 5, 0xBD0); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speed = 0.0f; if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y = -1.0f; } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // Fish has touched land this->isBeached = true; } @@ -289,7 +289,7 @@ void EnTanron3_Live(EnTanron3* this, PlayState* play) { case true: this->nextRotationAngle = 0x3A98; this->actor.gravity = -1.5f; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // Fish is still touching land, so it's still beached. Randomly flop around this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 5.0f; this->actor.speed = Rand_ZeroFloat(2.0f) + 2.0f; diff --git a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c index dc33f7a650..e285869a56 100644 --- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c +++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c @@ -425,7 +425,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { this->actor.shape.rot.y += this->unk_19A; sp6C = 1225.0f; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (ENTANRON5_GET(&this->actor) < ENTANRON5_108) { Math_Vec3f_Copy(&sp5C, &this->actor.world.pos); sp5C.y = this->actor.floorHeight; @@ -441,7 +441,7 @@ void func_80BE5818(Actor* thisx, PlayState* play2) { } else { sp6C = 400.0f; this->unk_198 += 0x2000; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_198 = 0; this->actor.speed = 0.0f; } diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c index 81b8000484..174b798691 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -484,7 +484,7 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { sp38 = Animation_OnFrame(&this->skelAnime, 0.0f); this->actor.speed = (Rand_ZeroOne() * 1.5f) + 3.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else { if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { @@ -504,7 +504,7 @@ void func_80C11590(EnThiefbird* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); } - if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_190 = -4096; } else if (this->actor.world.pos.y < (this->actor.home.pos.y - 75.0f)) { this->unk_190 = -Rand_S16Offset(2048, 2048); @@ -557,7 +557,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { pitch = Actor_WorldPitchTowardActor(&this->actor, &player->actor); pitch = CLAMP(pitch, -0x2800, 0x2800); Math_SmoothStepToS(&this->actor.shape.rot.x, pitch, 4, 0x800, 0x80); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 6, 0x1000, 0x100); } else if (Actor_IsFacingPlayer(&this->actor, 0x3C00) || (this->actor.xzDistToPlayer > 120.0f)) { s16 rot = BINANG_ROT180(this->actor.yawTowardsPlayer - player->actor.shape.rot.y); @@ -574,7 +574,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) { if ((this->unk_18E == 0) || (player->stateFlags1 & PLAYER_STATE1_800000) || (Player_GetMask(play) == PLAYER_MASK_STONE) || (this->collider.base.atFlags & AT_HIT) || - (this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > -40.0f)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; Actor_PlaySfx(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); @@ -602,7 +602,7 @@ void func_80C11C60(EnThiefbird* this) { this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; Animation_PlayOnce(&this->skelAnime, &gTakkuriDeathAnim); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.shape.rot.x = 0; this->unk_18E = 40; this->actor.velocity.y = 0.0f; @@ -654,7 +654,7 @@ void func_80C11DF0(EnThiefbird* this, PlayState* play) { this->actor.shape.rot.y += this->unk_192; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { for (i = 0; i < ARRAY_COUNT(this->limbPos); i++) { func_800B3030(play, &this->limbPos[i], &gZeroVec3f, &gZeroVec3f, 0x8C, 0, 0); } @@ -732,7 +732,7 @@ void func_80C1215C(EnThiefbird* this, PlayState* play) { } SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else if (this->unk_3E8 == 0) { this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); @@ -771,7 +771,7 @@ void func_80C12378(EnThiefbird* this, PlayState* play) { } SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else { this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); @@ -798,7 +798,7 @@ void func_80C124B0(EnThiefbird* this, PlayState* play) { s16 temp_v1; SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_192 = this->actor.wallYaw; } else { this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &D_80C13920); @@ -881,7 +881,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { } if (this->unk_3EC != NULL) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 3, 0x2000, 0x100); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_3EC->actor), @@ -909,7 +909,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) { } } else { this->actor.speed = 4.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 6, 0x1000, 0x100); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 6, 0x1000, 0x100); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 7c04554b63..349c02bda7 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -195,7 +195,7 @@ void func_80893A18(EnTite* this) { } s32 func_80893A34(EnTite* this, PlayState* play) { - if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & 1) && + if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (func_800C99D4(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 5)) { return true; } @@ -211,7 +211,7 @@ void func_80893A9C(EnTite* this, PlayState* play) { } s32 func_80893ADC(EnTite* this) { - if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & 0x20)) { + if ((this->actor.params == ENTITE_MINUS_2) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { return true; } return false; @@ -224,7 +224,7 @@ s32 func_80893B10(EnTite* this) { void func_80893B70(EnTite* this) { if (this->actor.params == ENTITE_MINUS_2) { - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { this->actor.gravity = 0.0f; func_80893B10(this); } else { @@ -238,7 +238,7 @@ void func_80893BCC(EnTite* this, PlayState* play) { s32 i; s32 j; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { u32 surface = func_800C9BB8(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((surface == COLPOLY_SURFACE_GROUND) || (surface == COLPOLY_SURFACE_SAND)) { @@ -356,7 +356,8 @@ void func_8089408C(EnTite* this, PlayState* play) { this->actor.velocity.y = 8.0f; } - this->actor.bgCheckFlags &= ~(0x40 | 0x20 | 0x2 | 0x1); + this->actor.bgCheckFlags &= + ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH); this->actor.gravity = -1.0f; this->actor.speed = 4.0f; this->actionFunc = func_808942B4; @@ -364,7 +365,8 @@ void func_8089408C(EnTite* this, PlayState* play) { void func_808942B4(EnTite* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && + if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { this->actor.speed = 0.0f; this->collider.base.atFlags &= ~AT_HIT; @@ -463,7 +465,8 @@ void func_80894638(EnTite* this, PlayState* play) { if ((Player_GetMask(play) == PLAYER_MASK_STONE) || (this->actor.xzDistToPlayer > 450.0f) || (this->actor.playerHeightRel > 80.0f)) { func_80893ED4(this); - } else if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater < 10.0f))) && + } else if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (func_80893ADC(this) && (this->actor.depthInWater < 10.0f))) && Actor_IsFacingPlayer(&this->actor, 0xE38)) { if ((this->actor.xzDistToPlayer <= 180.0f) && (this->actor.playerHeightRel <= 80.0f)) { func_80893A9C(this, play); @@ -495,7 +498,7 @@ void func_80894910(EnTite* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 1.0f, 0.0f); SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER); if (func_80893ADC(this)) { @@ -508,7 +511,8 @@ void func_80894910(EnTite* this, PlayState* play) { func_80893BCC(this, play); } - if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && + if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (func_80893ADC(this) && (this->actor.depthInWater > 0.0f))) && (this->actor.velocity.y <= 0.0f)) { this->actor.speed = 0.0f; Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4000); @@ -556,13 +560,13 @@ void func_80894BC8(EnTite* this, PlayState* play) { this->actor.world.pos.y += this->actor.depthInWater - 1.0f; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, play); } - if ((this->actor.speed == 0.0f) && ((this->actor.bgCheckFlags & 1) || func_80893ADC(this))) { + if ((this->actor.speed == 0.0f) && ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || func_80893ADC(this))) { this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.acFlags |= AC_ON; if ((Player_GetMask(play) == PLAYER_MASK_STONE) || @@ -598,7 +602,7 @@ void func_80894E0C(EnTite* this, PlayState* play) { this->actor.world.pos.y += this->actor.depthInWater; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, play); @@ -688,7 +692,7 @@ void func_808952EC(EnTite* this) { this->actor.speed = 0.0f; this->actor.gravity = -1.0f; this->unk_2B8 = Rand_ZeroOne() * 50.0f; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = 11.0f; this->actionFunc = func_80895424; } @@ -704,9 +708,9 @@ void func_80895424(EnTite* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->collider.base.acFlags |= AC_ON; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 20.0f, 11, 4.0f, 0, 0, 0); Actor_PlaySfx(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } @@ -725,7 +729,7 @@ void func_808955E4(EnTite* this) { this->unk_2B9 = 0; this->actor.velocity.y = 13.0f; Actor_PlaySfx(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_80895640; } @@ -733,7 +737,7 @@ void func_808955E4(EnTite* this) { void func_80895640(EnTite* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 4000); SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->collider.base.acFlags |= AC_ON; this->actor.shape.yOffset = 0.0f; func_80893BCC(this, play); @@ -752,7 +756,7 @@ void func_808956B8(EnTite* this) { void func_808956FC(EnTite* this) { this->unk_2BC = -1; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; this->actor.velocity.y = 7.5f; func_80893A18(this); } @@ -765,13 +769,13 @@ void func_80895738(EnTite* this, PlayState* play) { if (this->collider.base.atFlags & AT_BOUNCED) { func_808956FC(this); } - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = BINANG_SUB((this->actor.wallYaw * 2) - this->actor.world.rot.y, 0x8000); } if (this->unk_2BC == -1) { Math_StepToF(&this->actor.speed, 0.0f, 0.3f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.world.rot.y = this->actor.shape.rot.y; func_80893ED4(this); this->unk_2BC = 100; @@ -832,7 +836,7 @@ void func_80895AC0(EnTite* this, PlayState* play) { } if ((this->unk_2BC == 1) || (this->unk_2BC == -1)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { temp_v1 = this->actor.shape.rot.y - this->actor.wallYaw; temp_v0 = ABS_ALT(temp_v1); if (temp_v0 > 0x3000) { @@ -1012,7 +1016,7 @@ void func_80895FF8(EnTite* this, PlayState* play) { } } } - } else if ((this->actor.bgCheckFlags & 1) && (this->collider.base.acFlags & AC_ON) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->collider.base.acFlags & AC_ON) && (this->actor.colChkInfo.health != 0) && (play->actorCtx.unk2 != 0) && (this->actor.xyzDistToPlayerSq < SQ(200.0f))) { this->actor.flags |= ACTOR_FLAG_1; @@ -1032,13 +1036,13 @@ void func_808963B4(EnTite* this, PlayState* play) { s32 i; Vec3f sp48; - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { for (i = 5; i < ARRAY_COUNT(this->limbPos); i++) { Math_Vec3f_Copy(&sp48, &this->limbPos[i]); sp48.y = this->actor.world.pos.y + this->actor.depthInWater; EffectSsGRipple_Spawn(play, &sp48, 0, 220, 0); } - } else if (this->actor.bgCheckFlags & 0x20) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { s32 temp = play->gameplayFrames & 7; if (!(temp & 1) && (this->actor.depthInWater < 10.0f)) { @@ -1060,7 +1064,7 @@ void EnTite_Update(Actor* thisx, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 25.0f, 40.0f, 20.0f, this->unk_2C0); func_808963B4(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); if (this->unk_2B9 != 0) { this->actor.shape.rot.z = BINANG_ROT180(this->actor.shape.rot.z); diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 57ad2b8fc1..59d69dd5a3 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -1321,9 +1321,9 @@ void EnTk_Update(Actor* thisx, PlayState* play) { } if (!(this->unk_2CA & 0x200)) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EV_HUMAN_BOUND); } } diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index aefa6383fc..09b748597e 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -190,7 +190,7 @@ void EnToto_Init(Actor* thisx, PlayState* play) { return; } 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_zm_Skel_00A978, ((play->sceneId == SCENE_SONCHONOIE) ? &object_zm_Anim_003AA8 : &object_zm_Anim_00C880), this->jointTable, this->morphTable, 18); @@ -515,7 +515,7 @@ s32 func_80BA4530(EnToto* this, PlayState* play) { this->unk2B6 = 1; return this->text->unk1; } - if (player->actor.bgCheckFlags & 1) { + if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { temp_s0 = &D_80BA50DC[gSaveContext.save.playerForm - 1]; if (func_80BA44D4(temp_s0, player)) { Math_Vec3s_ToVec3f(&player->actor.world.pos, &temp_s0->unk6); diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index 4693183de2..4059e7fbbb 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -164,7 +164,7 @@ void func_80AD3530(EnTrt2* this, PlayState* play) { func_80AD46F8(this); if (this->path != NULL) { phi_a1 = func_80AD48F8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { phi_a1 = this->actor.wallYaw; } Math_SmoothStepToS(&this->actor.world.rot.y, phi_a1, 4, 1000, 1); @@ -269,7 +269,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->unk_1E4 >= (this->path->count - 1)) { ActorCutscene_Stop(this->unk_3DA); this->unk_3D9 = 2; @@ -332,7 +332,7 @@ void func_80AD3BE4(EnTrt2* this, PlayState* play) { void func_80AD3C94(EnTrt2* this, PlayState* play) { if (this->actor.world.pos.y < 5.0f) { func_80AD4A78(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_3B2 = 0xF; } } @@ -666,7 +666,7 @@ s32 func_80AD4B4C(EnTrt2* this, PlayState* play) { this->actor.speed = 0.0f; func_80AD349C(this); this->unk_3B4 = this->unk_3B2; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) { this->unk_3A8 = 0x84F; } @@ -686,7 +686,7 @@ s32 func_80AD4B4C(EnTrt2* this, PlayState* play) { } s32 func_80AD4C4C(EnTrt2* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.xzDistToPlayer < 100.0f) { return true; } @@ -700,7 +700,8 @@ s32 func_80AD4CCC(EnTrt2* this, PlayState* play) { s16 sp1E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; Player* player = GET_PLAYER(play); - if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && !(this->actor.bgCheckFlags & 1) && + if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && ((player->transformation == PLAYER_FORM_HUMAN) || (player->transformation == PLAYER_FORM_FIERCE_DEITY))) { this->actor.speed = 0.0f; this->actor.velocity.y = 1.5f; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 8ed93d9659..48d7b4330d 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -173,7 +173,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { Player* player = GET_PLAYER(play); Player* player2 = GET_PLAYER(play); - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 15.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) { EnTuboTrap_SpawnEffectsInWater(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, play); @@ -214,7 +214,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnTuboTrap_SpawnEffectsOnLand(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); diff --git a/src/overlays/actors/ovl_En_Twig/z_en_twig.c b/src/overlays/actors/ovl_En_Twig/z_en_twig.c index 5843357ee8..8573c956d8 100644 --- a/src/overlays/actors/ovl_En_Twig/z_en_twig.c +++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.c @@ -67,7 +67,7 @@ void EnTwig_Init(Actor* thisx, PlayState* play2) { if (sColHeaders[this->unk_160] != NULL) { DynaPolyActor_LoadMesh(play, &this->dyna, sColHeaders[this->unk_160]); } - this->dyna.actor.bgCheckFlags |= 0x400; + this->dyna.actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; switch (this->unk_160) { case 0: Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index d70d2c43a9..033ed1ff7a 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -180,7 +180,7 @@ void EnVm_Init(Actor* thisx, PlayState* play) { this->unk_21C = params * 40.0f; thisx->params &= 0xFF; - this->actor.bgCheckFlags |= 0x400; + this->actor.bgCheckFlags |= BGCHECKFLAG_PLAYER_400; if (!D_808CD5B8) { for (i = 0; i < ARRAY_COUNT(D_808CD58C); i++) { diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 38eb630a37..ae056ffa94 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -245,7 +245,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, PlayState* play) { if ((player->stateFlags1 & (PLAYER_STATE1_100000 | PLAYER_STATE1_8000000)) || (player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B5E > 0) || (player->actor.freezeTimer > 0) || - !(player->actor.bgCheckFlags & 1) || + !(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || ((WALLMASTER_GET_TYPE(&this->actor) == WALLMASTER_TYPE_PROXIMITY) && (Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos) > (120.f + this->detectionRadius)))) { AudioSfx_StopById(NA_SE_EN_FALL_AIM); @@ -635,7 +635,7 @@ void EnWallmas_Update(Actor* thisx, PlayState* play) { if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - if ((this->actionFunc != EnWallmas_Damage) && (this->actor.bgCheckFlags & 1) && + if ((this->actionFunc != EnWallmas_Damage) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.freezeTimer == 0)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index f647f570fa..45bf5cc887 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -419,7 +419,7 @@ s32 func_80990948(PlayState* play, EnWf* this, s16 arg2) { if (func_800BE184(play, &this->actor, 100.0f, 24000, 0x2AA8, this->actor.shape.rot.y)) { this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if ((this->actor.bgCheckFlags & 8) && (sp38 < 12000)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (sp38 < 12000)) { func_809926D0(this); return true; } @@ -499,7 +499,7 @@ void func_80990C6C(EnWf* this, PlayState* play, s32 arg2) { } void func_80990E4C(EnWf* this, PlayState* play) { - if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->actor.bgCheckFlags & 1)) { + if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80990C6C(this, play, 2); Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_WALK); } @@ -776,7 +776,7 @@ void func_809919F4(EnWf* this, PlayState* play) { if (!func_8099408C(play, this) && !func_80990948(play, this, 0)) { this->actor.world.rot.y = this->actor.shape.rot.y; sp26 = BINANG_ROT180(player->actor.shape.rot.y + this->unk_29A); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { temp_v0 = (this->actor.wallYaw - this->actor.yawTowardsPlayer) - this->unk_29A; if (ABS_ALT(temp_v0) > 0x2EE0) { this->unk_29A = -this->unk_29A; @@ -974,7 +974,7 @@ void func_809923E4(EnWf* this, PlayState* play) { void func_8099245C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosDamagedAnim, -4.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -4.0f; } this->unk_298 = 0; @@ -986,11 +986,11 @@ void func_8099245C(EnWf* this) { void func_809924EC(EnWf* this, PlayState* play) { s16 sp26; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; } - if ((this->actor.bgCheckFlags & 1) && (this->actor.speed < 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speed < 0.0f)) { this->actor.speed += 0.05f; } @@ -1002,7 +1002,8 @@ void func_809924EC(EnWf* this, PlayState* play) { return; } - if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(sp26) < 0x2EE0) && (this->actor.xzDistToPlayer < 120.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS_ALT(sp26) < 0x2EE0) && + (this->actor.xzDistToPlayer < 120.0f)) { func_809926D0(this); } else if (!func_8099408C(play, this)) { if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && @@ -1033,7 +1034,8 @@ void func_809926D0(EnWf* this) { void func_80992784(EnWf* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2500); - if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & (2 | 1))) { + if (SkelAnime_Update(&this->skelAnime) && + (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) { this->actor.shape.rot.x = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; @@ -1115,7 +1117,7 @@ void func_80992B8C(EnWf* this, PlayState* play) { Player* player = GET_PLAYER(play); Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_29A, 2000); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { sp2C = BINANG_SUB((this->actor.wallYaw - this->actor.yawTowardsPlayer), this->unk_29A); if (ABS_ALT(sp2C) > 0x2EE0) { this->unk_29A = -this->unk_29A; @@ -1155,7 +1157,7 @@ void func_80992D6C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosRearUpFallOverAnim, -4.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speed = -6.0f; } this->actor.flags &= ~ACTOR_FLAG_1; @@ -1167,11 +1169,11 @@ void func_80992D6C(EnWf* this) { void func_80992E0C(EnWf* this, PlayState* play) { static Vec3f D_809942F0 = { 0.0f, 0.5f, 0.0f }; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speed = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToF(&this->actor.speed, 0.0f, 0.5f); } @@ -1337,7 +1339,7 @@ void func_8099357C(EnWf* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (BINANG_SUB(sp2E, this->actor.wallYaw) > 0) { sp2E = this->actor.wallYaw - 0x4000; } else { @@ -1486,7 +1488,7 @@ void EnWf_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 60.0f, 0x1D); func_80993738(this, play); - if (this->actor.bgCheckFlags & (2 | 1)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) { func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot); } else { Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 600); diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index daa71ac7b5..f15c34f221 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -206,15 +206,15 @@ void EnWiz_MoveMagicProjectile(EnWizFire* this, PlayState* play) { Math_ApproachF(&this->scale, this->targetScale, 0.2f, 0.01f); if (this->wallCheckTimer == 0) { - if ((this->actor.bgCheckFlags & 8) && (this->type == EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) && (this->timer != 0) && - (this->actor.bgCheckFlags & 8)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->type == EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) && + (this->timer != 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { sPoolHitByIceArrow = false; this->timer = 0; this->targetScale = 0.0f; } } - if ((this->actor.bgCheckFlags & 1) && (this->poolTimer == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->poolTimer == 0)) { s32 i; s16 arcingProjectileRotY; s32 pad; diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 8c1c9d4937..0e282656c2 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -129,7 +129,7 @@ s32 EnZo_PlayWalkingSound(EnZo* this, PlayState* play) { leftWasGrounded = this->isLeftFootGrounded; rightWasGrounded = this->isRightFootGrounded; - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { if (this->actor.depthInWater < 20.0f) { waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index 81d5583058..0d6c11e0e5 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -894,7 +894,7 @@ void func_80B94E34(EnZog* this, PlayState* play) { this->actionFunc = func_80B94D0C; this->actor.speed = 0.0f; this->unk_300 = 2; - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.home.rot.z = 1; this->actionFunc = func_80B94C5C; this->actor.speed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c index 6dd9103707..b4eb2de2fe 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -579,7 +579,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play) { func_80B31C40(this, play); func_80B31D64(this, play, 13, 0.0f); - if (this->actor.bgCheckFlags & 0x1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actionFunc = func_80B32B70; } diff --git a/src/overlays/actors/ovl_En_Zow/z_en_zow.c b/src/overlays/actors/ovl_En_Zow/z_en_zow.c index c4ef1aaffc..1f61075e1b 100644 --- a/src/overlays/actors/ovl_En_Zow/z_en_zow.c +++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.c @@ -420,7 +420,7 @@ void func_80BDD350(EnZow* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > 180.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.depthInWater > 180.0f)) { this->actor.velocity.y = 0.0f; this->actionFunc = func_80BDD79C; } diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c index b5a335d920..97c8bb7d94 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -175,8 +175,8 @@ void func_80ACBC70(ObjAqua* this) { } void func_80ACBC8C(ObjAqua* this, PlayState* play) { - if (this->actor.bgCheckFlags & 0x21) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WATER)) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80ACB7F4(this, play); func_80ACBA10(this); Actor_PlaySfx(&this->actor, NA_SE_EV_BOTTLE_WATERING); diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c index 5f46b6596f..05544da0e6 100644 --- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c +++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c @@ -325,7 +325,7 @@ void ObjArmos_Update(Actor* thisx, PlayState* play2) { if (this->unk_24C != 0) { Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 20.0f, 30.0f, 0.0f, this->unk_24C); - if ((this->actionFunc == func_809A54E0) && (this->dyna.actor.bgCheckFlags & 1) && + if ((this->actionFunc == func_809A54E0) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (DynaPoly_GetActor(&play->colCtx, this->dyna.actor.floorBgId) == NULL)) { this->unk_24C = 0; } diff --git a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c index b4c53a4381..04871bae56 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c @@ -256,7 +256,7 @@ void func_80AE9258(ObjBigicicle* this, PlayState* play) { itemAction = itemAction->next; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actionFunc = func_80AE939C; } else { Collider_UpdateCylinder(&this->actor, &this->collider1); diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 24b4188975..f37a15a80b 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -437,9 +437,9 @@ void func_8098DE58(ObjComb* this) { void func_8098DEA0(ObjComb* this, PlayState* play) { this->unk_1B4--; - if ((this->actor.bgCheckFlags & 1) || (this->unk_1B4 <= 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->unk_1B4 <= 0)) { func_8098DA74(this, play); - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 30.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 30.0f)) { func_8098D47C(this, play); } else { func_8098D19C(this, play); @@ -447,11 +447,11 @@ void func_8098DEA0(ObjComb* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_HONEYCOMB_BROKEN); func_8098E098(this); } else { - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { func_8098D6E0(this, play); } - if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) { this->actor.gravity = -0.5f; this->actor.velocity.y *= 0.8f; this->unk_1AE >>= 1; diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index c09362936b..cb1e17eaf5 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -456,7 +456,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_POT); - } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 19.0f)) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); func_80A1C328(this, play); @@ -491,7 +491,7 @@ void func_80A1C838(ObjFlowerpot* this, PlayState* play) { if (this->unk_1EA & 1) { Actor_MoveWithGravity(&this->actor); func_80A1C5E8(this, play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.colChkInfo.mass == MASS_IMMOVABLE) { if (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL) { this->actor.flags &= ~ACTOR_FLAG_10; @@ -602,7 +602,8 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { func_80A1C62C(this, play); - if ((this->actor.bgCheckFlags & (0x8 | 0x2 | 0x1)) || sp28 || (this->unk_1E8 <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || sp28 || + (this->unk_1E8 <= 0)) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); func_80A1C0FC(this, play); @@ -615,7 +616,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, play); func_80A1C328(this, play); diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c index b0557d483a..9d37e37786 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c +++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c @@ -283,7 +283,8 @@ void func_809AB77C(ObjGrassCarry* this, PlayState* play) { this->unk_19A--; - if ((this->actor.bgCheckFlags & (1 | 2 | 8)) || temp_v0 || (this->unk_19A <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || temp_v0 || + (this->unk_19A <= 0)) { func_809AAFE8(&this->actor.world.pos, play); func_809AAF9C(&this->actor.world.pos, this->unk_198, play); @@ -294,14 +295,14 @@ void func_809AB77C(ObjGrassCarry* this, PlayState* play) { this->actor.room = this->unk_190->actor.room; } - if (!(this->actor.bgCheckFlags & 0x20)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); } func_809AB428(this); return; } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { sp5C.y = this->actor.world.pos.y + this->actor.depthInWater; for (phi_s0 = 0, i = 0; i < 4; i++, phi_s0 += 0x4000) { @@ -326,7 +327,7 @@ void func_809AB77C(ObjGrassCarry* this, PlayState* play) { D_809ABBFC = D_809ABBFC >> 1; D_809ABC08 = D_809ABC08 >> 1; D_809ABC04 = D_809ABC04 >> 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); } diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c index 9d390b2ab0..6ea21bdd78 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -403,7 +403,7 @@ void func_80B15330(ObjHakaisi* this, PlayState* play) { this->dyna.actor.velocity.y += this->dyna.actor.gravity; Actor_UpdatePos(&this->dyna.actor); - if (this->dyna.actor.bgCheckFlags & 2) { + if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { func_80B14B6C(this, play, this->dyna.actor.world.pos, 40); func_80B14CF8(play, this->dyna.actor.world.pos, 100, 30, 10); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c index f3860b960e..4d5845d458 100644 --- a/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c +++ b/src/overlays/actors/ovl_Obj_Kendo_Kanban/z_obj_kendo_kanban.c @@ -382,7 +382,7 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // When on the ground, apply some friction. this->actor.velocity.x *= 0.8f; this->actor.velocity.z *= 0.8f; @@ -401,12 +401,12 @@ void ObjKendoKanban_HandlePhysics(ObjKendoKanban* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { // Upon touching the ground... Actor_PlaySfx(&this->actor, NA_SE_EV_WOODPLATE_BOUND); this->hasNewRootCornerPos = false; this->actor.velocity.y *= 0.5f; - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // When on the ground... this->numBounces++; this->hasNewRootCornerPos = false; diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 977ed92c89..11dba9ef00 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -279,7 +279,7 @@ void ObjKibako_Idle(ObjKibako* this, PlayState* play) { //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be //! player->currentMask, but in this case is garbage in the collider Player_PlaySfx((Player*)&this->actor, NA_SE_PL_PULL_UP_WOODBOX); - } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 19.0f)) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); @@ -384,13 +384,14 @@ void ObjKibako_Thrown(ObjKibako* this, PlayState* play) { if (this->timer > 0) { this->timer--; } - if ((this->actor.bgCheckFlags & 0xB) || (atHit) || (this->timer <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || atHit || + (this->timer <= 0)) { ObjKibako_AirBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); Actor_Kill(&this->actor); } else { - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { ObjKibako_WaterBreak(this, play); ObjKibako_SpawnCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c index e2b17e48f8..51eadfadca 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c @@ -351,7 +351,8 @@ void func_809A3E58(Actor* thisx, PlayState* play) { if (this->unk_160 != 0) { Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 15.0f, 30.0f, 0.0f, this->unk_160); if (((this->actionFunc == func_809A3A74) || (this->actionFunc == func_809A3D38)) && - (this->dyna.actor.bgCheckFlags & 1) && !DynaPoly_GetActor(&play->colCtx, this->dyna.actor.floorBgId)) { + (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + !DynaPoly_GetActor(&play->colCtx, this->dyna.actor.floorBgId)) { this->unk_160 = 0; } } diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c index fde4204a97..17d8592d2c 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -358,7 +358,7 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { func_80B38EFC(this, play); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_PULL_UP_SNOWBALL); func_80B39F60(this); - } else if ((this->actor.bgCheckFlags & 0x20) && + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && ((this->actor.shape.yOffset * this->actor.scale.y) < this->actor.depthInWater)) { func_80B3A498(this); } else if (sp38 && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0583FFBC)) { @@ -375,7 +375,8 @@ void func_80B39C9C(ObjSnowball2* this, PlayState* play) { if (this->unk_1AD == 0) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 15.0f, 0.0f, 0x44); - if ((this->actor.bgCheckFlags & 1) && (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { this->unk_1AD = 1; this->actor.flags &= ~ACTOR_FLAG_10; } @@ -460,7 +461,9 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { func_80B39B28(this, play); - if ((((this->actor.bgCheckFlags & 9) || sp38) && !(this->actor.bgCheckFlags & 0x20)) || (this->unk_1AC <= 0)) { + if ((((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) || sp38) && + !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) || + (this->unk_1AC <= 0)) { func_80B38E88(this, play); func_80B39108(this, play); func_80B39B5C(this, play); @@ -469,13 +472,13 @@ void func_80B3A13C(ObjSnowball2* this, PlayState* play) { } sp30 = false; - if (this->actor.bgCheckFlags & 0x60) { - if ((this->actor.bgCheckFlags & 0x40) || (this->actor.speed > 3.0f)) { + if (this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) || (this->actor.speed > 3.0f)) { if (this->actor.depthInWater < (1200.0f * this->actor.scale.y)) { func_80B39470(&this->actor, play); func_80B395EC(&this->actor, play); } - if (this->actor.bgCheckFlags & 0x40) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); } } else if ((((play->gameplayFrames % 16) == 0) || ((Rand_Next() >> 0x10) == 0)) && diff --git a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c index b8be7538b2..feb0652a4f 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -246,7 +246,7 @@ void func_809A48AC(ObjToge* this, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, D_809A4D0C[OBJTOGE_GET_4000(&this->actor)] * 30.0f, 0.0f, 0x81); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_198[this->unk_194]); this->unk_194 = sp30; if (this->unk_1B4 && (this->unk_194 == 0)) { diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index d9a0239994..cc4c7c8e8d 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -318,7 +318,7 @@ void ObjTokeidai_RotateOnMinuteChange(ObjTokeidai* this, s32 playSfx) { } void ObjTokeidai_ExteriorGear_Collapse(ObjTokeidai* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) || this->actor.world.pos.y < 0.0f) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.world.pos.y < 0.0f) { this->actionFunc = ObjTokeidai_DoNothing; } else { this->actor.shape.rot.x += 0x50; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 30c9fef03f..534fae4936 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -473,7 +473,7 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { (acHit && (this->cylinderCollider.info.acHitInfo->toucher.dmgFlags & 0x058BFFBC))) { typeData = &sPotTypeData[type]; this->unk_19B = 0; - if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 15.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.depthInWater > 15.0f)) { typeData->breakPot3(this, play); } else { typeData->breakPot1(this, play); @@ -494,7 +494,8 @@ void func_809289E4(ObjTsubo* this, PlayState* play) { if (!this->unk_195) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 15.0f, 15.0f, 0.0f, 0x44); - if ((this->actor.bgCheckFlags & 1) && (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId) == NULL)) { this->unk_195 = true; this->actor.flags &= ~ACTOR_FLAG_10; } @@ -568,7 +569,8 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { this->unk_194--; } typeData = &sPotTypeData[type]; - if ((this->actor.bgCheckFlags & 0xB) || atHit || (this->unk_194 <= 0)) { + if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) || atHit || + (this->unk_194 <= 0)) { typeData->breakPot1(this, play); if (type == OBJ_TSUBO_TYPE_3) { func_8092762C(this, play); @@ -582,7 +584,7 @@ void func_80928F18(ObjTsubo* this, PlayState* play) { } func_809291DC(this); - } else if (this->actor.bgCheckFlags & 0x40) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) { typeData->breakPot2(this, play); if (type == OBJ_TSUBO_TYPE_3) { func_8092762C(this, play);