Rename code_80043480.c from decomp (#4731)

This commit is contained in:
Jordan Longstaff 2024-12-20 18:26:42 -05:00 committed by GitHub
parent 35e0a7ce10
commit dd11751b43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
35 changed files with 126 additions and 115 deletions

View File

@ -717,15 +717,15 @@ void BgCheck_DrawStaticCollision(PlayState*, CollisionContext*);
void func_80043334(CollisionContext* colCtx, Actor* actor, s32 bgId);
s32 func_800433A4(CollisionContext* colCtx, s32 bgId, Actor* actor);
void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags);
void func_800434A0(DynaPolyActor* dynaActor);
void func_800434A8(DynaPolyActor* dynaActor);
void func_800434C8(CollisionContext* colCtx, s32 floorBgId);
void func_80043508(CollisionContext* colCtx, s32 floorBgId);
void func_80043538(DynaPolyActor* dynaActor);
s32 func_80043548(DynaPolyActor* dynaActor);
s32 func_8004356C(DynaPolyActor* dynaActor);
s32 func_80043590(DynaPolyActor* dynaActor);
s32 func_800435B4(DynaPolyActor* dynaActor);
void DynaPolyActor_UnsetAllInteractFlags(DynaPolyActor* dynaActor);
void DynaPolyActor_SetActorOnTop(DynaPolyActor* dynaActor);
void DynaPoly_SetPlayerOnTop(CollisionContext* colCtx, s32 floorBgId);
void DynaPoly_SetPlayerAbove(CollisionContext* colCtx, s32 floorBgId);
void DynaPolyActor_SetSwitchPressed(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsActorOnTop(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsPlayerOnTop(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsPlayerAbove(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsSwitchPressed(DynaPolyActor* dynaActor);
s32 func_800435D8(PlayState* play, DynaPolyActor* dynaActor, s16 arg2, s16 arg3, s16 arg4);
void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState* play);
void Camera_InitPlayerSettings(Camera* camera, Player* player);

View File

@ -214,6 +214,13 @@ if neither of the above are set : blue
0x2000 : translucent, else opaque
*/
#define DYNA_INTERACT_ACTOR_ON_TOP (1 << 0) // There is an actor standing on the collision of the dynapoly actor
#define DYNA_INTERACT_PLAYER_ON_TOP (1 << 1) // The player actor is standing on the collision of the dynapoly actor
#define DYNA_INTERACT_PLAYER_ABOVE \
(1 << 2) // The player is directly above the collision of the dynapoly actor (any distance above)
#define DYNA_INTERACT_ACTOR_SWITCH_PRESSED \
(1 << 3) // An actor that is capable of pressing switches is on top of the dynapoly actor
typedef struct DynaPolyActor {
/* 0x000 */ struct Actor actor;
/* 0x14C */ s32 bgId;
@ -221,8 +228,8 @@ typedef struct DynaPolyActor {
/* 0x154 */ f32 unk_154;
/* 0x158 */ s16 unk_158; // y rotation?
/* 0x15A */ u16 unk_15A;
/* 0x15C */ u32 unk_15C;
/* 0x160 */ u8 unk_160;
/* 0x15C */ u32 transformFlags;
/* 0x160 */ u8 interactFlags;
/* 0x162 */ s16 unk_162;
} DynaPolyActor; // size = 0x164

View File

@ -60,10 +60,10 @@ void func_80043334(CollisionContext* colCtx, Actor* actor, s32 bgId) {
if (DynaPoly_IsBgIdBgActor(bgId)) {
DynaPolyActor* dynaActor = DynaPoly_GetActor(colCtx, bgId);
if (dynaActor != NULL) {
func_800434A8(dynaActor);
DynaPolyActor_SetActorOnTop(dynaActor);
if (CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_CAN_PRESS_SWITCH)) {
func_80043538(dynaActor);
DynaPolyActor_SetSwitchPressed(dynaActor);
}
}
}
@ -91,12 +91,12 @@ s32 func_800433A4(CollisionContext* colCtx, s32 bgId, Actor* actor) {
return false;
}
if (dynaActor->unk_15C & 1) {
if (dynaActor->transformFlags & 1) {
func_800430A0(colCtx, bgId, actor);
result = true;
}
if (dynaActor->unk_15C & 2) {
if (dynaActor->transformFlags & 2) {
func_800432A0(colCtx, bgId, actor);
result = true;
}

View File

@ -2,74 +2,74 @@
void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags) {
dynaActor->bgId = -1;
dynaActor->unk_15C = flags;
dynaActor->unk_160 = 0;
dynaActor->transformFlags = flags;
dynaActor->interactFlags = 0;
dynaActor->unk_150 = 0.0f;
dynaActor->unk_154 = 0.0f;
}
void func_800434A0(DynaPolyActor* dynaActor) {
dynaActor->unk_160 = 0;
void DynaPolyActor_UnsetAllInteractFlags(DynaPolyActor* dynaActor) {
dynaActor->interactFlags = 0;
}
void func_800434A8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 1;
void DynaPolyActor_SetActorOnTop(DynaPolyActor* dynaActor) {
dynaActor->interactFlags |= DYNA_INTERACT_ACTOR_ON_TOP;
}
void func_800434B8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 2;
void DynaPolyActor_SetPlayerOnTop(DynaPolyActor* dynaActor) {
dynaActor->interactFlags |= DYNA_INTERACT_PLAYER_ON_TOP;
}
void func_800434C8(CollisionContext* colCtx, s32 floorBgId) {
void DynaPoly_SetPlayerOnTop(CollisionContext* colCtx, s32 floorBgId) {
DynaPolyActor* dynaActor = DynaPoly_GetActor(colCtx, floorBgId);
if (dynaActor != NULL) {
func_800434B8(dynaActor);
DynaPolyActor_SetPlayerOnTop(dynaActor);
}
}
void func_800434F8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 4;
void DynaPolyActor_SetPlayerAbove(DynaPolyActor* dynaActor) {
dynaActor->interactFlags |= DYNA_INTERACT_PLAYER_ABOVE;
}
void func_80043508(CollisionContext* colCtx, s32 floorBgId) {
void DynaPoly_SetPlayerAbove(CollisionContext* colCtx, s32 floorBgId) {
DynaPolyActor* dynaActor = DynaPoly_GetActor(colCtx, floorBgId);
if (dynaActor != NULL) {
func_800434F8(dynaActor);
DynaPolyActor_SetPlayerAbove(dynaActor);
}
}
void func_80043538(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 8;
void DynaPolyActor_SetSwitchPressed(DynaPolyActor* dynaActor) {
dynaActor->interactFlags |= DYNA_INTERACT_ACTOR_SWITCH_PRESSED;
}
s32 func_80043548(DynaPolyActor* dynaActor) {
if (dynaActor->unk_160 & 1) {
s32 DynaPolyActor_IsActorOnTop(DynaPolyActor* dynaActor) {
if (dynaActor->interactFlags & DYNA_INTERACT_ACTOR_ON_TOP) {
return true;
} else {
return false;
}
}
s32 func_8004356C(DynaPolyActor* dynaActor) {
if (dynaActor->unk_160 & 2) {
s32 DynaPolyActor_IsPlayerOnTop(DynaPolyActor* dynaActor) {
if (dynaActor->interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) {
return true;
} else {
return false;
}
}
s32 func_80043590(DynaPolyActor* dynaActor) {
if (dynaActor->unk_160 & 4) {
s32 DynaPolyActor_IsPlayerAbove(DynaPolyActor* dynaActor) {
if (dynaActor->interactFlags & DYNA_INTERACT_PLAYER_ABOVE) {
return true;
} else {
return false;
}
}
s32 func_800435B4(DynaPolyActor* dynaActor) {
if (dynaActor->unk_160 & 8) {
s32 DynaPolyActor_IsSwitchPressed(DynaPolyActor* dynaActor) {
if (dynaActor->interactFlags & DYNA_INTERACT_ACTOR_SWITCH_PRESSED) {
return true;
} else {
return false;

View File

@ -2954,7 +2954,7 @@ void func_8003F8EC(PlayState* play, DynaCollisionContext* dyna, Actor* actor) {
if ((dyna->bgActorFlags[i] & 1)) {
dynaActor = DynaPoly_GetActor(&play->colCtx, i);
if (dynaActor != NULL && &dynaActor->actor == actor) {
func_800434A0((DynaPolyActor*)actor);
DynaPolyActor_UnsetAllInteractFlags((DynaPolyActor*)actor);
return;
}
}

View File

@ -122,8 +122,8 @@ void EnAObj_Init(Actor* thisx, PlayState* play) {
thisx->focus.pos = thisx->world.pos;
this->dyna.bgId = BGACTOR_NEG_ONE;
this->dyna.unk_160 = 0;
this->dyna.unk_15C = DPM_UNK;
this->dyna.interactFlags = 0;
this->dyna.transformFlags = DPM_UNK;
thisx->uncullZoneDownward = 1200.0f;
thisx->uncullZoneScale = 200.0f;
@ -234,7 +234,7 @@ void EnAObj_SetupBlockRot(EnAObj* this, s16 type) {
void EnAObj_BlockRot(EnAObj* this, PlayState* play) {
if (this->rotateState == 0) {
if (this->dyna.unk_160 != 0) {
if (this->dyna.interactFlags != 0) {
this->rotateState++;
this->rotateForTimer = 20;

View File

@ -326,7 +326,7 @@ void func_8086C6EC(BgBdanObjects* this, PlayState* play) {
}
void func_8086C76C(BgBdanObjects* this, PlayState* play) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->dyna.actor.xzDistToPlayer < 120.0f) {
this->actionFunc = func_8086C7D0;
OnePointCutscene_Init(play, 3090, -99, &this->dyna.actor, MAIN_CAM);
@ -352,7 +352,7 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
this->timer--;
}
if (this->switchFlag == 0) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->cameraSetting = play->cameraPtrs[MAIN_CAM]->setting;
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_NORMAL2);
func_8005AD1C(play->cameraPtrs[MAIN_CAM], 4);
@ -360,7 +360,7 @@ void func_8086C874(BgBdanObjects* this, PlayState* play) {
}
} else {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_NORMAL2);
if (!func_8004356C(&this->dyna)) {
if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->switchFlag != 0) {
this->switchFlag--;
}
@ -411,7 +411,7 @@ void func_8086CABC(BgBdanObjects* this, PlayState* play) {
}
void func_8086CB10(BgBdanObjects* this, PlayState* play) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
Flags_SetSwitch(play, this->switchFlag);
this->timer = 50;
this->actionFunc = func_8086CB8C;

View File

@ -254,13 +254,13 @@ void func_8086D5C4(BgBdanSwitch* this) {
void func_8086D5E0(BgBdanSwitch* this, PlayState* play) {
switch (this->dyna.actor.params & 0xFF) {
case BLUE:
if (func_800435B4(&this->dyna)) {
if (DynaPolyActor_IsSwitchPressed(&this->dyna)) {
func_8086D67C(this);
func_8086D4B4(this, play);
}
break;
case YELLOW:
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
func_8086D67C(this);
func_8086D4B4(this, play);
}
@ -293,7 +293,7 @@ void func_8086D730(BgBdanSwitch* this) {
void func_8086D754(BgBdanSwitch* this, PlayState* play) {
switch (this->dyna.actor.params & 0xFF) {
case BLUE:
if (!func_800435B4(&this->dyna)) {
if (!DynaPolyActor_IsSwitchPressed(&this->dyna)) {
if (this->unk_1D8 <= 0) {
func_8086D7FC(this);
func_8086D548(this, play);
@ -328,7 +328,7 @@ void func_8086D86C(BgBdanSwitch* this) {
}
void func_8086D888(BgBdanSwitch* this, PlayState* play) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
func_8086D8BC(this);
}
}
@ -371,7 +371,7 @@ void func_8086D9F8(BgBdanSwitch* this) {
void func_8086DA1C(BgBdanSwitch* this, PlayState* play) {
Actor* heldActor = GET_PLAYER(play)->heldActor;
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (heldActor != NULL && heldActor->id == ACTOR_EN_RU1) {
if (this->unk_1D8 <= 0) {
func_8086D944(this);

View File

@ -60,7 +60,7 @@ void BgGndFiremeiro_Destroy(Actor* thisx, PlayState* play2) {
void BgGndFiremeiro_Sink(BgGndFiremeiro* this, PlayState* play) {
f32 sunkHeight = this->initPos.y - 150.0f;
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->timer = 10;
}
@ -85,7 +85,7 @@ void BgGndFiremeiro_Shake(BgGndFiremeiro* this, PlayState* play) {
s32 pad;
f32 randSign;
if (func_8004356C(&this->dyna)) { // Player standing on it
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { // Player standing on it
if (this->timer > 0) {
this->timer--;
@ -114,7 +114,7 @@ void BgGndFiremeiro_Rise(BgGndFiremeiro* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Actor* thisx = &this->dyna.actor;
if ((player->currentBoots != PLAYER_BOOTS_HOVER) && func_8004356C(&this->dyna)) { // Player standing on it
if ((player->currentBoots != PLAYER_BOOTS_HOVER) && DynaPolyActor_IsPlayerOnTop(&this->dyna)) { // Player standing on it
if (thisx->world.pos.y < this->initPos.y) {
this->actionFunc = BgGndFiremeiro_Sink;
this->timer = 20;

View File

@ -179,7 +179,7 @@ void BgHakaShip_CrashFall(BgHakaShip* this, PlayState* play) {
}
} else {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCKSINK - SFX_FLAG);
if ((this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y > 500.0f) && func_8004356C(&this->dyna)) {
if ((this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y > 500.0f) && DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
Play_TriggerVoidOut(play);
}
}

View File

@ -90,7 +90,7 @@ void func_80886FCC(BgHidanFslift* this, PlayState* play) {
if ((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) < 0.5f) {
heightBool = true;
}
if (func_80043590(&this->dyna) && (heightBool)) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna) && (heightBool)) {
this->actionFunc = func_808870D8;
} else if (!heightBool) {
this->actionFunc = func_8088706C;
@ -109,7 +109,7 @@ void func_8088706C(BgHidanFslift* this, PlayState* play) {
}
void func_808870D8(BgHidanFslift* this, PlayState* play) {
if (func_80043590(&this->dyna)) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 790.0f, 4.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this);
@ -126,12 +126,12 @@ void BgHidanFslift_Update(Actor* thisx, PlayState* play) {
BgHidanFslift* this = (BgHidanFslift*)thisx;
this->actionFunc(this, play);
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_16A == 0) {
this->unk_16A = 3;
}
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM);
} else if (!func_8004356C(&this->dyna)) {
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_16A != 0) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
}

View File

@ -216,7 +216,7 @@ void func_808896B8(BgHidanHrock* this, PlayState* play) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 5.0f, 1.0f);
} else {
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f);

View File

@ -212,7 +212,7 @@ void func_8088B5F4(BgHidanRock* this, PlayState* play) {
}
void func_8088B634(BgHidanRock* this, PlayState* play) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->timer = 20;
this->dyna.actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x4000;
this->actionFunc = func_8088B69C;
@ -263,12 +263,12 @@ void func_8088B79C(BgHidanRock* this, PlayState* play) {
this->unk_16C = CLAMP_MIN(this->unk_16C, 0.0f);
if (this->type == 0) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_169 == 0) {
this->unk_169 = 3;
}
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM);
} else if (!func_8004356C(&this->dyna)) {
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_169 != 0) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
}
@ -316,12 +316,12 @@ void func_8088B990(BgHidanRock* this, PlayState* play) {
this->unk_16C = (this->dyna.actor.world.pos.y + 50.0f - this->dyna.actor.home.pos.y + 40.0f) / 80.0f;
if (this->type == 0) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_169 == 0) {
this->unk_169 = 3;
}
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM);
} else if (!func_8004356C(&this->dyna)) {
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_169 != 0) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
}

View File

@ -118,7 +118,7 @@ void func_8088E518(BgHidanSima* this, PlayState* play) {
Player* player = GET_PLAYER(play);
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.4f);
if (func_8004356C(&this->dyna) && !(player->stateFlags1 & (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE))) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && !(player->stateFlags1 & (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE))) {
this->timer = 20;
this->dyna.actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x4000;
if (this->dyna.actor.home.pos.y <= this->dyna.actor.world.pos.y) {
@ -150,7 +150,7 @@ void func_8088E5D0(BgHidanSima* this, PlayState* play) {
}
void func_8088E6D0(BgHidanSima* this, PlayState* play) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->timer = 20;
} else if (this->timer != 0) {
this->timer--;

View File

@ -61,7 +61,7 @@ void func_8088F47C(BgHidanSyoku* this) {
}
void func_8088F4B8(BgHidanSyoku* this, PlayState* play) {
if (Flags_GetClear(play, this->dyna.actor.room) && func_8004356C(&this->dyna)) {
if (Flags_GetClear(play, this->dyna.actor.room) && DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->timer = 140;
this->actionFunc = func_8088F514;
}
@ -109,12 +109,12 @@ void BgHidanSyoku_Update(Actor* thisx, PlayState* play) {
BgHidanSyoku* this = (BgHidanSyoku*)thisx;
this->actionFunc(this, play);
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_168 == 0) {
this->unk_168 = 3;
}
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM);
} else if (!func_8004356C(&this->dyna)) {
} else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->unk_168 != 0) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
}

View File

@ -187,7 +187,7 @@ void BgJya1flift_Update(Actor* thisx, PlayState* play2) {
// Room 0 is the first room and 6 is the room that the lift starts on
if (play->roomCtx.curRoom.num == 6 || play->roomCtx.curRoom.num == 0) {
this->actionFunc(this, play);
tempIsRiding = func_8004356C(&this->dyna) ? true : false;
tempIsRiding = DynaPolyActor_IsPlayerOnTop(&this->dyna) ? true : false;
if ((this->actionFunc == BgJya1flift_Move) || (this->actionFunc == BgJya1flift_DelayMove)) {
if (tempIsRiding) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_FIRE_PLATFORM);

View File

@ -146,13 +146,14 @@ void BgJyaLift_Update(Actor* thisx, PlayState* play2) {
if (this->actionFunc != NULL) {
this->actionFunc(this, play);
}
if ((this->dyna.unk_160 & 4) && ((this->unk_16B & 4) == 0)) {
if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ABOVE) &&
((this->unk_16B & DYNA_INTERACT_PLAYER_ABOVE) == 0)) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DIRECTED_YAW);
} else if (((this->dyna.unk_160) & 4) == 0 && ((this->unk_16B & 4)) &&
} else if (((this->dyna.interactFlags) & 4) == 0 && ((this->unk_16B & 4)) &&
(play->cameraPtrs[MAIN_CAM]->setting == CAM_SET_DIRECTED_YAW)) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
}
this->unk_16B = this->dyna.unk_160;
this->unk_16B = this->dyna.interactFlags;
// Spirit Temple room 5 is the main room with the statue room 25 is directly above room 5
if ((play->roomCtx.curRoom.num != 5) && (play->roomCtx.curRoom.num != 25)) {

View File

@ -51,7 +51,7 @@ void BgMenkuriKaiten_Destroy(Actor* thisx, PlayState* play) {
void BgMenkuriKaiten_Update(Actor* thisx, PlayState* play) {
BgMenkuriKaiten* this = (BgMenkuriKaiten*)thisx;
if (!Flags_GetSwitch(play, this->dyna.actor.params) && func_80043590(&this->dyna)) {
if (!Flags_GetSwitch(play, this->dyna.actor.params) && DynaPolyActor_IsPlayerAbove(&this->dyna)) {
func_8002F974(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG);
this->dyna.actor.shape.rot.y += 0x80;
}

View File

@ -241,7 +241,7 @@ void BgMoriBigst_Update(Actor* thisx, PlayState* play) {
if (this->waitTimer > 0) {
this->waitTimer--;
}
if (func_80043590(&this->dyna)) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna)) {
func_80074CE8(play, 6);
}
if (this->actionFunc != NULL) {

View File

@ -125,7 +125,8 @@ void BgMoriElevator_Destroy(Actor* thisx, PlayState* play) {
}
s32 BgMoriElevator_IsPlayerRiding(BgMoriElevator* this, PlayState* play) {
return ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2) &&
return ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) &&
!(this->unk_170 & DYNA_INTERACT_PLAYER_ON_TOP) &&
((GET_PLAYER(play)->actor.world.pos.y - this->dyna.actor.world.pos.y) < 80.0f));
}
@ -244,7 +245,7 @@ void BgMoriElevator_Update(Actor* thisx, PlayState* play) {
BgMoriElevator* this = (BgMoriElevator*)thisx;
this->actionFunc(this, play);
this->unk_170 = this->dyna.unk_160;
this->unk_170 = this->dyna.interactFlags;
this->unk_16C = Flags_GetSwitch(play, (thisx->params & 0x3F));
}

View File

@ -101,7 +101,7 @@ void BgSpot08Iceblock_SinkUnderPlayer(BgSpot08Iceblock* this) {
}
// Sink under Player's weight if standing on it
target = (func_80043548(&this->dyna) ? -4.0f : 0.0f);
target = (DynaPolyActor_IsActorOnTop(&this->dyna) ? -4.0f : 0.0f);
Math_StepToF(&this->sinkOffset, target, step);
}
@ -200,7 +200,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) {
surfaceNormalHorizontal.z = this->surfaceNormal.z;
// If player is standing on it or holding the edge
if (func_8004356C(&this->dyna) && (playerCentroidDist > 3.0f)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && (playerCentroidDist > 3.0f)) {
Math_Vec3f_Diff(&playerCentroidDiff, &surfaceNormalHorizontal, &playerMoment);
BgSpot08Iceblock_MultVectorScalar(&playerMoment, &playerMoment,
(sInertias[rollDataIndex] * playerCentroidDist) / this->dyna.actor.scale.x);

View File

@ -62,13 +62,13 @@ void BgSstFloor_Update(BgSstFloor* thisx, PlayState* play) {
colHeader->vtxList = SEGMENTED_TO_VIRTUAL(colHeader->vtxList);
if (func_80043590(&this->dyna) && (this->dyna.actor.yDistToPlayer < 1000.0f)) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna) && (this->dyna.actor.yDistToPlayer < 1000.0f)) {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_BOSS_BONGO);
} else {
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0);
}
if (func_8004356C(&this->dyna) && (player->fallDistance > 1000.0f)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && (player->fallDistance > 1000.0f)) {
this->dyna.actor.params = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_SHADEST_TAIKO_HIGH);
}
@ -82,7 +82,7 @@ void BgSstFloor_Update(BgSstFloor* thisx, PlayState* play) {
this->dyna.actor.params = BONGOFLOOR_REST;
this->drumPhase = 28;
if (func_8004356C(&this->dyna) && !(player->stateFlags1 & (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE))) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && !(player->stateFlags1 & (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE))) {
distFromRim = 600.0f - this->dyna.actor.xzDistToPlayer;
if (distFromRim > 0.0f) {
if (distFromRim > 350.0f) {

View File

@ -292,7 +292,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) {
BgYdanSp_BurnWeb(this, play);
return;
}
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
sqrtFallDistance = sqrtf(CLAMP_MIN(player->fallDistance, 0.0f));
if (player->fallDistance > 750.0f) {
if (this->dyna.actor.xzDistToPlayer < 80.0f) {

View File

@ -154,7 +154,7 @@ void func_809CB054(EnBrob* this, PlayState* play) {
this->timer--;
}
if (this->timer == 0) {
if (func_8004356C(&this->dyna) != 0) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna) != 0) {
func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 1.0f);
func_809CAE44(this, play);
} else if (this->dyna.actor.xzDistToPlayer < 300.0f) {

View File

@ -52,8 +52,8 @@ void EnLightbox_Init(Actor* thisx, PlayState* play) {
thisx->colChkInfo.cylRadius = 30;
thisx->colChkInfo.cylHeight = 50;
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f);
this->dyna.unk_160 = 0;
this->dyna.unk_15C = 0;
this->dyna.interactFlags = 0;
this->dyna.transformFlags = 0;
thisx->targetMode = 0;
thisx->gravity = -2.0f;
CollisionHeader_GetVirtual(&object_lightbox_Col_001F10, &colHeader);

View File

@ -52,8 +52,8 @@ void EnPubox_Init(Actor* thisx, PlayState* play) {
thisx->uncullZoneDownward = 1200.0f;
thisx->uncullZoneScale = 720.0f;
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f);
this->dyna.unk_160 = 0;
this->dyna.unk_15C = DPM_UNK;
this->dyna.interactFlags = 0;
this->dyna.transformFlags = DPM_UNK;
thisx->targetMode = 1;
thisx->gravity = -2.0f;
CollisionHeader_GetVirtual(&gBlockMediumCol, &colHeader);

View File

@ -128,7 +128,7 @@ void func_80AFBE8C(EnSiofuki* this, PlayState* play) {
if ((dX > (this->dyna.actor.scale.x * -346.0f)) && (dX < (this->dyna.actor.scale.x * 346.0f)) &&
(dZ > (this->dyna.actor.scale.z * -400.0f)) && (dZ < (this->dyna.actor.scale.z * 400.0f)) && (dY < 0.0f)) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->splashTimer <= 0) {
EffectSsGSplash_Spawn(play, &player->actor.world.pos, NULL, NULL, 1, 1);
this->splashTimer = 10;

View File

@ -752,7 +752,7 @@ void ObjBean_SetupWaitForPlayer(ObjBean* this) {
}
void ObjBean_WaitForPlayer(ObjBean* this, PlayState* play) {
if (func_8004356C(&this->dyna)) { // Player is standing on
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { // Player is standing on
ObjBean_SetupFly(this);
if (play->sceneNum == SCENE_LOST_WOODS) { // Lost woods
Camera_ChangeSetting(play->cameraPtrs[MAIN_CAM], CAM_SET_BEAN_LOST_WOODS);
@ -786,7 +786,7 @@ void ObjBean_Fly(ObjBean* this, PlayState* play) {
Camera_ChangeSetting(camera, CAM_SET_NORMAL0);
}
} else if (func_8004356C(&this->dyna) != 0) { // Player is on top
} else if (DynaPolyActor_IsPlayerOnTop(&this->dyna) != 0) { // Player is on top
func_8002F974(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG);
@ -812,7 +812,7 @@ void ObjBean_SetupWaitForStepOff(ObjBean* this) {
}
void ObjBean_WaitForStepOff(ObjBean* this, PlayState* play) {
if (!func_80043590(&this->dyna)) {
if (!DynaPolyActor_IsPlayerAbove(&this->dyna)) {
ObjBean_SetupWaitForPlayer(this);
}
ObjBean_UpdatePosition(this);
@ -824,7 +824,7 @@ void func_80B908EC(ObjBean* this) {
}
void func_80B90918(ObjBean* this, PlayState* play) {
if (!func_8004356C(&this->dyna)) {
if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
ObjBean_SetupPathCount(this, play);
ObjBean_SetupPath(this, play);
ObjBean_Move(this);
@ -904,7 +904,7 @@ void ObjBean_Update(Actor* thisx, PlayState* play) {
}
Actor_SetFocus(&this->dyna.actor, 6.0f);
if (this->stateFlags & BEAN_STATE_DYNAPOLY_SET) {
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
this->stateFlags |= BEAN_STATE_PLAYER_ON_TOP;
} else {
this->stateFlags &= ~BEAN_STATE_PLAYER_ON_TOP;

View File

@ -86,7 +86,7 @@ void func_80B92C80(ObjElevator* this, PlayState* play) {
f32 sub;
Actor* thisx = &this->dyna.actor;
if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) {
if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) && !(this->unk_170 & DYNA_INTERACT_PLAYER_ON_TOP)) {
sub = thisx->world.pos.y - thisx->home.pos.y;
if (fabsf(sub) < 0.1f) {
this->unk_168 = thisx->home.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f;
@ -118,7 +118,7 @@ void ObjElevator_Update(Actor* thisx, PlayState* play) {
if (this->actionFunc) {
this->actionFunc(this, play);
}
this->unk_170 = this->dyna.unk_160;
this->unk_170 = this->dyna.interactFlags;
}
void ObjElevator_Draw(Actor* thisx, PlayState* play) {

View File

@ -138,7 +138,7 @@ void func_80B96560(ObjLift* this, PlayState* play) {
s32 pad;
s32 quakeIndex;
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (this->timer <= 0) {
if (((this->dyna.actor.params >> 8) & 7) == 7) {
func_80B967C0(this);

View File

@ -509,8 +509,8 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) {
} else {
dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId);
if (dynaPolyActor != NULL) {
func_800434A8(dynaPolyActor);
func_80043538(dynaPolyActor);
DynaPolyActor_SetActorOnTop(dynaPolyActor);
DynaPolyActor_SetSwitchPressed(dynaPolyActor);
if ((this->timer <= 0) && (fabsf(this->dyna.unk_150) > 0.001f)) {
if (ObjOshihiki_StrongEnough(this) && ObjOshihiki_NoSwitchPress(this, dynaPolyActor, play) &&
@ -537,9 +537,9 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) {
} else {
dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId);
if ((dynaPolyActor != NULL) && (dynaPolyActor->unk_15C & 1)) {
func_800434A8(dynaPolyActor);
func_80043538(dynaPolyActor);
if ((dynaPolyActor != NULL) && (dynaPolyActor->transformFlags & 1)) {
DynaPolyActor_SetActorOnTop(dynaPolyActor);
DynaPolyActor_SetSwitchPressed(dynaPolyActor);
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
} else {
ObjOshihiki_SetupFall(this, play);

View File

@ -390,25 +390,26 @@ void ObjSwitch_FloorUp(ObjSwitch* this, PlayState* play) {
} else {
switch ((this->dyna.actor.params >> 4 & 7)) {
case OBJSWITCH_SUBTYPE_FLOOR_0:
if (func_8004356C(&this->dyna)) {
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
ObjSwitch_FloorPressInit(this);
ObjSwitch_SetOn(this, play);
}
break;
case OBJSWITCH_SUBTYPE_FLOOR_1:
if ((this->dyna.unk_160 & 2) && !(this->unk_17F & 2)) {
if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) &&
!(this->unk_17F & DYNA_INTERACT_PLAYER_ON_TOP)) {
ObjSwitch_FloorPressInit(this);
ObjSwitch_SetOn(this, play);
}
break;
case OBJSWITCH_SUBTYPE_FLOOR_2:
if (func_800435B4(&this->dyna)) {
if (DynaPolyActor_IsSwitchPressed(&this->dyna)) {
ObjSwitch_FloorPressInit(this);
ObjSwitch_SetOn(this, play);
}
break;
case OBJSWITCH_SUBTYPE_FLOOR_3:
if (func_800435B4(&this->dyna)) {
if (DynaPolyActor_IsSwitchPressed(&this->dyna)) {
ObjSwitch_FloorPressInit(this);
ObjSwitch_SetOff(this, play);
}
@ -448,14 +449,15 @@ void ObjSwitch_FloorDown(ObjSwitch* this, PlayState* play) {
}
break;
case OBJSWITCH_SUBTYPE_FLOOR_1:
if ((this->dyna.unk_160 & 2) && !(this->unk_17F & 2)) {
if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) &&
!(this->unk_17F & DYNA_INTERACT_PLAYER_ON_TOP)) {
ObjSwitch_FloorReleaseInit(this);
ObjSwitch_SetOff(this, play);
}
break;
case OBJSWITCH_SUBTYPE_FLOOR_2:
case OBJSWITCH_SUBTYPE_FLOOR_3:
if (!func_800435B4(&this->dyna) && !Player_InCsMode(play)) {
if (!DynaPolyActor_IsSwitchPressed(&this->dyna) && !Player_InCsMode(play)) {
if (this->releaseTimer <= 0) {
ObjSwitch_FloorReleaseInit(this);
if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_FLOOR_2) {
@ -695,7 +697,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) {
switch ((this->dyna.actor.params & 7)) {
case OBJSWITCH_TYPE_FLOOR:
case OBJSWITCH_TYPE_FLOOR_RUSTY:
this->unk_17F = this->dyna.unk_160;
this->unk_17F = this->dyna.interactFlags;
break;
case OBJSWITCH_TYPE_EYE:
this->unk_17F = this->tris.col.base.acFlags;

View File

@ -148,7 +148,7 @@ void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) {
}
u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, PlayState* play) {
if (this->isVisible && func_80043590(&this->dyna)) {
if (this->isVisible && DynaPolyActor_IsPlayerAbove(&this->dyna)) {
return false;
}

View File

@ -82,7 +82,7 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) {
Vec3f sp20;
f32 temp_f2;
if (func_80043590(&this->dyna)) {
if (DynaPolyActor_IsPlayerAbove(&this->dyna)) {
return 0;
}

View File

@ -11236,7 +11236,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
func_80074CE8(play,
SurfaceType_GetLightSettingIndex(&play->colCtx, floorPoly, this->actor.floorBgId));
} else {
func_80043508(&play->colCtx, this->actor.floorBgId);
DynaPoly_SetPlayerAbove(&play->colCtx, this->actor.floorBgId);
}
}
@ -11438,7 +11438,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
s32 pad3;
if (this->actor.floorBgId != BGCHECK_SCENE) {
func_800434C8(&play->colCtx, this->actor.floorBgId);
DynaPoly_SetPlayerOnTop(&play->colCtx, this->actor.floorBgId);
}
floorPolyNormalX = COLPOLY_GET_NORMAL(floorPoly->normal.x);