mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Defines for Actor#bgCheckFlags
(#1126)
* First pass, tool assisted bgCheckFlags * Few manual bgCheckFlags * Run formatter * Remove fake bgCheckFlags 10-15 * Move existing documentation to the defines * Comment on `bgCheckFlags` and rephrase some doc * Name obvious flags, and some cleanup * Comment on flag 9 being wall-interaction-related (thanks engineer and fig) * Run formatter * `BGCHECKFLAG_7` -> `BGCHECKFLAG_GROUND_STRICT` * Touch up water-related bgcheckflags doc * `BGCHECKFLAG_9` -> `BGCHECKFLAG_PLAYER_WALL_INTERACT`
This commit is contained in:
parent
251d90301c
commit
67f294774b
121 changed files with 711 additions and 652 deletions
|
@ -129,6 +129,17 @@ typedef struct {
|
|||
#define ACTOR_FLAG_27 (1 << 27)
|
||||
#define ACTOR_FLAG_28 (1 << 28)
|
||||
|
||||
#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) // Strictly on ground (BGCHECKFLAG_GROUND has some leeway)
|
||||
#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
|
||||
|
||||
typedef struct Actor {
|
||||
/* 0x000 */ s16 id; // Actor ID
|
||||
/* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values
|
||||
|
@ -154,7 +165,7 @@ typedef struct Actor {
|
|||
/* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching
|
||||
/* 0x080 */ f32 floorHeight; // Y position of the floor polygon directly below the actor
|
||||
/* 0x084 */ f32 yDistToWater; // Distance to the surface of active waterbox. Negative value means above water
|
||||
/* 0x088 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags
|
||||
/* 0x088 */ u16 bgCheckFlags; // Flags indicating how the actor is interacting with collision
|
||||
/* 0x08A */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player
|
||||
/* 0x08C */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player in the x,y,z axis
|
||||
/* 0x090 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane
|
||||
|
@ -193,20 +204,6 @@ typedef enum {
|
|||
/* 1 */ FOOT_RIGHT
|
||||
} ActorFootIndex;
|
||||
|
||||
/*
|
||||
BgCheckFlags WIP documentation:
|
||||
& 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 : Unknown (only set/used by player so far)
|
||||
*/
|
||||
|
||||
/*
|
||||
colorFilterParams WIP documentation
|
||||
& 0x8000 : white
|
||||
|
|
|
@ -188,7 +188,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* lights, GlobalContext* globalCtx
|
|||
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;
|
||||
|
@ -1153,9 +1153,9 @@ s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s
|
|||
}
|
||||
|
||||
s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) {
|
||||
if ((actor->bgCheckFlags & 0x1) && (arg1 < -11.0f)) {
|
||||
actor->bgCheckFlags &= ~0x1;
|
||||
actor->bgCheckFlags |= 0x4;
|
||||
if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND) && (arg1 < -11.0f)) {
|
||||
actor->bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_GROUND_LEAVE;
|
||||
|
||||
if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) {
|
||||
actor->velocity.y = 0.0f;
|
||||
|
@ -1175,7 +1175,7 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
|
|||
|
||||
actor->floorHeight =
|
||||
BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &floorBgId, actor, arg2);
|
||||
actor->bgCheckFlags &= ~0x0086;
|
||||
actor->bgCheckFlags &= ~(BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_GROUND_LEAVE | BGCHECKFLAG_GROUND_STRICT);
|
||||
|
||||
if (actor->floorHeight <= BGCHECK_Y_MIN) {
|
||||
return func_8002E234(actor, BGCHECK_Y_MIN, arg3);
|
||||
|
@ -1185,12 +1185,12 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
|
|||
actor->floorBgId = floorBgId;
|
||||
|
||||
if (floorHeightDiff >= 0.0f) { // actor is on or below the ground
|
||||
actor->bgCheckFlags |= 0x80;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_GROUND_STRICT;
|
||||
|
||||
if (actor->bgCheckFlags & 0x10) {
|
||||
if (actor->bgCheckFlags & BGCHECKFLAG_CEILING) {
|
||||
if (floorBgId != sCurCeilingBgId) {
|
||||
if (floorHeightDiff > 15.0f) {
|
||||
actor->bgCheckFlags |= 0x100;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_CRUSHED;
|
||||
}
|
||||
} else {
|
||||
actor->world.pos.x = actor->prevPos.x;
|
||||
|
@ -1201,19 +1201,19 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
|
|||
actor->world.pos.y = actor->floorHeight;
|
||||
|
||||
if (actor->velocity.y <= 0.0f) {
|
||||
if (!(actor->bgCheckFlags & 0x1)) {
|
||||
actor->bgCheckFlags |= 0x2;
|
||||
if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_GROUND_TOUCH;
|
||||
} else if ((arg3 & 0x8) && (actor->gravity < 0.0f)) {
|
||||
actor->velocity.y = -4.0f;
|
||||
} else {
|
||||
actor->velocity.y = 0.0f;
|
||||
}
|
||||
|
||||
actor->bgCheckFlags |= 0x1;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_GROUND;
|
||||
func_80043334(&globalCtx->colCtx, actor, actor->floorBgId);
|
||||
}
|
||||
} else { // actor is above ground
|
||||
if ((actor->bgCheckFlags & 0x1) && (floorHeightDiff >= -11.0f)) {
|
||||
if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND) && (floorHeightDiff >= -11.0f)) {
|
||||
func_80043334(&globalCtx->colCtx, actor, actor->floorBgId);
|
||||
}
|
||||
|
||||
|
@ -1237,7 +1237,7 @@ void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallChe
|
|||
|
||||
sp74 = actor->world.pos.y - actor->prevPos.y;
|
||||
|
||||
if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) {
|
||||
if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
func_800433A4(&globalCtx->colCtx, actor->floorBgId, actor);
|
||||
}
|
||||
|
||||
|
@ -1251,10 +1251,10 @@ void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallChe
|
|||
wallPoly = actor->wallPoly;
|
||||
Math_Vec3f_Copy(&actor->world.pos, &sp64);
|
||||
actor->wallYaw = Math_Atan2S(wallPoly->normal.z, wallPoly->normal.x);
|
||||
actor->bgCheckFlags |= 8;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_WALL;
|
||||
actor->wallBgId = bgId;
|
||||
} else {
|
||||
actor->bgCheckFlags &= ~8;
|
||||
actor->bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1265,10 +1265,10 @@ void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallChe
|
|||
sp64.y = actor->prevPos.y + 10.0f;
|
||||
if (BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp58, &sp64, (ceilingCheckHeight + sp74) - 10.0f,
|
||||
&sCurCeilingPoly, &sCurCeilingBgId, actor)) {
|
||||
actor->bgCheckFlags |= 0x10;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_CEILING;
|
||||
actor->world.pos.y = (sp58 + sp74) - 10.0f;
|
||||
} else {
|
||||
actor->bgCheckFlags &= ~0x10;
|
||||
actor->bgCheckFlags &= ~BGCHECKFLAG_CEILING;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1280,10 +1280,10 @@ void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallChe
|
|||
&waterBoxYSurface, &waterBox)) {
|
||||
actor->yDistToWater = waterBoxYSurface - actor->world.pos.y;
|
||||
if (actor->yDistToWater < 0.0f) {
|
||||
actor->bgCheckFlags &= ~0x60;
|
||||
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
|
||||
} else {
|
||||
if (!(actor->bgCheckFlags & 0x20)) {
|
||||
actor->bgCheckFlags |= 0x40;
|
||||
if (!(actor->bgCheckFlags & BGCHECKFLAG_WATER)) {
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_WATER_TOUCH;
|
||||
if (!(flags & 0x40)) {
|
||||
ripplePos.x = actor->world.pos.x;
|
||||
ripplePos.y = waterBoxYSurface;
|
||||
|
@ -1293,10 +1293,10 @@ void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallChe
|
|||
EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 8);
|
||||
}
|
||||
}
|
||||
actor->bgCheckFlags |= 0x20;
|
||||
actor->bgCheckFlags |= BGCHECKFLAG_WATER;
|
||||
}
|
||||
} else {
|
||||
actor->bgCheckFlags &= ~0x60;
|
||||
actor->bgCheckFlags &= ~(BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH);
|
||||
actor->yDistToWater = BGCHECK_Y_MIN;
|
||||
}
|
||||
}
|
||||
|
@ -1699,7 +1699,7 @@ void Audio_PlayActorSound2(Actor* actor, u16 sfxId) {
|
|||
void func_8002F850(GlobalContext* globalCtx, Actor* actor) {
|
||||
s32 sfxId;
|
||||
|
||||
if (actor->bgCheckFlags & 0x20) {
|
||||
if (actor->bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
if (actor->yDistToWater < 20.0f) {
|
||||
sfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG;
|
||||
} else {
|
||||
|
@ -3420,7 +3420,7 @@ s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 dista
|
|||
|
||||
Math_Vec3f_Copy(&actor->world.pos, &prevActorPos);
|
||||
|
||||
ret = actor->bgCheckFlags & 1;
|
||||
ret = actor->bgCheckFlags & BGCHECKFLAG_GROUND;
|
||||
actor->bgCheckFlags = prevBgCheckFlags;
|
||||
|
||||
return ret;
|
||||
|
@ -3936,10 +3936,10 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) {
|
|||
case 0:
|
||||
if (Actor_HasParent(actor, globalCtx)) {
|
||||
actor->params = 1;
|
||||
} else if (!(actor->bgCheckFlags & 1)) {
|
||||
} else if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Actor_MoveForward(actor);
|
||||
Math_SmoothStepToF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f);
|
||||
} else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f)) {
|
||||
} else if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (actor->velocity.y < -4.0f)) {
|
||||
ret = 1;
|
||||
} else {
|
||||
actor->shape.rot.x = actor->shape.rot.z = 0;
|
||||
|
|
|
@ -278,18 +278,18 @@ void EnAObj_BoulderFragment(EnAObj* this, GlobalContext* globalCtx) {
|
|||
this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1;
|
||||
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1;
|
||||
|
||||
if (this->dyna.actor.speedXZ != 0.0f && this->dyna.actor.bgCheckFlags & 0x8) {
|
||||
if (this->dyna.actor.speedXZ != 0.0f && this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->dyna.actor.world.rot.y =
|
||||
this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y + this->dyna.actor.wallYaw - 0x8000;
|
||||
if (1) {}
|
||||
this->dyna.actor.bgCheckFlags &= ~0x8;
|
||||
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
|
||||
if (this->dyna.actor.bgCheckFlags & 0x2) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
if (this->dyna.actor.velocity.y < -8.0f) {
|
||||
this->dyna.actor.velocity.y *= -0.6f;
|
||||
this->dyna.actor.speedXZ *= 0.6f;
|
||||
this->dyna.actor.bgCheckFlags &= ~0x3;
|
||||
this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
} else {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
}
|
||||
|
|
|
@ -597,7 +597,7 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001)) {
|
||||
if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
EnItem00_SetupAction(this, func_8001E1C8);
|
||||
}
|
||||
}
|
||||
|
@ -618,14 +618,14 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
|
|||
&sEffectEnvColor);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
originalVelocity = this->actor.velocity.y;
|
||||
if (originalVelocity > -2.0f) {
|
||||
EnItem00_SetupAction(this, func_8001DFC8);
|
||||
this->actor.velocity.y = 0.0f;
|
||||
} else {
|
||||
this->actor.velocity.y = originalVelocity * -0.8f;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
|
|||
&sEffectEnvColor);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
EnItem00_SetupAction(this, func_8001DFC8);
|
||||
this->actor.shape.rot.z = 0;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
|
@ -746,7 +746,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.scale.y = this->actor.scale.x;
|
||||
|
||||
if (this->actor.gravity) {
|
||||
if (this->actor.bgCheckFlags & 0x0003) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
if (*temp != globalCtx->gameplayFrames) {
|
||||
D_80157D90 = globalCtx->gameplayFrames;
|
||||
D_80157D94[0] = 0;
|
||||
|
|
|
@ -436,7 +436,7 @@ void func_8008EDF0(Player* this) {
|
|||
}
|
||||
|
||||
void func_8008EE08(Player* this) {
|
||||
if ((this->actor.bgCheckFlags & 1) ||
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
|
||||
(this->stateFlags1 & (PLAYER_STATE1_21 | PLAYER_STATE1_23 | PLAYER_STATE1_27)) ||
|
||||
(!(this->stateFlags1 & (PLAYER_STATE1_18 | PLAYER_STATE1_19)) &&
|
||||
((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) {
|
||||
|
@ -619,7 +619,7 @@ s32 func_8008F2F8(GlobalContext* globalCtx) {
|
|||
var = 0;
|
||||
} else if ((this->unk_840 > 80) &&
|
||||
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater
|
||||
var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) ? 1 : 3;
|
||||
var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) ? 1 : 3;
|
||||
} else if (this->stateFlags1 & PLAYER_STATE1_27) { // Swimming
|
||||
var = 2;
|
||||
} else {
|
||||
|
|
|
@ -248,7 +248,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = func_808802D8;
|
||||
} else if (D_80881018 == 3) {
|
||||
D_80881018 = 4;
|
||||
player->actor.bgCheckFlags |= 0x100;
|
||||
player->actor.bgCheckFlags |= BGCHECKFLAG_CRUSHED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -204,11 +204,11 @@ void func_80882BDC(BgHakaZou* this, GlobalContext* globalCtx) {
|
|||
this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x;
|
||||
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z;
|
||||
|
||||
if (this->dyna.actor.bgCheckFlags & 2) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
if (this->dyna.actor.velocity.y < -8.0f) {
|
||||
this->dyna.actor.velocity.y *= -0.6f;
|
||||
this->dyna.actor.velocity.y = CLAMP_MAX(this->dyna.actor.velocity.y, 10.0f);
|
||||
this->dyna.actor.bgCheckFlags &= ~3;
|
||||
this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
this->dyna.actor.speedXZ = 2.0f;
|
||||
} else {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
|
|
|
@ -182,7 +182,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) {
|
|||
Actor_UpdateBgCheckInfo(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5);
|
||||
thisx->world.pos.y -= this->unk_164.y;
|
||||
thisx->prevPos.y -= this->unk_164.y;
|
||||
if (thisx->bgCheckFlags & 1) {
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->pieceFlags |= PIECE_FLAG_HIT_FLOOR;
|
||||
thisx->velocity.y = Rand_ZeroFloat(4.0f) + 2.0f;
|
||||
thisx->velocity.x = Rand_CenteredFloat(8.0f);
|
||||
|
|
|
@ -140,8 +140,8 @@ void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) {
|
|||
func_8002DF54(globalCtx, &this->dyna.actor, 8);
|
||||
this->dyna.actor.flags |= ACTOR_FLAG_4;
|
||||
this->actionFunc = BgHidanDalm_Shrink;
|
||||
this->dyna.actor.bgCheckFlags &= ~2;
|
||||
this->dyna.actor.bgCheckFlags &= ~8;
|
||||
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
this->dyna.actor.speedXZ = 10.0f;
|
||||
Flags_SetSwitch(globalCtx, this->switchFlag);
|
||||
func_8002F7DC(&GET_PLAYER(globalCtx)->actor, NA_SE_IT_HAMMER_HIT);
|
||||
|
|
|
@ -240,7 +240,7 @@ void func_8088B69C(BgHidanRock* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_8088B79C(BgHidanRock* this, GlobalContext* globalCtx) {
|
||||
this->timer--;
|
||||
if (this->dyna.actor.bgCheckFlags & 2) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
if (this->type == 0) {
|
||||
this->timer = 60;
|
||||
this->actionFunc = func_8088B5F4;
|
||||
|
|
|
@ -158,9 +158,9 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -150,8 +150,9 @@ void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx)
|
|||
|
||||
Actor_MoveForward(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85);
|
||||
if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) &&
|
||||
(this->collider.base.at->category == ACTORCAT_PLAYER))) {
|
||||
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) ||
|
||||
((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) &&
|
||||
(this->collider.base.at->category == ACTORCAT_PLAYER))) {
|
||||
vec.x = -Rand_ZeroOne() * this->actor.velocity.x;
|
||||
vec.y = -Rand_ZeroOne() * this->actor.velocity.y;
|
||||
vec.z = -Rand_ZeroOne() * this->actor.velocity.z;
|
||||
|
|
|
@ -245,7 +245,7 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, GlobalContext* globalCtx) {
|
|||
Actor* thisx = &this->dyna.actor;
|
||||
|
||||
Actor_MoveForward(thisx);
|
||||
if ((thisx->bgCheckFlags & 1) && (thisx->velocity.y < 0.0f)) {
|
||||
if ((thisx->bgCheckFlags & BGCHECKFLAG_GROUND) && (thisx->velocity.y < 0.0f)) {
|
||||
if (this->bounceCounter >= ARRAY_COUNT(bounceSpeed)) {
|
||||
BgMoriHashigo_SetupLadderRest(this);
|
||||
} else {
|
||||
|
|
|
@ -509,7 +509,8 @@ void func_808B5B6C(BgSpot16Bombstone* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (actor->bgCheckFlags & 8 || (actor->bgCheckFlags & 1 && actor->velocity.y < 0.0f)) {
|
||||
if ((actor->bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
((actor->bgCheckFlags & BGCHECKFLAG_GROUND) && actor->velocity.y < 0.0f)) {
|
||||
BgSpot16Bombstone_SpawnFragments(this, globalCtx);
|
||||
BgSpot16Bombstone_SpawnDust(this, globalCtx);
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN);
|
||||
|
|
|
@ -86,7 +86,7 @@ void BgSstFloor_Update(BgSstFloor* thisx, GlobalContext* globalCtx) {
|
|||
if (distFromRim > 350.0f) {
|
||||
distFromRim = 350.0f;
|
||||
}
|
||||
player->actor.bgCheckFlags &= ~1;
|
||||
player->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
player->actor.velocity.y = 9.0f * distFromRim * (1.0f / 350.0f);
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ void BgSstFloor_Update(BgSstFloor* thisx, GlobalContext* globalCtx) {
|
|||
if (distFromRim > 350.0f) {
|
||||
distFromRim = 350.0f;
|
||||
}
|
||||
item00->bgCheckFlags &= ~3;
|
||||
item00->bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
item00->velocity.y = 9.0f * distFromRim * (1.0f / 350.0f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -753,7 +753,7 @@ void BossDodongo_Roll(BossDodongo* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToF(&this->actor.world.pos.z, sp5C->z, 1.0f, this->unk_1E4, 0.0f);
|
||||
this->unk_1C4 += 2000;
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->unk_228 = 7700.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG);
|
||||
|
||||
|
|
|
@ -668,7 +668,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) {
|
|||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 2);
|
||||
if (this->timers[1] == 0) {
|
||||
osSyncPrintf("BGCHECKKKKKKKKKKKKKKKKKKKKKKK\n");
|
||||
if (this->actor.bgCheckFlags & 0x10) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) {
|
||||
this->fwork[BFD_CEILING_BOUNCE] = -18384.0f;
|
||||
this->timers[1] = 10;
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_EXPLOSION, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
|
||||
|
|
|
@ -4069,7 +4069,7 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
spBA = 4;
|
||||
}
|
||||
|
||||
if ((spBA != 0) || (this->actor.bgCheckFlags & 1)) {
|
||||
if ((spBA != 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
f32 sp58;
|
||||
f32 sp54;
|
||||
f32 phi_f20;
|
||||
|
|
|
@ -1021,7 +1021,7 @@ void func_808FFCFC(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
this->unk_311 = false;
|
||||
func_80900580(this, globalCtx);
|
||||
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
|
||||
} else if ((this->actor.bgCheckFlags & 8) && func_808FFA24(this, globalCtx)) {
|
||||
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && func_808FFA24(this, globalCtx)) {
|
||||
this->unk_311 = false;
|
||||
func_80900580(this, globalCtx);
|
||||
Audio_StopSfxById(NA_SE_EN_MGANON_UNARI);
|
||||
|
@ -1986,7 +1986,7 @@ void BossGanon2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.shape.rot = this->actor.world.rot;
|
||||
if (this->unk_335 != 0) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 60.0f, 60.0f, 100.0f, 5);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->actor.velocity.y < -5.0f) {
|
||||
func_80033E88(&this->actor, globalCtx, 5, 20);
|
||||
func_80078884(NA_SE_IT_BOMB_EXPLOSION);
|
||||
|
|
|
@ -882,7 +882,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachS(&this->actor.world.rot.y,
|
||||
Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(globalCtx)->actor), 2, 0x7D0);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actionState = 130;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
Animation_Change(&this->skelanime, &gGohmaInitialLandingAnim, 1.0f, 0.0f,
|
||||
|
@ -1431,7 +1431,7 @@ void BossGoma_FallJump(BossGoma* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(globalCtx)->actor), 2,
|
||||
0x7D0);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
BossGoma_SetupFloorLand(this);
|
||||
this->actor.velocity.y = 0.0f;
|
||||
BossGoma_PlayEffectsAndSfx(this, globalCtx, 0, 8);
|
||||
|
@ -1448,7 +1448,7 @@ void BossGoma_FallStruckDown(BossGoma* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(globalCtx)->actor), 3,
|
||||
0x7D0);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
BossGoma_SetupFloorLandStruckDown(this);
|
||||
this->actor.velocity.y = 0.0f;
|
||||
BossGoma_PlayEffectsAndSfx(this, globalCtx, 0, 8);
|
||||
|
@ -1635,11 +1635,11 @@ void BossGoma_FloorMain(BossGoma* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
BossGoma_SetupWallClimb(this);
|
||||
}
|
||||
|
||||
|
@ -1686,7 +1686,7 @@ void BossGoma_CeilingMoveToCenter(BossGoma* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachS(&this->actor.shape.rot.x, -0x8000, 3, 0x3E8);
|
||||
|
||||
// avoid walking into a wall?
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
angle = this->actor.shape.rot.y + 0x8000;
|
||||
|
||||
if (angle < this->actor.wallYaw) {
|
||||
|
|
|
@ -431,7 +431,7 @@ void BossSst_HeadIntro(BossSst* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Math_Vec3f_Copy(&sCameraAt, &player->actor.world.pos);
|
||||
if (player->actor.bgCheckFlags & 2) {
|
||||
if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
if (!this->ready) {
|
||||
sFloor->dyna.actor.params = BONGOFLOOR_HIT;
|
||||
this->ready = true;
|
||||
|
@ -1624,7 +1624,7 @@ void BossSst_HandPunch(BossSst* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.shape.rot.y);
|
||||
this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.shape.rot.y);
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
BossSst_HandSetupRetreat(this);
|
||||
} else if (this->colliderJntSph.base.atFlags & AT_HIT) {
|
||||
func_8002F7DC(&GET_PLAYER(globalCtx)->actor, NA_SE_PL_BODY_HIT);
|
||||
|
|
|
@ -1389,7 +1389,7 @@ void BossTw_HitByBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 4);
|
||||
this->actor.world.pos.y += 50.0f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
||||
|
@ -3539,7 +3539,7 @@ void BossTw_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
diff.y = this->groundBlastPos2.y - player->actor.world.pos.y;
|
||||
diff.z = this->groundBlastPos2.z - player->actor.world.pos.z;
|
||||
|
||||
if ((fabsf(diff.y) < 10.0f) && (player->actor.bgCheckFlags & 1) &&
|
||||
if ((fabsf(diff.y) < 10.0f) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
|
||||
(sqrtf(SQ(diff.x) + SQ(diff.z)) < (this->workf[UNK_F12] * 4600.0f)) && (sFreezeState == 0) &&
|
||||
(this->workf[UNK_F11] > 200.0f)) {
|
||||
sFreezeState = 1;
|
||||
|
@ -4057,7 +4057,7 @@ void BossTw_BlastFire(BossTw* this, GlobalContext* globalCtx) {
|
|||
yDiff = sKoumePtr->groundBlastPos2.y - player->actor.world.pos.y;
|
||||
zDiff = sKoumePtr->groundBlastPos2.z - player->actor.world.pos.z;
|
||||
|
||||
if (!player->isBurning && (player->actor.bgCheckFlags & 1) && (fabsf(yDiff) < 10.0f) &&
|
||||
if (!player->isBurning && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (fabsf(yDiff) < 10.0f) &&
|
||||
(sqrtf(SQ(xDiff) + SQ(zDiff)) < (sKoumePtr->workf[UNK_F13] * 4550.0f))) {
|
||||
s16 j;
|
||||
|
||||
|
@ -5330,7 +5330,7 @@ void BossTw_TwinrovaStun(BossTw* this, GlobalContext* globalCtx) {
|
|||
Animation_MorphToLoop(&this->skelAnime, &object_tw_Anim_035030, 0.0f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
|
||||
|
|
|
@ -1466,8 +1466,8 @@ void BossVa_BodyPhase4(BossVa* this, GlobalContext* globalCtx) {
|
|||
this->unk_1AC += 0xC31;
|
||||
this->unk_1A0 = (Math_CosS(this->unk_1AC) * 0.1f) + 1.0f;
|
||||
this->unk_1A4 = (Math_SinS(this->unk_1AC) * 0.05f) + 1.0f;
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
this->actor.world.rot.y = (s16)Rand_CenteredFloat(30 * (0x10000 / 360)) + this->actor.wallYaw;
|
||||
}
|
||||
|
||||
|
|
|
@ -718,7 +718,7 @@ void func_8098652C(DemoIm* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80986570(DemoIm* this, GlobalContext* globalCtx) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 7.0f) && (this->actor.bgCheckFlags & 1)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 7.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
u32 sfxId = SFX_FLAG;
|
||||
|
||||
sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
|
|
|
@ -596,7 +596,7 @@ void func_80997568(DoorShutter* this, GlobalContext* globalCtx) {
|
|||
void func_809975C0(DoorShutter* this, GlobalContext* globalCtx) {
|
||||
Actor_MoveForward(&this->dyna.actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
if (this->dyna.actor.bgCheckFlags & 1) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
DoorShutter_SetupAction(this, func_809976B8);
|
||||
if (!(gSaveContext.eventChkInf[7] & 1)) {
|
||||
BossGoma* parent = (BossGoma*)this->dyna.actor.parent;
|
||||
|
|
|
@ -192,7 +192,7 @@ s32 EnAm_CanMove(EnAm* this, GlobalContext* globalCtx, f32 distance, s16 yaw) {
|
|||
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
this->dyna.actor.world.pos = curPos;
|
||||
ret = this->dyna.actor.bgCheckFlags & 1;
|
||||
ret = this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND;
|
||||
|
||||
if (!ret && (this->dyna.actor.floorHeight >= (this->dyna.actor.home.pos.y - 20.0f))) {
|
||||
ret = true;
|
||||
|
@ -439,7 +439,7 @@ void EnAm_RotateToHome(EnAm* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->dyna.actor.world.rot.y, yawToHome, 1, 0x1F40, 0);
|
||||
this->dyna.actor.velocity.y = 12.0f;
|
||||
} else if (this->skelAnime.curFrame > 11.0f) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & 1)) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->skelAnime.curFrame = 11;
|
||||
} else {
|
||||
EnAm_SpawnEffects(this, globalCtx);
|
||||
|
@ -474,7 +474,7 @@ void EnAm_RotateToInit(EnAm* this, GlobalContext* globalCtx) {
|
|||
this->unk_258 = 2;
|
||||
this->dyna.actor.velocity.y = 12.0f;
|
||||
} else if (this->skelAnime.curFrame > 11.0f) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & 1)) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->skelAnime.curFrame = 11;
|
||||
} else {
|
||||
this->unk_258 = 1;
|
||||
|
@ -510,12 +510,12 @@ void EnAm_MoveToHome(EnAm* this, GlobalContext* globalCtx) {
|
|||
this->dyna.actor.velocity.y = 12.0f;
|
||||
this->dyna.actor.speedXZ = 6.0f;
|
||||
} else if (this->skelAnime.curFrame > 11.0f) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & 1)) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->skelAnime.curFrame = 11;
|
||||
} else {
|
||||
Math_SmoothStepToS(&this->dyna.actor.world.rot.y, yawToHome, 1, 0xBB8, 0);
|
||||
|
||||
if (this->dyna.actor.bgCheckFlags & 2) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->unk_258--;
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ void EnAm_MoveToHome(EnAm* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
// turn away from a wall if touching one
|
||||
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 8)) {
|
||||
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
this->dyna.actor.world.rot.y = this->dyna.actor.wallYaw;
|
||||
Actor_MoveForward(&this->dyna.actor);
|
||||
}
|
||||
|
@ -573,7 +573,7 @@ void EnAm_Cooldown(EnAm* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 1, 0x1F40, 0);
|
||||
this->dyna.actor.velocity.y = 12.0f;
|
||||
} else if (this->skelAnime.curFrame > 11.0f) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & 1)) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->skelAnime.curFrame = 11;
|
||||
} else {
|
||||
if (yawDiff < 3500) {
|
||||
|
@ -614,12 +614,12 @@ void EnAm_Lunge(EnAm* this, GlobalContext* globalCtx) {
|
|||
this->unk_264 = 1;
|
||||
this->hitCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED);
|
||||
} else if (this->skelAnime.curFrame > 11.0f) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & 1)) {
|
||||
if (!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->skelAnime.curFrame = 11;
|
||||
} else {
|
||||
Math_SmoothStepToS(&this->dyna.actor.world.rot.y, this->dyna.actor.yawTowardsPlayer, 1, 0x1770, 0);
|
||||
|
||||
if (this->dyna.actor.bgCheckFlags & 2) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->unk_258--;
|
||||
}
|
||||
|
||||
|
@ -638,11 +638,11 @@ void EnAm_Lunge(EnAm* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
// turn and move away from a wall if contact is made with one
|
||||
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 8)) {
|
||||
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
this->dyna.actor.world.rot.y =
|
||||
(this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw;
|
||||
Actor_MoveForward(&this->dyna.actor);
|
||||
this->dyna.actor.bgCheckFlags &= ~8;
|
||||
this->dyna.actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
@ -683,7 +683,8 @@ void EnAm_Statue(EnAm* this, GlobalContext* globalCtx) {
|
|||
moveDir = Math_Vec3f_Yaw(&this->dyna.actor.world.pos, &this->hurtCollider.base.oc->world.pos) - temp158f;
|
||||
}
|
||||
|
||||
if ((this->dyna.unk_150 == 0.0f) || (this->unk_258 == 0) || !(this->dyna.actor.bgCheckFlags & 1) ||
|
||||
if ((this->dyna.unk_150 == 0.0f) || (this->unk_258 == 0) ||
|
||||
!(this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
|
||||
!func_800435D8(globalCtx, &this->dyna, 0x14,
|
||||
(Math_SinS(this->unk_258) * (this->dyna.unk_150 * 0.5f)) + 40.0f, 0xA) ||
|
||||
((this->hurtCollider.base.ocFlags1 & OC1_HIT) && (ABS(moveDir) <= 0x2000))) {
|
||||
|
@ -698,7 +699,7 @@ void EnAm_Statue(EnAm* this, GlobalContext* globalCtx) {
|
|||
this->dyna.actor.speedXZ = Math_SinS(this->unk_258) * (this->dyna.unk_150 * 0.5f);
|
||||
}
|
||||
|
||||
if (this->dyna.actor.bgCheckFlags & 2) {
|
||||
if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
|
||||
}
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ void EnAnubice_Die(EnAnubice* this, GlobalContext* globalCtx) {
|
|||
Actor_SetColorFilter(&this->actor, 0x4000, 128, 0, 8);
|
||||
EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &rotatedFireEffectPos, 100, 0, 0, -1);
|
||||
|
||||
if ((this->animLastFrame <= curFrame) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((this->animLastFrame <= curFrame) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Math_ApproachF(&this->actor.shape.yOffset, -4230.0f, 0.5f, 300.0f);
|
||||
if (this->actor.shape.yOffset < -2000.0f) {
|
||||
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0);
|
||||
|
|
|
@ -205,7 +205,7 @@ void func_809B5670(EnAttackNiw* this, GlobalContext* globalCtx) {
|
|||
Actor_SetFocus(&this->actor, this->unk_2E4);
|
||||
Actor_GetScreenPos(globalCtx, &this->actor, &sp4E, &sp4C);
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->unk_2D4 = this->actor.yawTowardsPlayer;
|
||||
this->unk_2D0 = this->actor.world.rot.x - 3000.0f;
|
||||
this->unk_2DC = 0.0f;
|
||||
|
@ -220,7 +220,7 @@ void func_809B5670(EnAttackNiw* this, GlobalContext* globalCtx) {
|
|||
} else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(sp34.x - this->actor.world.pos.x) < 50.0f) &&
|
||||
(fabsf(sp34.y - this->actor.world.pos.y) < 50.0f) &&
|
||||
(fabsf(sp34.z - this->actor.world.pos.z) < 50.0f)) ||
|
||||
(this->actor.bgCheckFlags & 1)) {
|
||||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
|
||||
this->unk_2D4 = this->actor.yawTowardsPlayer;
|
||||
this->unk_2D0 = this->actor.world.rot.x - 2000.0f;
|
||||
|
@ -246,7 +246,7 @@ void func_809B59B0(EnAttackNiw* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->unk_25A == 0) {
|
||||
this->unk_25A = 3;
|
||||
this->actor.velocity.y = 3.5f;
|
||||
|
@ -268,13 +268,13 @@ void func_809B59B0(EnAttackNiw* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->unk_2DC, 10000.0f, 1.0f, 1000.0f);
|
||||
Math_ApproachF(&this->actor.speedXZ, this->unk_2E0, 0.9f, 1.0f);
|
||||
if ((this->actor.gravity == -2.0f) && (this->unk_262 == 0) &&
|
||||
((this->actor.bgCheckFlags & 8) || (this->unk_25C == 0))) {
|
||||
((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_25C == 0))) {
|
||||
this->unk_2E0 = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
this->unk_2DC = 0.0f;
|
||||
this->unk_2D0 = this->actor.world.rot.x - 5000.0f;
|
||||
this->actionFunc = func_809B5C18;
|
||||
} else if (this->actor.bgCheckFlags & 1) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
func_809B5268(this, globalCtx, 5);
|
||||
} else {
|
||||
func_809B5268(this, globalCtx, 2);
|
||||
|
@ -340,7 +340,7 @@ void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 0x20) && (this->actionFunc != func_809B5C18)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) {
|
||||
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
|
||||
sp30.y += this->actor.yDistToWater;
|
||||
EffectSsGSplash_Spawn(globalCtx, &sp30, 0, 0, 0, 0x190);
|
||||
|
|
|
@ -203,7 +203,7 @@ void EnBa_SetupFallAsBlob(EnBa* this) {
|
|||
* Action function of the pink fleshy blobs that spawn and fall to the floor when a tentacle dies
|
||||
*/
|
||||
void EnBa_FallAsBlob(EnBa* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.scale.y -= 0.001f;
|
||||
this->actor.scale.x += 0.0005f;
|
||||
this->actor.scale.z += 0.0005f;
|
||||
|
|
|
@ -507,7 +507,7 @@ void EnBb_SetupDamage(EnBb* this) {
|
|||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DAMAGE);
|
||||
if (this->actor.params > ENBB_GREEN) {
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
if ((this->actor.bgCheckFlags & 8) == 0) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
this->actor.speedXZ = -7.0f;
|
||||
}
|
||||
this->actor.shape.yOffset = 1500.0f;
|
||||
|
@ -626,7 +626,7 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
thisYawToWall = this->actor.wallYaw - this->actor.world.rot.y;
|
||||
moveYawToWall = this->actor.wallYaw - this->vMoveAngleY;
|
||||
if ((this->targetActor == NULL) && (this->actor.bgCheckFlags & 8) &&
|
||||
if ((this->targetActor == NULL) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
(ABS(thisYawToWall) > 0x4000 || ABS(moveYawToWall) > 0x4000)) {
|
||||
this->vMoveAngleY = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000;
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0xBB8, 0);
|
||||
|
@ -671,7 +671,7 @@ void EnBb_SetupDown(EnBb* this) {
|
|||
this->action = BB_DOWN;
|
||||
this->timer = 200;
|
||||
this->actor.colorFilterTimer = 0;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->actor.speedXZ = 3.0f;
|
||||
this->flameScaleX = 0.0f;
|
||||
this->flameScaleY = 0.0f;
|
||||
|
@ -684,13 +684,13 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) {
|
|||
s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw;
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (ABS(yawDiff) > 0x4000) {
|
||||
this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 3) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
if (this->actor.params == ENBB_RED) {
|
||||
s32 floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
|
||||
|
@ -710,7 +710,7 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) {
|
|||
} else {
|
||||
this->actor.velocity.y = 10.0f;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, false);
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, -this->actor.yawTowardsPlayer, 1, 0xBB8, 0);
|
||||
}
|
||||
|
@ -753,7 +753,7 @@ void EnBb_SetupRed(GlobalContext* globalCtx, EnBb* this) {
|
|||
this->actionState = BBRED_ATTACK;
|
||||
this->timer = 0;
|
||||
this->moveMode = BBMOVE_NORMAL;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
} else {
|
||||
this->actor.colChkInfo.health = 4;
|
||||
this->timer = 0;
|
||||
|
@ -762,7 +762,7 @@ void EnBb_SetupRed(GlobalContext* globalCtx, EnBb* this) {
|
|||
this->actor.world.pos.y -= 80.0f;
|
||||
this->actor.home.pos = this->actor.world.pos;
|
||||
this->actor.velocity.y = this->actor.gravity = this->actor.speedXZ = 0.0f;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
}
|
||||
this->action = BB_RED;
|
||||
|
@ -789,7 +789,7 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) {
|
|||
this->actor.velocity.y = 18.0f;
|
||||
this->moveMode = BBMOVE_NOCLIP;
|
||||
this->timer = 7;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->actionState++;
|
||||
EnBb_SpawnFlameTrail(globalCtx, this, false);
|
||||
}
|
||||
|
@ -802,15 +802,15 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) {
|
|||
this->bobPhase += Rand_ZeroOne();
|
||||
Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->flameScaleX, 100.0f, 1.0f, 10.0f, 0.0f);
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
yawDiff = this->actor.world.rot.y - this->actor.wallYaw;
|
||||
if (ABS(yawDiff) > 0x4000) {
|
||||
this->actor.world.rot.y =
|
||||
this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
if ((floorType == 2) || (floorType == 3) || (floorType == 9)) {
|
||||
this->moveMode = BBMOVE_HIDDEN;
|
||||
|
@ -824,7 +824,7 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
this->actor.world.rot.y = Math_SinF(this->bobPhase) * 65535.0f;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
}
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
if (Actor_GetCollidedExplosive(globalCtx, &this->collider.base) != NULL) {
|
||||
|
@ -1091,20 +1091,20 @@ void EnBb_SetupStunned(EnBb* this) {
|
|||
Actor_SetColorFilter(&this->actor, 0, 0xB4, 0, 0x50);
|
||||
break;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
EnBb_SetupAction(this, EnBb_Stunned);
|
||||
}
|
||||
|
||||
void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) {
|
||||
s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw;
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (ABS(yawDiff) > 0x4000) {
|
||||
this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
if (this->actor.velocity.y < -14.0f) {
|
||||
this->actor.velocity.y *= -0.4f;
|
||||
|
|
|
@ -316,7 +316,7 @@ void EnBili_UpdateFloating(EnBili* this) {
|
|||
this->actor.world.pos.y = this->actor.home.pos.y + (sinf(this->timer * (M_PI / 16)) * 3.0f);
|
||||
|
||||
// Turn around if touching wall
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.world.rot.y = this->actor.wallYaw;
|
||||
}
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ void EnBili_Stunned(EnBili* this, GlobalContext* globalCtx) {
|
|||
this->timer--;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ void EnBili_Frozen(EnBili* this, GlobalContext* globalCtx) {
|
|||
this->actor.gravity = -1.0f;
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
|
||||
this->actor.colorFilterTimer = 0;
|
||||
EnBili_SetupDie(this);
|
||||
} else {
|
||||
|
|
|
@ -126,29 +126,29 @@ void EnBom_Move(EnBom* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) {
|
||||
if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING)) {
|
||||
this->actor.velocity.y = -this->actor.velocity.y;
|
||||
}
|
||||
|
||||
// rebound bomb off the wall it hits
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
|
||||
if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) {
|
||||
this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_BOUND);
|
||||
Actor_MoveForward(&this->actor);
|
||||
this->actor.speedXZ *= 0.7f;
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f);
|
||||
} else {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
|
||||
if ((this->actor.bgCheckFlags & 2) && (this->actor.velocity.y < -3.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -3.0f)) {
|
||||
func_8002F850(globalCtx, &this->actor);
|
||||
this->actor.velocity.y *= -0.3f;
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
} else if (this->timer >= 4) {
|
||||
func_8002F580(&this->actor, globalCtx);
|
||||
}
|
||||
|
@ -348,8 +348,8 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
if (thisx->bgCheckFlags & 0x40) {
|
||||
thisx->bgCheckFlags &= ~0x40;
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_BOMB_DROP_WATER);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -455,22 +455,22 @@ void EnBomChu_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->actor.yDistToWater = waterY - this->actor.world.pos.y;
|
||||
|
||||
if (this->actor.yDistToWater < 0.0f) {
|
||||
if (this->actor.bgCheckFlags & 0x20) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
EnBomChu_SpawnRipples(this, globalCtx, waterY);
|
||||
}
|
||||
|
||||
this->actor.bgCheckFlags &= ~0x20;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER;
|
||||
} else {
|
||||
if (!(this->actor.bgCheckFlags & 0x20) && (this->timer != 120)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->timer != 120)) {
|
||||
EnBomChu_SpawnRipples(this, globalCtx, waterY);
|
||||
} else {
|
||||
EffectSsBubble_Spawn(globalCtx, &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.yDistToWater = BGCHECK_Y_MIN;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -235,11 +235,11 @@ void EnBombf_Move(EnBombf* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->flowerBombScale = 1.0f;
|
||||
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.025f, 0.0f);
|
||||
} else {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f);
|
||||
if ((this->actor.bgCheckFlags & 2) && (this->actor.velocity.y < -6.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -6.0f)) {
|
||||
func_8002F850(globalCtx, &this->actor);
|
||||
this->actor.velocity.y *= -0.5f;
|
||||
} else if (this->timer >= 4) {
|
||||
|
@ -345,12 +345,12 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
if (thisx->params == BOMBFLOWER_BODY) {
|
||||
|
||||
if ((thisx->velocity.y > 0.0f) && (thisx->bgCheckFlags & 0x10)) {
|
||||
if ((thisx->velocity.y > 0.0f) && (thisx->bgCheckFlags & BGCHECKFLAG_CEILING)) {
|
||||
thisx->velocity.y = -thisx->velocity.y;
|
||||
}
|
||||
|
||||
// rebound bomb off the wall it hits
|
||||
if ((thisx->speedXZ != 0.0f) && (thisx->bgCheckFlags & 8)) {
|
||||
if ((thisx->speedXZ != 0.0f) && (thisx->bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
|
||||
if (ABS((s16)(thisx->wallYaw - thisx->world.rot.y)) > 0x4000) {
|
||||
if (1) {}
|
||||
|
@ -362,7 +362,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F);
|
||||
DREG(6) = 0;
|
||||
thisx->speedXZ *= 0.7f;
|
||||
thisx->bgCheckFlags &= ~8;
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
|
||||
if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) &&
|
||||
|
@ -457,8 +457,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_Kill(thisx);
|
||||
return;
|
||||
}
|
||||
if (thisx->bgCheckFlags & 0x40) {
|
||||
thisx->bgCheckFlags &= ~0x40;
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
|
||||
Audio_PlayActorSound2(thisx, NA_SE_EV_BOMB_DROP_WATER);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
|
|||
// Otherwise if it's a Skulltula Token, just set flags so he collides with it to collect it.
|
||||
if (target->id == ACTOR_EN_ITEM00) {
|
||||
target->gravity = -0.9f;
|
||||
target->bgCheckFlags &= ~0x03;
|
||||
target->bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
} else {
|
||||
target->flags &= ~ACTOR_FLAG_13;
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ void EnBox_Fall(EnBox* this, GlobalContext* globalCtx) {
|
|||
|
||||
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;
|
||||
|
|
|
@ -253,7 +253,7 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) {
|
|||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AWA_BOUND);
|
||||
this->graphicRotSpeed = 128.0f;
|
||||
this->graphicEccentricity = 0.48f;
|
||||
} else if (this->actor.bgCheckFlags & 0x20 && sp54.y < 0.0f) {
|
||||
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && sp54.y < 0.0f) {
|
||||
sp60.x = sp60.z = 0.0f;
|
||||
sp60.y = 1.0f;
|
||||
EnBubble_Vec3fNormalizedRelfect(&sp54, &sp60, &sp54);
|
||||
|
|
|
@ -278,7 +278,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
this->unk_222 = (Rand_ZeroOne() * 200.0f) + 200.0f;
|
||||
}
|
||||
} else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
|
||||
} else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
if (this->unk_236 != this->actor.wallYaw) {
|
||||
sp64 = 1;
|
||||
this->unk_236 = this->actor.wallYaw;
|
||||
|
@ -288,7 +288,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) {
|
|||
} else {
|
||||
this->unk_238 = -0x4000;
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
this->unk_222 = (Rand_ZeroOne() * 20.0f) + 160.0f;
|
||||
} else {
|
||||
if ((s16)(this->actor.yawTowardsPlayer - this->unk_236) >= 0) {
|
||||
|
@ -362,7 +362,8 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case 1:
|
||||
if (((sp64 == 0) && !(this->actor.bgCheckFlags & 8)) || Actor_IsFacingPlayer(&this->actor, 0x1C70)) {
|
||||
if (((sp64 == 0) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) ||
|
||||
Actor_IsFacingPlayer(&this->actor, 0x1C70)) {
|
||||
if (Actor_IsFacingPlayer(&this->actor, 0x1C70)) {
|
||||
this->unk_238 = -this->unk_238;
|
||||
}
|
||||
|
@ -451,7 +452,7 @@ void func_809CF984(EnBw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->actor.bgCheckFlags & 3) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
floorPolyType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
if ((floorPolyType == 2) || (floorPolyType == 3) || (floorPolyType == 9)) {
|
||||
Actor_Kill(&this->actor);
|
||||
|
@ -483,14 +484,14 @@ void func_809CFC4C(EnBw* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->actor.shape.rot.z, 0x7FFF, 1, 0xFA0, 0);
|
||||
Math_SmoothStepToF(&this->unk_248, 0.0f, 1.0f, 0.05f, 0.0f);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->actor.bgCheckFlags & 3) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
if ((globalCtx->gameplayFrames % 0x80) == 0) {
|
||||
this->unk_25C = (Rand_ZeroOne() * 0.25f) + 0.7f;
|
||||
}
|
||||
this->unk_221 = 4;
|
||||
this->unk_258 += this->unk_25C;
|
||||
Math_SmoothStepToF(&this->unk_260, 0.075f, 1.0f, 0.005f, 0.0f);
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
}
|
||||
|
@ -532,7 +533,7 @@ void func_809CFF10(EnBw* this) {
|
|||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.velocity.y = 11.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLEWALK_REVERSE);
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
EnBw_SetupAction(this, func_809CFF98);
|
||||
}
|
||||
|
||||
|
@ -540,7 +541,7 @@ void func_809CFF98(EnBw* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->actor.shape.rot.z, 0, 1, 0xFA0, 0);
|
||||
Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->actor.bgCheckFlags & 3) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false);
|
||||
this->unk_222 = 0xBB8;
|
||||
this->unk_250 = 0.0f;
|
||||
|
@ -675,7 +676,7 @@ void func_809D0424(EnBw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_809D0584(EnBw* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.bgCheckFlags & 0x10) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->unk_230 = 0;
|
||||
this->actor.scale.y -= 0.009f;
|
||||
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false);
|
||||
|
@ -724,7 +725,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xzDistToPlayer <= 400.0f) &&
|
||||
(this->actor.bgCheckFlags & 1)) {
|
||||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
if (this->unk_220 == 5) {
|
||||
this->unk_23C = 0;
|
||||
func_809CFF10(this);
|
||||
|
|
|
@ -526,8 +526,8 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_BREATH - SFX_FLAG);
|
||||
|
||||
// Check if the Arwing has hit the ground.
|
||||
if (this->actor.bgCheckFlags & 9) {
|
||||
// Check if the Arwing has hit the ground or a wall.
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) {
|
||||
this->shouldExplode = true;
|
||||
|
||||
if (this->drawMode != CLEAR_TAG_DRAW_MODE_ARWING) {
|
||||
|
@ -557,8 +557,9 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 80.0f, 100.0f, 5);
|
||||
|
||||
// Check if the laser has hit a target, timed out, or hit the ground.
|
||||
if (this->actor.bgCheckFlags & 9 || hasAtHit || this->timers[CLEAR_TAG_TIMER_LASER_DEATH] == 0) {
|
||||
// Check if the laser has hit a target, timed out, or hit the ground or a wall.
|
||||
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) || hasAtHit ||
|
||||
this->timers[CLEAR_TAG_TIMER_LASER_DEATH] == 0) {
|
||||
// Kill the laser.
|
||||
Actor_Kill(&this->actor);
|
||||
// Player laser sound effect if the laser did not time out.
|
||||
|
|
|
@ -151,7 +151,7 @@ void EnCrow_SetupDamaged(EnCrow* this, GlobalContext* globalCtx) {
|
|||
Animation_Change(&this->skelAnime, &gGuayFlyAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f);
|
||||
scale = this->actor.scale.x * 100.0f;
|
||||
this->actor.world.pos.y += 20.0f * scale;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->actor.shape.yOffset = 0.0f;
|
||||
this->actor.targetArrowOffset = 0.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_DEAD);
|
||||
|
@ -234,7 +234,7 @@ void EnCrow_FlyIdle(EnCrow* this, GlobalContext* globalCtx) {
|
|||
skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f);
|
||||
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->aimRotY = this->actor.wallYaw;
|
||||
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
|
||||
this->aimRotY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
|
||||
|
@ -269,7 +269,7 @@ void EnCrow_FlyIdle(EnCrow* this, GlobalContext* globalCtx) {
|
|||
this->aimRotX = CLAMP(this->aimRotX, -0x1000, 0x1000);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, -0x100, 0x400);
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,8 @@ void EnCrow_DiveAttack(EnCrow* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) ||
|
||||
(this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 9) ||
|
||||
(this->collider.base.atFlags & AT_HIT) ||
|
||||
(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) ||
|
||||
(player->stateFlags1 & PLAYER_STATE1_23) || (this->actor.yDistToWater > -40.0f)) {
|
||||
if (this->collider.base.atFlags & AT_HIT) {
|
||||
this->collider.base.atFlags &= ~AT_HIT;
|
||||
|
@ -333,7 +334,7 @@ void EnCrow_Damaged(EnCrow* this, GlobalContext* globalCtx) {
|
|||
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)) {
|
||||
EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &sZeroVecAccel, &sZeroVecAccel,
|
||||
this->actor.scale.x * 10000.0f, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, 1);
|
||||
EnCrow_SetupDie(this);
|
||||
|
@ -366,7 +367,7 @@ void EnCrow_Die(EnCrow* this, GlobalContext* globalCtx) {
|
|||
void EnCrow_TurnAway(EnCrow* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->aimRotY = this->actor.wallYaw;
|
||||
} else {
|
||||
this->aimRotY = this->actor.yawTowardsPlayer + 0x8000;
|
||||
|
|
|
@ -951,7 +951,8 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, GlobalContext* globalCtx) {
|
|||
EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, this->size * 3.0f, 0, this->size * 12.0f,
|
||||
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.x = this->actor.scale.y = this->actor.scale.z = 0.0f;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
|
@ -959,7 +960,7 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, GlobalContext* globalCtx) {
|
|||
this->size * 5.0f, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
this->timer = 1;
|
||||
}
|
||||
|
|
|
@ -359,9 +359,9 @@ void EnDekunuts_Run(EnDekunuts* this, GlobalContext* globalCtx) {
|
|||
|
||||
Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f);
|
||||
if (Math_SmoothStepToS(&this->actor.world.rot.y, this->runDirection, 1, 0xE38, 0xB6) == 0) {
|
||||
if (this->actor.bgCheckFlags & 0x20) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
this->runDirection = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->runDirection = this->actor.wallYaw;
|
||||
} else if (this->runAwayCount == 0) {
|
||||
diffRotInit = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
|
||||
|
|
|
@ -400,7 +400,7 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnDh_SetupDamage(EnDh* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_003D6C, -6.0f);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = -1.0f;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_DAMAGE);
|
||||
|
|
|
@ -98,7 +98,7 @@ void EnDntJiji_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDntJiji_SetFlower(EnDntJiji* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->flowerPos = this->actor.world.pos;
|
||||
this->actionFunc = EnDntJiji_SetupWait;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ void EnDntJiji_Walk(EnDntJiji* this, GlobalContext* globalCtx) {
|
|||
this->sfxTimer = 5;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK);
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 8) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.velocity.y = 9.0f;
|
||||
this->actor.speedXZ = 3.0f;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ void EnDntJiji_Return(EnDntJiji* this, GlobalContext* globalCtx) {
|
|||
dz = this->flowerPos.z - this->actor.world.pos.z;
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 1, 0xBB8, 0);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
if ((this->actor.bgCheckFlags & 8) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.velocity.y = 9.0f;
|
||||
this->actor.speedXZ = 3.0f;
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ void EnDntNomal_WaitForObject(EnDntNomal* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDntNomal_SetFlower(EnDntNomal* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->flowerPos = this->actor.world.pos;
|
||||
if (this->type == ENDNTNOMAL_TARGET) {
|
||||
this->actionFunc = EnDntNomal_SetupTargetWait;
|
||||
|
@ -542,7 +542,7 @@ void EnDntNomal_StageCelebrate(EnDntNomal* this, GlobalContext* globalCtx) {
|
|||
} else if ((this->timer5 & 3) == 0) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK);
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 8) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.velocity.y = 7.5f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ s32 func_809F68B0(EnDodojr* this, GlobalContext* globalCtx) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
this->dustPos = this->actor.world.pos;
|
||||
func_809F6510(this, globalCtx, 10);
|
||||
|
@ -450,7 +450,7 @@ void func_809F758C(EnDodojr* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = func_809F799C;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_DOWN);
|
||||
func_809F6BBC(this);
|
||||
this->actionFunc = func_809F7A00;
|
||||
|
|
|
@ -770,7 +770,7 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actionFunc(this, globalCtx);
|
||||
Actor_MoveForward(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D);
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -429,7 +429,7 @@ void EnEiyer_Glide(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
Math_StepToF(&this->actor.speedXZ, 1.5f, 0.03f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->targetYaw = this->actor.wallYaw;
|
||||
}
|
||||
|
||||
|
@ -477,7 +477,7 @@ void EnEiyer_DiveAttack(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_Update(&this->skelanime);
|
||||
this->actor.speedXZ *= 1.1f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & 1) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
EnEiyer_SetupLand(this);
|
||||
}
|
||||
|
||||
|
@ -494,11 +494,11 @@ void EnEiyer_Land(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
Math_StepToF(&this->actor.speedXZ, 7.0f, 1.0f);
|
||||
|
||||
if (this->timer == -1) {
|
||||
if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & 1) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->timer = 10;
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_SINK);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
EffectSsGSplash_Spawn(globalCtx, &this->actor.world.pos, NULL, NULL, 1, 700);
|
||||
}
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ void EnEiyer_Hurt(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->basePos.y, this->actor.floorHeight + 80.0f + 5.0f, 0.5f, this->actor.speedXZ);
|
||||
this->actor.world.pos.y = this->basePos.y - 5.0f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->targetYaw = this->actor.wallYaw;
|
||||
} else {
|
||||
this->targetYaw = this->actor.yawTowardsPlayer + 0x8000;
|
||||
|
@ -561,7 +561,7 @@ void EnEiyer_Die(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.world.rot.x = -this->actor.shape.rot.x;
|
||||
|
||||
if (this->timer == 0 || this->actor.bgCheckFlags & 0x10) {
|
||||
if (this->timer == 0 || this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) {
|
||||
EnEiyer_SetupDead(this);
|
||||
}
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ void EnEiyer_Stunned(EnEiyer* this, GlobalContext* globalCtx) {
|
|||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_EIER_FLUTTER);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
}
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt
|
|||
while ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT00) {
|
||||
if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) ||
|
||||
!(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & PLAYER_STATE1_27)) {
|
||||
!(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (player->stateFlags1 & PLAYER_STATE1_27)) {
|
||||
|
||||
this->fieldSpawnTimer = 60;
|
||||
break;
|
||||
|
|
|
@ -213,7 +213,7 @@ void EnExRuppy_DropIntoWater(EnExRuppy* this, GlobalContext* globalCtx) {
|
|||
func_80078884(NA_SE_EV_RAINBOW_SHOWER - SFX_FLAG);
|
||||
divingGame = (EnDivingGame*)this->actor.parent;
|
||||
if ((divingGame != NULL) && (divingGame->actor.update != NULL) &&
|
||||
((divingGame->unk_296 == 0) || (this->actor.bgCheckFlags & 0x20) || (this->timer == 0))) {
|
||||
((divingGame->unk_296 == 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) || (this->timer == 0))) {
|
||||
this->invisible = true;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f;
|
||||
|
@ -249,7 +249,7 @@ void EnExRuppy_Sink(EnExRuppy* this, GlobalContext* globalCtx) {
|
|||
Vec3f pos;
|
||||
s32 pad;
|
||||
|
||||
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actor.yDistToWater > 15.0f)) {
|
||||
pos = this->actor.world.pos;
|
||||
pos.y += this->actor.yDistToWater;
|
||||
this->actor.velocity.y = -1.0f;
|
||||
|
|
|
@ -501,7 +501,7 @@ void EnFd_SpinAndGrow(EnFd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnFd_JumpToGround(EnFd* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.bgCheckFlags & 1) && !(this->actor.velocity.y > 0.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.velocity.y > 0.0f)) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
|
|
|
@ -151,10 +151,10 @@ void func_80A0E70C(EnFdFire* this, GlobalContext* globalCtx) {
|
|||
targetPos.x += this->spawnRadius * Math_SinS(this->actor.world.rot.y);
|
||||
targetPos.z += this->spawnRadius * Math_CosS(this->actor.world.rot.y);
|
||||
EnFdFire_UpdatePos(this, &targetPos);
|
||||
if (this->actor.bgCheckFlags & 1 && (!(this->actor.velocity.y > 0.0f))) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (!(this->actor.velocity.y > 0.0f))) {
|
||||
this->actor.velocity = velocity;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
if (this->actor.params & 0x8000) {
|
||||
this->deathTimer = 200;
|
||||
this->actionFunc = EnFdFire_DanceTowardsPlayer;
|
||||
|
|
|
@ -302,7 +302,7 @@ void EnFhgFire_LightningShock(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 1);
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
@ -588,7 +588,8 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
osSyncPrintf("fly_mode %d\n", bossGnd->flyMode);
|
||||
if (this->work[FHGFIRE_FX_TIMER] == 0) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 7);
|
||||
if ((this->actor.bgCheckFlags & 0x19) || killMode) {
|
||||
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) ||
|
||||
killMode) {
|
||||
u8 lightBallColor2 = FHGFLASH_LIGHTBALL_GREEN;
|
||||
s16 i4;
|
||||
Vec3f sp6C;
|
||||
|
|
|
@ -192,7 +192,7 @@ void EnFireRock_Fall(EnFireRock* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 1) && (this->timer == 0)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->timer == 0)) {
|
||||
switch (this->type) {
|
||||
case FIRE_ROCK_SPAWNED_FALLING1:
|
||||
case FIRE_ROCK_SPAWNED_FALLING2:
|
||||
|
|
|
@ -398,15 +398,16 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
this->targetPitch = 0x2154;
|
||||
}
|
||||
} else {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->targetPitch = 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->targetPitch = 0x2154;
|
||||
}
|
||||
}
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 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);
|
||||
}
|
||||
if ((this->timer == 0) && (this->actor.xzDistToPlayer < 200.0f) &&
|
||||
|
@ -431,7 +432,7 @@ void EnFirefly_Fall(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 1) || (this->timer == 0)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->timer == 0)) {
|
||||
EnFirefly_SetupDie(this);
|
||||
}
|
||||
}
|
||||
|
@ -459,7 +460,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
this->timer--;
|
||||
}
|
||||
Math_StepToF(&this->actor.speedXZ, 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->targetPitch, 0x100);
|
||||
} else if (Actor_IsFacingPlayer(&this->actor, 0x2800)) {
|
||||
|
@ -478,10 +479,10 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
if (this->actor.xzDistToPlayer > 80.0f) {
|
||||
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->targetPitch = 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->targetPitch = 0x2154;
|
||||
} else {
|
||||
this->targetPitch = 0x954;
|
||||
|
@ -520,14 +521,14 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->targetPitch = 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->targetPitch = 0x2154;
|
||||
} else {
|
||||
this->targetPitch = 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),
|
||||
|
@ -554,7 +555,7 @@ void EnFirefly_Stunned(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnFirefly_FrozenFall(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
|
||||
this->actor.colorFilterTimer = 0;
|
||||
EnFirefly_SetupDie(this);
|
||||
} else {
|
||||
|
|
|
@ -377,10 +377,10 @@ void EnFish_Dropped_Fall(EnFish* this, GlobalContext* globalCtx) {
|
|||
this->actor.shape.rot.z = this->actor.world.rot.z;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) { // On floor
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->timer = 400;
|
||||
EnFish_Dropped_SetupFlopOnGround(this);
|
||||
} else if (this->actor.bgCheckFlags & 0x20) { // In water
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
EnFish_Dropped_SetupSwimAway(this);
|
||||
} else if ((this->timer <= 0) && (this->actor.params == FISH_DROPPED) &&
|
||||
(this->actor.floorHeight < BGCHECK_Y_MIN + 10.0f)) {
|
||||
|
@ -464,9 +464,9 @@ void EnFish_Dropped_FlopOnGround(EnFish* this, GlobalContext* globalCtx) {
|
|||
} else {
|
||||
this->actor.draw = NULL;
|
||||
}
|
||||
} else if (this->actor.bgCheckFlags & 0x20) { // In water
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
EnFish_Dropped_SetupSwimAway(this);
|
||||
} else if (this->actor.bgCheckFlags & 1) { // On floor
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
EnFish_Dropped_SetupFlopOnGround(this);
|
||||
}
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ void EnFish_Dropped_SwimAway(EnFish* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToF(&this->actor.speedXZ, 2.8f, 0.1f, 0.4f, 0.0f);
|
||||
|
||||
// If touching wall or not in water, turn back and slow down for one frame.
|
||||
if ((this->actor.bgCheckFlags & 8) || !(this->actor.bgCheckFlags & 0x20)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
|
||||
this->actor.home.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
|
||||
this->actor.speedXZ *= 0.5f;
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ void EnFish_Dropped_SwimAway(EnFish* this, GlobalContext* globalCtx) {
|
|||
this->actor.shape.rot = this->actor.world.rot;
|
||||
|
||||
// Raise if on a floor.
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 4.0f, 2.0f);
|
||||
} else {
|
||||
Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 10.0f, 2.0f);
|
||||
|
|
|
@ -485,7 +485,7 @@ void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
|
||||
if ((this->actor.xzDistToPlayer < 320.0f) && (Actor_IsFacingPlayer(&this->actor, 0x4000))) {
|
||||
EnFloormas_SetupRun(this);
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
// set target rotation to the colliding wall's rotation
|
||||
this->actionTarget = this->actor.wallYaw;
|
||||
EnFloormas_SetupTurn(this);
|
||||
|
@ -514,7 +514,7 @@ void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
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)) {
|
||||
EnFloormas_SetupHover(this, globalCtx);
|
||||
} else if (this->actor.xzDistToPlayer > 400.0f) {
|
||||
EnFloormas_SetupBigWalk(this);
|
||||
|
@ -605,7 +605,7 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
EnFloormas_Slide(this, globalCtx);
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) || (this->actionTimer == 0)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actionTimer == 0)) {
|
||||
EnFloormas_SetupLand(this);
|
||||
}
|
||||
}
|
||||
|
@ -613,8 +613,8 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) {
|
||||
s32 isOnGround;
|
||||
|
||||
isOnGround = this->actor.bgCheckFlags & 1;
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
isOnGround = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
if (this->actor.params != MERGE_MASTER) {
|
||||
EnFloormas_MakeVulnerable(this);
|
||||
}
|
||||
|
@ -627,7 +627,7 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,7 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnFloormas_Split(EnFloormas* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
this->smActionTimer = 50;
|
||||
|
@ -670,7 +670,7 @@ void EnFloormas_Split(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
|
||||
}
|
||||
}
|
||||
|
@ -685,7 +685,7 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->smActionTimer == 0) {
|
||||
EnFloormas_SetupSmDecideAction(this);
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actionTarget = this->actor.wallYaw;
|
||||
EnFloormas_SetupTurn(this);
|
||||
} else if (this->actor.xzDistToPlayer < 120.0f) {
|
||||
|
@ -701,7 +701,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK);
|
||||
}
|
||||
isAgainstWall = this->actor.bgCheckFlags & 8;
|
||||
isAgainstWall = this->actor.bgCheckFlags & BGCHECKFLAG_WALL;
|
||||
if (isAgainstWall) {
|
||||
this->actionTarget = this->actor.wallYaw;
|
||||
EnFloormas_SetupTurn(this);
|
||||
|
@ -747,7 +747,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
} else if (Animation_OnFrame(&this->skelAnime, 20.0f)) {
|
||||
this->actor.speedXZ = 5.0f;
|
||||
this->actor.velocity.y = 7.0f;
|
||||
} else if (this->actor.bgCheckFlags & 2) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actionTimer = 0x32;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
|
||||
|
@ -832,7 +832,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx)
|
|||
} else if (this->actor.child->params == MERGE_MASTER) {
|
||||
primFloormas = this->actor.child;
|
||||
} else {
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.params = 0x10;
|
||||
EnFloormas_SetupLand(this);
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx)
|
|||
(fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 10.0f)) {
|
||||
EnFloormas_SetupSmWait(this);
|
||||
this->collider.base.ocFlags1 |= OC1_ON;
|
||||
} else if (this->actor.bgCheckFlags & 2) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND);
|
||||
EnFloormas_SetupLand(this);
|
||||
|
|
|
@ -80,7 +80,7 @@ static AnimationInfo sAnimationInfo[] = {
|
|||
s32 EnFw_DoBounce(EnFw* this, s32 totalBounces, f32 yVelocity) {
|
||||
s16 temp_v1;
|
||||
|
||||
if (!(this->actor.bgCheckFlags & 1) || (this->actor.velocity.y > 0.0f)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.velocity.y > 0.0f)) {
|
||||
// not on the ground or moving upwards.
|
||||
return false;
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
if (!(this->actor.bgCheckFlags & 1) || this->actor.velocity.y > 0.0f) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.velocity.y > 0.0f) {
|
||||
Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, this->damageTimer);
|
||||
return;
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ void EnFw_TurnToParentInitPos(EnFw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnFw_JumpToParentInitPos(EnFw* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1 && this->actor.velocity.y <= 0.0f) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && this->actor.velocity.y <= 0.0f) {
|
||||
this->actor.parent->params |= 0x8000;
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
|
|
|
@ -322,9 +322,9 @@ void EnFz_ApplyDamage(EnFz* this, GlobalContext* globalCtx) {
|
|||
Vec3f vec;
|
||||
|
||||
if (this->isMoving &&
|
||||
((this->actor.bgCheckFlags & 8) ||
|
||||
((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
(Actor_TestFloorInDirection(&this->actor, globalCtx, 60.0f, this->actor.world.rot.y) == 0))) {
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
this->isMoving = false;
|
||||
this->speedXZ = 0.0f;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
|
|
@ -292,7 +292,8 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
|
|||
}
|
||||
if (func_800354B4(globalCtx, thisx, 100.0f, 0x5DC0, 0x2AA8, thisx->shape.rot.y)) {
|
||||
thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer;
|
||||
if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToPlayer < 90.0f)) {
|
||||
if ((thisx->bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(angleToWall) < 0x2EE0) &&
|
||||
(thisx->xzDistToPlayer < 90.0f)) {
|
||||
EnGeldB_SetupJump(this);
|
||||
return true;
|
||||
} else if (player->swordAnimation == 0x11) {
|
||||
|
@ -307,7 +308,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
|
|||
}
|
||||
} else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f)) != NULL) {
|
||||
thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer;
|
||||
if (((thisx->bgCheckFlags & 8) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) {
|
||||
if (((thisx->bgCheckFlags & BGCHECKFLAG_WALL) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) {
|
||||
if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) &&
|
||||
((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) {
|
||||
EnGeldB_SetupJump(this);
|
||||
|
@ -346,7 +347,7 @@ void EnGeldB_SetupWait(EnGeldB* this) {
|
|||
this->timer = 10;
|
||||
this->invisible = true;
|
||||
this->action = GELDB_WAIT;
|
||||
this->actor.bgCheckFlags &= ~3;
|
||||
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH);
|
||||
this->actor.gravity = -2.0f;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
EnGeldB_SetupAction(this, EnGeldB_Wait);
|
||||
|
@ -362,13 +363,13 @@ void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
this->actor.shape.shadowScale = 90.0f;
|
||||
func_800F5ACC(NA_BGM_MINI_BOSS);
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
this->actor.world.pos.y = this->actor.floorHeight;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
this->actor.focus.pos = this->actor.world.pos;
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, false);
|
||||
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, false);
|
||||
|
@ -666,9 +667,10 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 8.0f;
|
||||
}
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 8) || !Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ,
|
||||
this->actor.shape.rot.y + 0x3E80)) {
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ,
|
||||
this->actor.shape.rot.y + 0x3E80)) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (this->actor.speedXZ >= 0.0f) {
|
||||
phi_v1 = this->actor.shape.rot.y + 0x3E80;
|
||||
} else {
|
||||
|
@ -765,9 +767,9 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
s32 nextKeyFrame;
|
||||
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98;
|
||||
if ((this->actor.bgCheckFlags & 8) ||
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (this->actor.speedXZ >= 0.0f) {
|
||||
phi_v1 = this->actor.shape.rot.y + 0x3E80;
|
||||
} else {
|
||||
|
@ -997,7 +999,7 @@ void EnGeldB_RollBack(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnGeldB_SetupStunned(EnGeldB* this) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->action == GELDB_SPIN_ATTACK)) {
|
||||
|
@ -1012,16 +1014,16 @@ void EnGeldB_SetupStunned(EnGeldB* this) {
|
|||
}
|
||||
|
||||
void EnGeldB_Stunned(EnGeldB* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->actor.speedXZ < 0.0f) {
|
||||
this->actor.speedXZ += 0.05f;
|
||||
}
|
||||
this->invisible = false;
|
||||
}
|
||||
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) {
|
||||
EnGeldB_SetupDefeated(this);
|
||||
} else {
|
||||
|
@ -1032,7 +1034,7 @@ void EnGeldB_Stunned(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnGeldB_SetupDamaged(EnGeldB* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGerudoRedDamageAnim, -4.0f);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->invisible = false;
|
||||
this->actor.speedXZ = -4.0f;
|
||||
} else {
|
||||
|
@ -1048,10 +1050,10 @@ void EnGeldB_SetupDamaged(EnGeldB* this) {
|
|||
void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) {
|
||||
s16 angleToWall;
|
||||
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->actor.speedXZ < 0.0f) {
|
||||
this->actor.speedXZ += 0.05f;
|
||||
}
|
||||
|
@ -1059,9 +1061,10 @@ void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0);
|
||||
if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0) &&
|
||||
SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
|
||||
SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
angleToWall = this->actor.wallYaw - this->actor.shape.rot.y;
|
||||
if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 90.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(angleToWall) < 0x2EE0) &&
|
||||
(this->actor.xzDistToPlayer < 90.0f)) {
|
||||
EnGeldB_SetupJump(this);
|
||||
} else if (!EnGeldB_DodgeRanged(globalCtx, this)) {
|
||||
if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(globalCtx, &this->actor) &&
|
||||
|
@ -1094,7 +1097,8 @@ void EnGeldB_Jump(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
func_800355B8(globalCtx, &this->leftFootPos);
|
||||
func_800355B8(globalCtx, &this->rightFootPos);
|
||||
}
|
||||
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 3)) {
|
||||
if (SkelAnime_Update(&this->skelAnime) &&
|
||||
(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH))) {
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actor.shape.rot.x = 0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
@ -1214,9 +1218,9 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ -= 0.125f;
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) ||
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) {
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (this->actor.speedXZ >= 0.0f) {
|
||||
phi_v1 = this->actor.shape.rot.y + 0x3E80;
|
||||
} else {
|
||||
|
@ -1307,7 +1311,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) {
|
|||
void EnGeldB_SetupDefeated(EnGeldB* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gGerudoRedDefeatAnim, -4.0f);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->invisible = false;
|
||||
this->actor.speedXZ = -6.0f;
|
||||
} else {
|
||||
|
@ -1320,10 +1324,10 @@ void EnGeldB_SetupDefeated(EnGeldB* this) {
|
|||
}
|
||||
|
||||
void EnGeldB_Defeated(EnGeldB* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
this->invisible = false;
|
||||
}
|
||||
|
|
|
@ -540,7 +540,7 @@ s32 EnGo_SpawnDust(EnGo* this, u8 initialTimer, f32 scale, f32 scaleStep, s32 nu
|
|||
}
|
||||
|
||||
s32 EnGo_IsRollingOnGround(EnGo* this, s16 unkArg1, f32 unkArg2) {
|
||||
if ((this->actor.bgCheckFlags & 1) == 0 || this->actor.velocity.y > 0.0f) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.velocity.y > 0.0f) {
|
||||
return false;
|
||||
} else if (this->unk_1E0.unk_00 != 0) {
|
||||
return true;
|
||||
|
|
|
@ -969,7 +969,7 @@ s32 EnGo2_IsWakingUp(EnGo2* this) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) {
|
||||
if ((this->actor.bgCheckFlags & 1) == 0 || this->actor.velocity.y > 0.0f) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.velocity.y > 0.0f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ void EnGoma_EggFallToGround(EnGoma* this, GlobalContext* globalCtx) {
|
|||
|
||||
switch (this->hatchState) {
|
||||
case 0:
|
||||
if (this->actor.bgCheckFlags & 1) { // floor
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->actor.params < 6) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_EGG1);
|
||||
} else {
|
||||
|
@ -258,7 +258,7 @@ void EnGoma_EggFallToGround(EnGoma* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 0.05f);
|
||||
}
|
||||
this->eggPitch += (this->actor.speedXZ * 0.1f);
|
||||
|
@ -340,7 +340,7 @@ void EnGoma_SetupHurt(EnGoma* this, GlobalContext* globalCtx) {
|
|||
void EnGoma_Hurt(EnGoma* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelanime);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ void EnGoma_SetupDie(EnGoma* this) {
|
|||
void EnGoma_Die(EnGoma* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelanime);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
|
||||
}
|
||||
|
||||
|
@ -475,7 +475,7 @@ void EnGoma_SetupLand(EnGoma* this) {
|
|||
void EnGoma_Land(EnGoma* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelanime);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f);
|
||||
}
|
||||
if (this->actionTimer == 0) {
|
||||
|
@ -501,7 +501,7 @@ void EnGoma_Jump(EnGoma* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_Update(&this->skelanime);
|
||||
Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.5f, 5.0f);
|
||||
|
||||
if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & 1)) {
|
||||
if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
EnGoma_SetupLand(this);
|
||||
if (this->actor.params < 6) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_LAND2);
|
||||
|
@ -538,7 +538,7 @@ void EnGoma_ChasePlayer(EnGoma* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 2000);
|
||||
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
if (this->actor.xzDistToPlayer <= 150.0f) {
|
||||
|
@ -567,7 +567,7 @@ void EnGoma_Stunned(EnGoma* this, GlobalContext* globalCtx) {
|
|||
SkelAnime_Update(&this->skelanime);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f);
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ void EnGoma_BossLimb(EnGoma* this, GlobalContext* globalCtx) {
|
|||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 4);
|
||||
this->actor.world.pos.y += 5.0f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
} else if (this->actionTimer < 250) {
|
||||
this->actor.shape.rot.y += 2000;
|
||||
|
|
|
@ -643,7 +643,7 @@ void EnGoroiwa_SetupMoveAndFallToGround(EnGoroiwa* this) {
|
|||
|
||||
void EnGoroiwa_MoveAndFallToGround(EnGoroiwa* this, GlobalContext* globalCtx) {
|
||||
EnGoroiwa_MoveAndFall(this, globalCtx);
|
||||
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->stateFlags & ENGOROIWA_PLAYER_IN_THE_WAY) && (this->actor.home.rot.z & 1) == 1) {
|
||||
EnGoroiwa_ReverseDirection(this);
|
||||
EnGoroiwa_FaceNextWaypoint(this, globalCtx);
|
||||
|
|
|
@ -363,7 +363,7 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->unk_19F == 4) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 3);
|
||||
if (this->actor.bgCheckFlags & 0x18) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING)) {
|
||||
bomb2Pos.x = this->actor.world.pos.x;
|
||||
bomb2Pos.y = this->actor.world.pos.y;
|
||||
bomb2Pos.z = this->actor.world.pos.z;
|
||||
|
|
|
@ -352,9 +352,9 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) {
|
|||
|
||||
Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f);
|
||||
if (Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) {
|
||||
if (this->actor.bgCheckFlags & 0x20) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
this->unk_196 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->unk_196 = this->actor.wallYaw;
|
||||
} else if (this->animFlagAndTimer == 0) {
|
||||
diffRotInit = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
|
||||
|
@ -405,7 +405,7 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) {
|
|||
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK);
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
temp_a1 = this->actor.wallYaw;
|
||||
} else {
|
||||
temp_a1 = this->actor.yawTowardsPlayer - Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) - 0x8000;
|
||||
|
|
|
@ -430,7 +430,7 @@ void EnHonotrap_FlameChase(EnHonotrap* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ *= 0.1f;
|
||||
this->actor.velocity.y *= 0.1f;
|
||||
EnHonotrap_SetupFlameVanish(this);
|
||||
} else if ((this->actor.bgCheckFlags & 8) || (this->timer <= 0)) {
|
||||
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->timer <= 0)) {
|
||||
EnHonotrap_SetupFlameVanish(this);
|
||||
} else {
|
||||
EnHonotrap_FlameCollisionCheck(this, globalCtx);
|
||||
|
|
|
@ -3122,7 +3122,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
// void 0 trick required to match, but is surely not real. revisit at a later time
|
||||
if (this->actor.bgCheckFlags & 8 && Math_CosS(this->actor.wallYaw - ((void)0, this->actor.world).rot.y) < -0.3f) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
Math_CosS(this->actor.wallYaw - ((void)0, this->actor.world).rot.y) < -0.3f) {
|
||||
if (this->actor.speedXZ > 4.0f) {
|
||||
this->actor.speedXZ -= 1.0f;
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_HORSE_SANDDUST, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
|
||||
|
|
|
@ -395,7 +395,7 @@ void EnHorseNormal_Wander(EnHorseNormal* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 8.0f;
|
||||
phi_t0 = 6;
|
||||
}
|
||||
if (Rand_ZeroOne() < 0.1f || (this->unk_21E == 0 && ((this->actor.bgCheckFlags & 8) ||
|
||||
if (Rand_ZeroOne() < 0.1f || (this->unk_21E == 0 && ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
(this->bodyCollider.base.ocFlags1 & OC1_HIT) ||
|
||||
(this->headCollider.base.ocFlags1 & OC1_HIT)))) {
|
||||
this->unk_21E += (Rand_ZeroOne() * 30.0f) - 15.0f;
|
||||
|
|
|
@ -231,7 +231,7 @@ void EnIceHono_SetupActionDroppedFlame(EnIceHono* this) {
|
|||
}
|
||||
|
||||
void EnIceHono_DropFlame(EnIceHono* this, GlobalContext* globalCtx) {
|
||||
u32 bgFlag = this->actor.bgCheckFlags & 1;
|
||||
u32 bgFlag = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND;
|
||||
|
||||
Math_StepToF(&this->actor.scale.x, 0.0017f, 0.00008f);
|
||||
this->actor.scale.z = this->actor.scale.x;
|
||||
|
|
|
@ -369,7 +369,7 @@ void func_80A74BA4(EnIk* this, GlobalContext* globalCtx) {
|
|||
sp2E = 9;
|
||||
}
|
||||
temp_a1 = this->actor.wallYaw - this->actor.shape.rot.y;
|
||||
if ((this->actor.bgCheckFlags & 8) && (ABS(temp_a1) >= 0x4000)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(temp_a1) >= 0x4000)) {
|
||||
temp_a1 = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000;
|
||||
Math_SmoothStepToS(&this->actor.world.rot.y, temp_a1, 1, phi_a3, 0);
|
||||
} else {
|
||||
|
|
|
@ -260,9 +260,10 @@ void func_80A7C3F4(EnInsect* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (((this->unk_314 & 4) && this->unk_31C <= 0) ||
|
||||
((sp2E == 2 || sp2E == 3) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) {
|
||||
((sp2E == 2 || sp2E == 3) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
|
||||
D_80A7DEB8 >= 4)) {
|
||||
func_80A7CBC8(this);
|
||||
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) {
|
||||
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
|
||||
func_80A7CE60(this);
|
||||
} else if (this->actor.xzDistToPlayer < 40.0f) {
|
||||
func_80A7C818(this);
|
||||
|
@ -302,9 +303,10 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (((this->unk_314 & 4) && this->unk_31C <= 0) ||
|
||||
((sp34 == 2 || sp34 == 3) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) {
|
||||
((sp34 == 2 || sp34 == 3) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
|
||||
D_80A7DEB8 >= 4)) {
|
||||
func_80A7CBC8(this);
|
||||
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) {
|
||||
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
|
||||
func_80A7CE60(this);
|
||||
} else if (this->actor.xzDistToPlayer < 40.0f) {
|
||||
func_80A7C818(this);
|
||||
|
@ -353,7 +355,7 @@ void func_80A7C86C(EnInsect* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->unk_31A <= 0 || !sp38) {
|
||||
func_80A7C3A0(this);
|
||||
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) {
|
||||
} else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
|
||||
func_80A7CE60(this);
|
||||
}
|
||||
}
|
||||
|
@ -510,7 +512,7 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) {
|
|||
if (this->unk_31A <= 0 || ((this->unk_314 & 4) && this->unk_31C <= 0) ||
|
||||
((sp4E == 2 || sp4E == 3) && (this->unk_314 & 1) && D_80A7DEB8 >= 4)) {
|
||||
func_80A7D1F4(this);
|
||||
} else if (!(this->actor.bgCheckFlags & 0x40)) {
|
||||
} else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
|
||||
if (this->unk_314 & 0x10) {
|
||||
func_80A7D39C(this);
|
||||
} else {
|
||||
|
@ -634,7 +636,7 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) {
|
|||
|
||||
Actor_SetScale(&this->actor, CLAMP_MAX(thisTemp->actor.scale.x + 0.0008f, 0.01f));
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_324, 0.1f, 0.5f, 0.0f);
|
||||
Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_328, 2000);
|
||||
sp50 = Math_ScaledStepToS(&this->actor.world.rot.x, 0, 2000);
|
||||
|
@ -662,7 +664,7 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (!(this->unk_314 & 0x40) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->unk_314 & 0x40) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
|
||||
this->unk_314 |= 0x40;
|
||||
}
|
||||
|
@ -681,13 +683,13 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) {
|
||||
if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH)) {
|
||||
func_80A7CE60(this);
|
||||
} else if (this->unk_314 & 0x10) {
|
||||
if (sp40 < 9.0f) {
|
||||
func_80A7CBC8(this);
|
||||
} else if (this->unk_31A <= 0 || this->unk_31C <= 0 ||
|
||||
((this->unk_314 & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4 &&
|
||||
((this->unk_314 & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && D_80A7DEB8 >= 4 &&
|
||||
(sp3A == 2 || sp3A == 3))) {
|
||||
func_80A7CBC8(this);
|
||||
} else {
|
||||
|
@ -736,7 +738,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_MoveForward(&this->actor);
|
||||
if (this->unk_314 & 0x100) {
|
||||
if (this->unk_314 & 1) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
func_80A7C058(this);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -145,11 +145,11 @@ void EnIshi_SpawnFragmentsSmall(EnIshi* this, GlobalContext* globalCtx) {
|
|||
pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 5.0f) + 5.0f;
|
||||
pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 8.0f;
|
||||
Math_Vec3f_Copy(&velocity, &this->actor.velocity);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
velocity.x *= 0.8f;
|
||||
velocity.y *= -0.8f;
|
||||
velocity.z *= 0.8f;
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
velocity.x *= -0.8f;
|
||||
velocity.y *= 0.8f;
|
||||
velocity.z *= -0.8f;
|
||||
|
@ -185,11 +185,11 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx) {
|
|||
pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 40.0f) + 5.0f;
|
||||
pos.z = this->actor.world.pos.z + (Math_CosS(angle) * rand);
|
||||
Math_Vec3f_Copy(&velocity, &thisx->velocity);
|
||||
if (thisx->bgCheckFlags & 1) {
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
velocity.x *= 0.9f;
|
||||
velocity.y *= -0.8f;
|
||||
velocity.z *= 0.9f;
|
||||
} else if (thisx->bgCheckFlags & 8) {
|
||||
} else if (thisx->bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
velocity.x *= -0.9f;
|
||||
velocity.y *= 0.8f;
|
||||
velocity.z *= -0.9f;
|
||||
|
@ -217,11 +217,11 @@ void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx) {
|
|||
Vec3f pos;
|
||||
|
||||
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
pos.x += 2.0f * this->actor.velocity.x;
|
||||
pos.y -= 2.0f * this->actor.velocity.y;
|
||||
pos.z += 2.0f * this->actor.velocity.z;
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
pos.x -= 2.0f * this->actor.velocity.x;
|
||||
pos.y += 2.0f * this->actor.velocity.y;
|
||||
pos.z -= 2.0f * this->actor.velocity.z;
|
||||
|
@ -233,11 +233,11 @@ void EnIshi_SpawnDustLarge(EnIshi* this, GlobalContext* globalCtx) {
|
|||
Vec3f pos;
|
||||
|
||||
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
pos.x += 2.0f * this->actor.velocity.x;
|
||||
pos.y -= 2.0f * this->actor.velocity.y;
|
||||
pos.z += 2.0f * this->actor.velocity.z;
|
||||
} else if (this->actor.bgCheckFlags & 8) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
pos.x -= 2.0f * this->actor.velocity.x;
|
||||
pos.y += 2.0f * this->actor.velocity.y;
|
||||
pos.z -= 2.0f * this->actor.velocity.z;
|
||||
|
@ -420,10 +420,10 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) {
|
|||
s32 quakeIdx;
|
||||
Vec3f contactPos;
|
||||
|
||||
if (this->actor.bgCheckFlags & 9) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL)) {
|
||||
EnIshi_DropCollectible(this, globalCtx);
|
||||
sFragmentSpawnFuncs[type](this, globalCtx);
|
||||
if (!(this->actor.bgCheckFlags & 0x20)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type],
|
||||
sBreakSounds[type]);
|
||||
sDustSpawnFuncs[type](this, globalCtx);
|
||||
|
@ -438,7 +438,7 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) {
|
|||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 0x40) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
|
||||
contactPos.x = this->actor.world.pos.x;
|
||||
contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater;
|
||||
contactPos.z = this->actor.world.pos.z;
|
||||
|
@ -456,7 +456,7 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) {
|
|||
sRotSpeedX >>= 2;
|
||||
sRotSpeedY >>= 2;
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &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);
|
||||
EnIshi_Fall(this);
|
||||
|
|
|
@ -173,7 +173,7 @@ void EnJs_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_MoveForward(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1) {
|
||||
Math_ApproachF(&this->actor.shape.yOffset, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f);
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ void func_80A8F320(EnKakasi* this, GlobalContext* globalCtx, s16 arg) {
|
|||
|
||||
if (this->unk_19A != 0) {
|
||||
this->actor.gravity = -1.0f;
|
||||
if (this->unk_19A == 8 && (this->actor.bgCheckFlags & 1)) {
|
||||
if (this->unk_19A == 8 && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.velocity.y = 3.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_IT_KAKASHI_JUMP);
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ void func_80A90EBC(EnKakasi3* this, GlobalContext* globalCtx, s32 arg) {
|
|||
|
||||
if (this->unk_19A != 0) {
|
||||
this->actor.gravity = -1.0f;
|
||||
if (this->unk_19A == 8 && (this->actor.bgCheckFlags & 1)) {
|
||||
if (this->unk_19A == 8 && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.velocity.y = 3.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_IT_KAKASHI_JUMP);
|
||||
}
|
||||
|
|
|
@ -445,7 +445,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->actor.yDistToWater = tempYDistToWater;
|
||||
|
||||
osSyncPrintf(VT_RST);
|
||||
onGround = (this->actor.bgCheckFlags & 1);
|
||||
onGround = (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND);
|
||||
if (this->spinXFlag) {
|
||||
this->spinRot.x += this->spinVel.x;
|
||||
this->spinVel.x -= 0x800;
|
||||
|
@ -482,11 +482,11 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
if (this->spinVel.z < -0xC00) {
|
||||
this->spinVel.z = -0xC00;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.speedXZ *= -0.5f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_WOODPLATE_BOUND);
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 0x40) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
|
||||
this->actionState = ENKANBAN_WATER;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_DROP_WATER);
|
||||
this->bounceX = this->bounceZ = 0;
|
||||
|
@ -594,13 +594,13 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->spinVel.y = this->actor.speedXZ * -1000.0f;
|
||||
}
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
Actor_MoveForward(&this->actor);
|
||||
if (this->actor.speedXZ != 0.0f) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 5);
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.speedXZ *= -0.5f;
|
||||
if (this->spinVel.y > 0) {
|
||||
this->spinVel.y = -0x7D0;
|
||||
|
|
|
@ -325,7 +325,8 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) {
|
|||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
|
||||
EffectSsHahen_SpawnBurst(globalCtx, &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.x = this->actor.scale.y = this->actor.scale.z = 0.0f;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
|
@ -333,7 +334,7 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) {
|
|||
NULL);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
this->actor.params = 1;
|
||||
}
|
||||
|
|
|
@ -369,8 +369,8 @@ void EnKusa_Fall(EnKusa* this, GlobalContext* globalCtx) {
|
|||
s32 pad;
|
||||
Vec3f contactPos;
|
||||
|
||||
if (this->actor.bgCheckFlags & 0xB) {
|
||||
if (!(this->actor.bgCheckFlags & 0x20)) {
|
||||
if (this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH | BGCHECKFLAG_WALL)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN);
|
||||
}
|
||||
EnKusa_SpawnFragments(this, globalCtx);
|
||||
|
@ -388,7 +388,7 @@ void EnKusa_Fall(EnKusa* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x40) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER_TOUCH) {
|
||||
contactPos.x = this->actor.world.pos.x;
|
||||
contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater;
|
||||
contactPos.z = this->actor.world.pos.z;
|
||||
|
@ -401,7 +401,7 @@ void EnKusa_Fall(EnKusa* this, GlobalContext* globalCtx) {
|
|||
rotSpeedXtarget >>= 1;
|
||||
rotSpeedY >>= 1;
|
||||
rotSpeedYtarget >>= 1;
|
||||
this->actor.bgCheckFlags &= ~0x40;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER_TOUCH;
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,24 +77,24 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->dyna.unk_162++;
|
||||
} else {
|
||||
if (thisx->speedXZ) {
|
||||
if (thisx->bgCheckFlags & 8) {
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
thisx->world.rot.y = (thisx->world.rot.y + thisx->wallYaw) - thisx->world.rot.y;
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
thisx->speedXZ *= 0.7f;
|
||||
thisx->bgCheckFlags &= ~0x8;
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
}
|
||||
|
||||
if ((thisx->bgCheckFlags & 1) == 0) {
|
||||
if (!(thisx->bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Math_StepToF(&thisx->speedXZ, 0, IREG(57) / 100.0f);
|
||||
} else {
|
||||
Math_StepToF(&thisx->speedXZ, 0, IREG(58) / 100.0f);
|
||||
if ((thisx->bgCheckFlags & 2) && (thisx->velocity.y < IREG(59) / 100.0f)) {
|
||||
if ((thisx->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (thisx->velocity.y < IREG(59) / 100.0f)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
thisx->velocity.y *= IREG(60) / 100.0f;
|
||||
thisx->bgCheckFlags &= ~0x1;
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
} else {
|
||||
func_8002F580(thisx, globalCtx);
|
||||
}
|
||||
|
|
|
@ -534,7 +534,7 @@ void EnMb_SetupSpearEndChargeQuick(EnMb* this) {
|
|||
void EnMb_SetupSpearPatrolEndCharge(EnMb* this) {
|
||||
Animation_PlayOnce(&this->skelAnime, &gEnMbSpearSlowDownAnim);
|
||||
this->state = ENMB_STATE_ATTACK_END;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->timer1 = 0;
|
||||
this->timer3 = 50;
|
||||
this->actor.speedXZ = -8.0f;
|
||||
|
@ -725,7 +725,7 @@ void EnMb_SpearPatrolEndCharge(EnMb* this, GlobalContext* globalCtx) {
|
|||
func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f);
|
||||
|
||||
if (this->actor.speedXZ > 1.0f) {
|
||||
|
|
|
@ -373,7 +373,7 @@ void func_80AB6100(EnNiw* this, GlobalContext* globalCtx, s32 arg2) {
|
|||
if (this->timer4 == 0) {
|
||||
this->timer4 = 3;
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 3.5f;
|
||||
}
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ void func_80AB6100(EnNiw* this, GlobalContext* globalCtx, s32 arg2) {
|
|||
factor = -D_80AB860C[arg2];
|
||||
}
|
||||
if (arg2 == 1) {
|
||||
if (this->timer6 == 0 || this->actor.bgCheckFlags & 8) {
|
||||
if (this->timer6 == 0 || this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->timer6 = 150;
|
||||
if (this->timer8 == 0) {
|
||||
this->timer8 = 70;
|
||||
|
@ -429,7 +429,7 @@ void func_80AB6324(EnNiw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80AB63A8(EnNiw* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1 && this->actor.velocity.y < 0.0f) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && this->actor.velocity.y < 0.0f) {
|
||||
this->unk_2AC.x = this->unk_2B8.x = this->actor.world.pos.x;
|
||||
this->unk_2AC.y = this->unk_2B8.y = this->actor.world.pos.y;
|
||||
this->unk_2AC.z = this->unk_2B8.z = this->actor.world.pos.z;
|
||||
|
@ -550,7 +550,7 @@ void func_80AB6570(EnNiw* this, GlobalContext* globalCtx) {
|
|||
this->unk_2B8.z = this->unk_2AC.z + posZ;
|
||||
} else {
|
||||
this->timer4 = 4;
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.velocity.y = 3.5f;
|
||||
}
|
||||
|
@ -648,7 +648,7 @@ void func_80AB6BF8(EnNiw* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80AB6D08(EnNiw* this, GlobalContext* globalCtx) {
|
||||
if (this->path == 0) {
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
return;
|
||||
}
|
||||
if (this->actor.params == 0xE) {
|
||||
|
@ -669,7 +669,7 @@ void func_80AB6D08(EnNiw* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.velocity.y = 4.0f;
|
||||
} else {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->sfxTimer1 = 0;
|
||||
this->actor.velocity.y = 4.0f;
|
||||
this->unk_2A6 = 1;
|
||||
|
@ -716,7 +716,7 @@ void func_80AB6F04(EnNiw* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.speedXZ = 2.0f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 0x20) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
this->actor.gravity = 0.0f;
|
||||
|
||||
if (this->actor.yDistToWater > 15.0f) {
|
||||
|
@ -728,21 +728,21 @@ void func_80AB6F04(EnNiw* this, GlobalContext* globalCtx) {
|
|||
pos.y += this->actor.yDistToWater;
|
||||
EffectSsGRipple_Spawn(globalCtx, &pos, 100, 500, 30);
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.velocity.y = 10.0f;
|
||||
this->actor.speedXZ = 1.0f;
|
||||
}
|
||||
} else {
|
||||
this->actor.gravity = -2.0f;
|
||||
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.velocity.y = 10.0f;
|
||||
this->actor.speedXZ = 1.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
} else {
|
||||
this->actor.speedXZ = 4.0f;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.gravity = -2.0f;
|
||||
this->timer6 = 100;
|
||||
this->timer4 = 0;
|
||||
|
@ -848,7 +848,7 @@ void func_80AB7328(EnNiw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80AB7420(EnNiw* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->unk_2A4 = (s16)Rand_ZeroFloat(3.99f) + 5;
|
||||
this->actionFunc = EnNiw_ResetAction;
|
||||
}
|
||||
|
@ -1031,7 +1031,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (thisx->bgCheckFlags & 0x20 && thisx->yDistToWater > 15.0f && this->actionFunc != func_80AB6F04 &&
|
||||
if ((thisx->bgCheckFlags & BGCHECKFLAG_WATER) && thisx->yDistToWater > 15.0f && this->actionFunc != func_80AB6F04 &&
|
||||
thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA) {
|
||||
thisx->velocity.y = 0.0f;
|
||||
thisx->gravity = 0.0f;
|
||||
|
|
|
@ -108,8 +108,9 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->actor.home.rot.z += 0x2AA8;
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (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->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) ||
|
||||
(this->collider.base.ocFlags1 & OC1_HIT)) {
|
||||
// Checking if the player is using a shield that reflects projectiles
|
||||
// And if so, reflects the projectile on impact
|
||||
if ((player->currentShield == PLAYER_SHIELD_DEKU) ||
|
||||
|
|
|
@ -251,11 +251,11 @@ void EnNy_TurnToStone(EnNy* this, GlobalContext* globalCtx) {
|
|||
phi_f0 -= 2.0f;
|
||||
if (phi_f0 <= 0.25f) {
|
||||
phi_f0 = 0.25f;
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
if (!(this->unk_1F0 < this->actor.yDistToWater)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
}
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
func_80ABCE38(this);
|
||||
|
|
|
@ -476,14 +476,14 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) {
|
|||
this->actor.gravity = -1.0f;
|
||||
}
|
||||
this->actor.home.rot.z += 0x1554;
|
||||
if (this->actor.bgCheckFlags & 0x20) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
this->actor.gravity = -1.0f;
|
||||
this->actor.speedXZ -= 0.1f;
|
||||
this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 1.0f);
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) ||
|
||||
this->collider.base.acFlags & AC_HIT || this->collider.base.ocFlags1 & OC1_HIT ||
|
||||
this->actor.floorHeight == BGCHECK_Y_MIN) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
|
||||
(this->collider.base.atFlags & AT_HIT) || this->collider.base.acFlags & AC_HIT ||
|
||||
this->collider.base.ocFlags1 & OC1_HIT || this->actor.floorHeight == BGCHECK_Y_MIN) {
|
||||
if ((player->currentShield == PLAYER_SHIELD_DEKU ||
|
||||
(player->currentShield == PLAYER_SHIELD_HYLIAN && LINK_IS_ADULT)) &&
|
||||
this->collider.base.atFlags & AT_HIT && this->collider.base.atFlags & AT_TYPE_ENEMY &&
|
||||
|
@ -603,17 +603,17 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Actor_MoveForward(&this->actor);
|
||||
Math_Vec3f_Copy(&sp38, &this->actor.world.pos);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 30.0f, 5);
|
||||
if ((this->actor.bgCheckFlags & 8) &&
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) {
|
||||
sp34 = true;
|
||||
this->actor.bgCheckFlags &= ~8;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_WALL;
|
||||
}
|
||||
if ((this->actor.bgCheckFlags & 1) &&
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
|
||||
SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId)) {
|
||||
sp34 = true;
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
}
|
||||
if (sp34 && !(this->actor.bgCheckFlags & 9)) {
|
||||
if (sp34 && !(this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL))) {
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &sp38);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) {
|
|||
if ((this->actor.params == 12) || (this->actor.params == 13)) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D);
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) || (this->actor.world.pos.y <= this->actor.floorHeight)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.world.pos.y <= this->actor.floorHeight)) {
|
||||
this->action = 4;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
|
@ -247,8 +247,8 @@ void EnPart_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5);
|
||||
if (this->actor.params >= 0) {
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
if (thisx->bgCheckFlags & 1) {
|
||||
thisx->bgCheckFlags &= ~1;
|
||||
if (thisx->bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
thisx->bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
thisx->velocity.y = 6.0f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -560,7 +560,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, GlobalContext* globalCtx) {
|
|||
this->colQuad.base.acFlags = this->colQuad.base.acFlags & ~AC_BOUNCED;
|
||||
EnPeehat_SetStateAttackRecoil(this);
|
||||
} else if ((this->colQuad.base.atFlags & AT_HIT) || (this->colCylinder.base.acFlags & AC_HIT) ||
|
||||
(this->actor.bgCheckFlags & 1)) {
|
||||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
this->colQuad.base.atFlags &= ~AT_HIT;
|
||||
if (!(this->colCylinder.base.acFlags & AC_HIT) && &player->actor == this->colQuad.base.at) {
|
||||
|
@ -570,7 +570,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, GlobalContext* globalCtx) {
|
|||
this->actor.world.rot.y -= 0x2000;
|
||||
}
|
||||
this->unk2D4 = 40;
|
||||
} else if (this->colCylinder.base.acFlags & AC_HIT || this->actor.bgCheckFlags & 1) {
|
||||
} else if (this->colCylinder.base.acFlags & AC_HIT || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
Vec3f zeroVec = { 0, 0, 0 };
|
||||
s32 i;
|
||||
for (i = 4; i >= 0; i--) {
|
||||
|
@ -583,7 +583,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
if (&player->actor != this->colQuad.base.at || this->colCylinder.base.acFlags & AC_HIT) {
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
EffectSsDeadSound_SpawnStationary(globalCtx, &this->actor.projectedPos, NA_SE_EN_PIHAT_SM_DEAD, 1, 1,
|
||||
40);
|
||||
}
|
||||
|
|
|
@ -606,7 +606,7 @@ void EnPoField_SoulIdle(EnPoField* this, GlobalContext* globalCtx) {
|
|||
if (this->actionTimer != 0) {
|
||||
this->actionTimer--;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO_FIELD, 10,
|
||||
gPoeFieldLanternDL);
|
||||
func_80AD42B0(this);
|
||||
|
|
|
@ -617,7 +617,7 @@ void func_80ADA530(EnPoSisters* this, GlobalContext* globalCtx) {
|
|||
} else if (this->unk_19A == 0 && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f) != 0) {
|
||||
func_80AD9368(this);
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
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) > 300.0f) {
|
||||
|
@ -729,7 +729,7 @@ void func_80ADAC70(EnPoSisters* this, GlobalContext* globalCtx) {
|
|||
if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) {
|
||||
this->unk_19A--;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
this->unk_199 |= 2;
|
||||
func_80AD9718(this);
|
||||
|
|
|
@ -719,7 +719,7 @@ void EnPoh_Death(EnPoh* this, GlobalContext* globalCtx) {
|
|||
if (this->unk_198 != 0) {
|
||||
this->unk_198--;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
objId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH;
|
||||
EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objId, 10,
|
||||
this->info->lanternDisplayList);
|
||||
|
|
|
@ -599,7 +599,7 @@ void func_80AE3A54(EnRd* this, GlobalContext* globalCtx) {
|
|||
void func_80AE3A8C(EnRd* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_rd_Anim_0074F0, -6.0f);
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = -2.0f;
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ void func_80AE5270(EnReeba* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 0.0f;
|
||||
this->actionfunc = func_80AE5688;
|
||||
} else if ((this->unk_272 == 0) || (this->actor.xzDistToPlayer < 30.0f) || (this->actor.xzDistToPlayer > 400.0f) ||
|
||||
(this->actor.bgCheckFlags & 8)) {
|
||||
(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
this->actionfunc = func_80AE5688;
|
||||
} else if (this->unk_274 == 0) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE);
|
||||
|
@ -283,7 +283,7 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) {
|
|||
surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
|
||||
if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToPlayer > 400.0f) ||
|
||||
(this->actor.bgCheckFlags & 8)) {
|
||||
(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
this->actionfunc = func_80AE5688;
|
||||
} else {
|
||||
if ((this->actor.xzDistToPlayer < 70.0f) && (this->unk_270 == 0)) {
|
||||
|
|
|
@ -857,7 +857,7 @@ void func_80AEC780(EnRu1* this, GlobalContext* globalCtx) {
|
|||
|
||||
if ((func_80AEC5FC(this, globalCtx)) && (!Gameplay_InCsMode(globalCtx)) &&
|
||||
(!(player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) &&
|
||||
(player->actor.bgCheckFlags & 1)) {
|
||||
(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
|
||||
globalCtx->csCtx.segment = &D_80AF0880;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
|
@ -911,7 +911,7 @@ void func_80AEC9C4(EnRu1* this) {
|
|||
}
|
||||
|
||||
void func_80AECA18(EnRu1* this) {
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->action = 13;
|
||||
this->unk_26C = 0.0f;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
|
@ -1317,7 +1317,7 @@ void func_80AEDAE0(EnRu1* this, GlobalContext* globalCtx) {
|
|||
DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId);
|
||||
|
||||
if (dynaPolyActor == NULL || dynaPolyActor->actor.id == ACTOR_EN_BOX) {
|
||||
this->actor.bgCheckFlags &= ~0x19;
|
||||
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1332,7 +1332,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
|
|||
s32 temp_a0;
|
||||
s32 phi_v1;
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
velocityY = &this->actor.velocity.y;
|
||||
dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId);
|
||||
if (*velocityY <= 0.0f) {
|
||||
|
@ -1368,7 +1368,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
|
|||
func_80AED4FC(this);
|
||||
}
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 0x10) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) {
|
||||
speedXZ = &this->actor.speedXZ;
|
||||
velocityY = &this->actor.velocity.y;
|
||||
if (*speedXZ >= (kREG(27) * 0.01f) + 3.0f) {
|
||||
|
@ -1381,7 +1381,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
|
|||
func_80AED4FC(this);
|
||||
}
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
speedXZ = &this->actor.speedXZ;
|
||||
if (*speedXZ != 0.0f) {
|
||||
rotY = this->actor.world.rot.y;
|
||||
|
@ -1515,7 +1515,7 @@ void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) {
|
|||
DynaPolyActor* dynaPolyActor;
|
||||
s32 floorBgId;
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.floorBgId != BGCHECK_SCENE)) {
|
||||
floorBgId = this->actor.floorBgId;
|
||||
dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, floorBgId);
|
||||
if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) {
|
||||
|
@ -1534,7 +1534,7 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) {
|
|||
DynaPolyActor* dynaPolyActor;
|
||||
s32 floorBgId;
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) && this->actor.floorBgId != BGCHECK_SCENE) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && this->actor.floorBgId != BGCHECK_SCENE) {
|
||||
colCtx = &globalCtx->colCtx;
|
||||
floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately
|
||||
dynaPolyActor = DynaPoly_GetActor(colCtx, floorBgId);
|
||||
|
@ -1561,7 +1561,7 @@ void func_80AEE488(EnRu1* this, GlobalContext* globalCtx) {
|
|||
this->roomNum3 = curRoomNum;
|
||||
this->action = 31;
|
||||
func_80AED520(this, globalCtx);
|
||||
} else if ((!func_80AEE394(this, globalCtx)) && (!(this->actor.bgCheckFlags & 1))) {
|
||||
} else if (!func_80AEE394(this, globalCtx) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f);
|
||||
this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f);
|
||||
this->action = 28;
|
||||
|
@ -1570,7 +1570,8 @@ void func_80AEE488(EnRu1* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80AEE568(EnRu1* this, GlobalContext* globalCtx) {
|
||||
if (!func_80AEE394(this, globalCtx)) {
|
||||
if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ == 0.0f) && (this->actor.minVelocityY == 0.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speedXZ == 0.0f) &&
|
||||
(this->actor.minVelocityY == 0.0f)) {
|
||||
func_80AEE02C(this);
|
||||
func_8002F580(&this->actor, globalCtx);
|
||||
this->action = 27;
|
||||
|
@ -1671,7 +1672,7 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
s32 func_80AEEAC8(EnRu1* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
func_80AEE02C(this);
|
||||
func_8002F580(&this->actor, globalCtx);
|
||||
this->action = 27;
|
||||
|
|
|
@ -273,11 +273,11 @@ void EnSb_TurnAround(EnSb* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnSb_Lunge(EnSb* this, GlobalContext* globalCtx) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
|
||||
if ((this->actor.velocity.y <= -0.1f) || ((this->actor.bgCheckFlags & 2))) {
|
||||
if ((this->actor.velocity.y <= -0.1f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH)) {
|
||||
if (!(this->actor.yDistToWater > 0.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
|
||||
}
|
||||
this->actor.bgCheckFlags = this->actor.bgCheckFlags & ~2;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
EnSb_SetupBounce(this);
|
||||
}
|
||||
}
|
||||
|
@ -306,8 +306,8 @@ void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
EnSb_SpawnBubbles(globalCtx, this);
|
||||
EnSb_SetupLunge(this);
|
||||
} else if (this->actor.bgCheckFlags & 1) {
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->timer = 1;
|
||||
EnSb_SetupWaitClosed(this);
|
||||
|
@ -319,13 +319,13 @@ void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) {
|
|||
void EnSb_Cooldown(EnSb* this, GlobalContext* globalCtx) {
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
} else {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
this->actionFunc = EnSb_WaitClosed;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ void func_80AFD508(EnSkb* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkb_SetupStunned(EnSkb* this) {
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
|
||||
|
@ -346,15 +346,15 @@ void EnSkb_SetupStunned(EnSkb* this) {
|
|||
}
|
||||
|
||||
void func_80AFD59C(EnSkb* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->actor.speedXZ < 0.0f) {
|
||||
this->actor.speedXZ += 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) {
|
||||
func_80AFD7B4(this, globalCtx);
|
||||
} else {
|
||||
|
@ -365,7 +365,7 @@ void func_80AFD59C(EnSkb* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80AFD644(EnSkb* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDamagedAnim, -4.0f);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = -4.0f;
|
||||
}
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
|
@ -383,17 +383,17 @@ void func_80AFD6CC(EnSkb* this, GlobalContext* globalCtx) {
|
|||
if ((*new_var) != 0) {
|
||||
this->unk_283 = (*new_var) | 2;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.speedXZ = 0;
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
if (this->actor.speedXZ < 0.0f) {
|
||||
this->actor.speedXZ += 0.05f;
|
||||
}
|
||||
}
|
||||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0);
|
||||
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
|
||||
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
func_80AFCD60(this);
|
||||
}
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ void func_80AFD7B4(EnSkb* this, GlobalContext* globalCtx) {
|
|||
Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDyingAnim, -4.0f);
|
||||
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.speedXZ = -6.0f;
|
||||
}
|
||||
this->unk_280 = 1;
|
||||
|
@ -439,7 +439,8 @@ void func_80AFD968(EnSkb* this, GlobalContext* globalCtx) {
|
|||
s16 phi_v1;
|
||||
Player* player;
|
||||
|
||||
if ((this->unk_280 != 1) && (this->actor.bgCheckFlags & 0x60) && (this->actor.yDistToWater >= 40.0f)) {
|
||||
if ((this->unk_280 != 1) && (this->actor.bgCheckFlags & (BGCHECKFLAG_WATER | BGCHECKFLAG_WATER_TOUCH)) &&
|
||||
(this->actor.yDistToWater >= 40.0f)) {
|
||||
this->actor.colChkInfo.health = 0;
|
||||
this->unk_281 = 0;
|
||||
func_80AFD7B4(this, globalCtx);
|
||||
|
|
|
@ -670,8 +670,8 @@ void EnSkj_Fade(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->actor.velocity.y <= 0.0f) {
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
func_80AFF2A0(this);
|
||||
}
|
||||
}
|
||||
|
@ -1090,8 +1090,8 @@ void EnSkj_JumpFromStump(EnSkj* this) {
|
|||
|
||||
void EnSkj_WaitForLanding(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.velocity.y <= 0.0f) {
|
||||
if (this->actor.bgCheckFlags & 2) {
|
||||
this->actor.bgCheckFlags &= ~2;
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND_TOUCH;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
EnSkj_SetupWaitForLandAnimFinish(this);
|
||||
}
|
||||
|
|
|
@ -654,7 +654,7 @@ s32 EnSt_IsDoneBouncing(EnSt* this, GlobalContext* globalCtx) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!(this->actor.bgCheckFlags & 1)) {
|
||||
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
// the Skulltula is not on the ground.
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -639,13 +639,13 @@ void func_80B0DB00(EnSw* this, GlobalContext* globalCtx) {
|
|||
this->actor.shape.rot.z += 0x1000;
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5);
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) && (!(0.0f <= this->actor.velocity.y))) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(0.0f <= this->actor.velocity.y)) {
|
||||
if (this->actor.floorHeight <= BGCHECK_Y_MIN || this->actor.floorHeight >= 32000.0f) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->actor.bgCheckFlags &= ~1;
|
||||
this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND;
|
||||
|
||||
if (this->unk_38A == 0) {
|
||||
this->actionFunc = func_80B0DC7C;
|
||||
|
|
|
@ -228,7 +228,7 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) {
|
|||
f32 tmpf1;
|
||||
s16 sp4A;
|
||||
|
||||
if ((this->unk_29C != 0) && (this->unk_29E == 0) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((this->unk_29C != 0) && (this->unk_29E == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->unk_29C = 0;
|
||||
this->actionFunc = func_80B123A8;
|
||||
return;
|
||||
|
@ -298,7 +298,7 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
} else {
|
||||
this->unk_25C = 4;
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
|
||||
this->actor.velocity.y = 2.5f;
|
||||
if ((Rand_ZeroFloat(10.0f) < 1.0f) && (this->unk_29E == 0)) {
|
||||
this->unk_25C = 0xC;
|
||||
|
@ -402,7 +402,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 1) && (this->actor.world.pos.z > 110.0f)) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.world.pos.z > 110.0f)) {
|
||||
this->actor.velocity.y = 0.0f;
|
||||
this->actor.gravity = 0.0f;
|
||||
this->unk_284 = 0.0f;
|
||||
|
@ -532,7 +532,7 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) {
|
|||
this->unk_298++;
|
||||
this->unk_298 &= 1;
|
||||
this->unk_25C = (s16)Rand_CenteredFloat(4.0f) + 5;
|
||||
if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & 1)) {
|
||||
if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
this->actor.velocity.y = 4.0f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -816,10 +816,10 @@ void func_80860F84(EnTest* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) ||
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
((this->actor.params == STALFOS_TYPE_CEILING) &&
|
||||
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.world.rot.y))) {
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (this->actor.speedXZ >= 0.0f) {
|
||||
newYaw = this->actor.shape.rot.y + 0x3FFF;
|
||||
} else {
|
||||
|
@ -1222,8 +1222,9 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
|
|||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
EnTest_SetupJumpUp(this);
|
||||
} else if (!EnTest_ReactToProjectile(globalCtx, this)) {
|
||||
EnTest_ChooseAction(this, globalCtx);
|
||||
|
@ -1233,8 +1234,9 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (player->swordState != 0) {
|
||||
if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
EnTest_SetupJumpUp(this);
|
||||
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
|
||||
(player->swordAnimation != 0x11)) {
|
||||
|
@ -1272,8 +1274,9 @@ void func_80862418(EnTest* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (player->swordState != 0) {
|
||||
if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
EnTest_SetupJumpUp(this);
|
||||
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
|
||||
(player->swordAnimation != 0x11)) {
|
||||
|
@ -1318,7 +1321,7 @@ void EnTest_Stunned(EnTest* this, GlobalContext* globalCtx) {
|
|||
if (this->actor.colChkInfo.health == 0) {
|
||||
func_80862FA8(this, globalCtx);
|
||||
} else if (player->swordState != 0) {
|
||||
if ((this->actor.bgCheckFlags & 8) &&
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
|
||||
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
|
||||
(this->actor.xzDistToPlayer < 80.0f))) {
|
||||
EnTest_SetupJumpUp(this);
|
||||
|
@ -1387,10 +1390,10 @@ void func_808628C8(EnTest* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((this->actor.bgCheckFlags & 8) ||
|
||||
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ||
|
||||
((this->actor.params == STALFOS_TYPE_CEILING) &&
|
||||
!Actor_TestFloorInDirection(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF))) {
|
||||
if (this->actor.bgCheckFlags & 8) {
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
|
||||
if (this->actor.speedXZ >= 0.0f) {
|
||||
newYaw = (this->actor.shape.rot.y + 0x3FFF);
|
||||
} else {
|
||||
|
@ -1716,7 +1719,7 @@ void EnTest_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (this->actor.floorHeight <= this->actor.home.pos.y) {
|
||||
this->actor.floorHeight = this->actor.home.pos.y;
|
||||
}
|
||||
} else if (this->actor.bgCheckFlags & 2) {
|
||||
} else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) {
|
||||
floorProperty = func_80041EA4(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
|
||||
|
||||
if ((floorProperty == 5) || (floorProperty == 0xC) ||
|
||||
|
@ -1993,7 +1996,7 @@ s32 EnTest_ReactToProjectile(GlobalContext* globalCtx, EnTest* this) {
|
|||
if (projectileActor != NULL) {
|
||||
yawToProjectile = Actor_WorldYawTowardActor(&this->actor, projectileActor) - (u16)this->actor.shape.rot.y;
|
||||
|
||||
if ((u8)(this->actor.bgCheckFlags & 8)) {
|
||||
if ((u8)(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) {
|
||||
wallYawDiff = ((u16)this->actor.wallYaw - (u16)this->actor.shape.rot.y);
|
||||
touchingWall = true;
|
||||
} else {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue