Animation Cleanup: En_P* (#1507)

* anim P cleanup

* PR Review

* PR Review

* Postbox Idle
This commit is contained in:
engineer124 2023-11-22 16:10:55 +11:00 committed by GitHub
parent 2b4610670f
commit 5ef277df2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 601 additions and 446 deletions

View File

@ -1,7 +1,7 @@
<Root> <Root>
<!-- This is the object for the Postbox Prop --> <!-- This is the object for the Postbox Prop -->
<File Name="object_pst" Segment="6"> <File Name="object_pst" Segment="6">
<Animation Name="gPostboxOpenSlotAnim" Offset="0x18" /> <Animation Name="gPostboxIdleAnim" Offset="0x18" />
<DList Name="gPostboxFrameDL" Offset="0x4A0" /> <DList Name="gPostboxFrameDL" Offset="0x4A0" />
<DList Name="gPostboxMailSlotDL" Offset="0x638" /> <DList Name="gPostboxMailSlotDL" Offset="0x638" />
<Texture Name="gPostboxWoodRoofTex" OutName="postbox_wood_roof" Format="rgba16" Width="32" Height="32" Offset="0x760" /> <Texture Name="gPostboxWoodRoofTex" OutName="postbox_wood_roof" Format="rgba16" Width="32" Height="32" Offset="0x760" />

View File

@ -327,7 +327,7 @@ s32 func_800B8718(Actor* actor, GameState* gameState);
s32 func_800B874C(Actor* actor, PlayState* play, f32 xzRange, f32 yRange); s32 func_800B874C(Actor* actor, PlayState* play, f32 xzRange, f32 yRange);
s32 func_800B8804(Actor* actor, PlayState* play, f32 xzRange); s32 func_800B8804(Actor* actor, PlayState* play, f32 xzRange);
s32 func_800B886C(Actor* actor, PlayState* play); s32 func_800B886C(Actor* actor, PlayState* play);
void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y); void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* posX, s16* posY);
bool Actor_OnScreen(PlayState* play, Actor* actor); bool Actor_OnScreen(PlayState* play, Actor* actor);
s32 Actor_HasParent(Actor* actor, PlayState* play); s32 Actor_HasParent(Actor* actor, PlayState* play);
s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 xzRange, f32 yRange); s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 xzRange, f32 yRange);

View File

@ -2096,14 +2096,14 @@ s32 func_800B886C(Actor* actor, PlayState* play) {
return false; return false;
} }
void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* x, s16* y) { void Actor_GetScreenPos(PlayState* play, Actor* actor, s16* posX, s16* posY) {
Vec3f projectedPos; Vec3f projectedPos;
f32 invW; f32 invW;
Actor_GetProjectedPos(play, &actor->focus.pos, &projectedPos, &invW); Actor_GetProjectedPos(play, &actor->focus.pos, &projectedPos, &invW);
*x = PROJECTED_TO_SCREEN_X(projectedPos, invW); *posX = PROJECTED_TO_SCREEN_X(projectedPos, invW);
*y = PROJECTED_TO_SCREEN_Y(projectedPos, invW); *posY = PROJECTED_TO_SCREEN_Y(projectedPos, invW);
} }
bool Actor_OnScreen(PlayState* play, Actor* actor) { bool Actor_OnScreen(PlayState* play, Actor* actor) {
@ -3499,12 +3499,13 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
} }
bool Target_InTargetableScreenRegion(PlayState* play, Actor* actor) { bool Target_InTargetableScreenRegion(PlayState* play, Actor* actor) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
Actor_GetScreenPos(play, actor, &x, &y); Actor_GetScreenPos(play, actor, &screenPosX, &screenPosY);
return (x > -20) && (x < gScreenWidth + 20) && (y > -160) && (y < gScreenHeight + 160); return (screenPosX > -20) && (screenPosX < gScreenWidth + 20) && (screenPosY > -160) &&
(screenPosY < gScreenHeight + 160);
} }
/** /**

View File

@ -1313,8 +1313,8 @@ s32 Camera_CalcAtForScreen(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, f32* f
s32 pad; s32 pad;
f32 clampedDeltaY; f32 clampedDeltaY;
f32 clampedAbsScreenY; f32 clampedAbsScreenY;
s16 absScreenY; s16 absScreenPosY;
s16 screenY; s16 screenPosY;
PosRot* focalActorPosRot = &camera->focalActorPosRot; PosRot* focalActorPosRot = &camera->focalActorPosRot;
f32 focalActorHeight = Camera_GetFocalActorHeight(camera); f32 focalActorHeight = Camera_GetFocalActorHeight(camera);
@ -1322,21 +1322,21 @@ s32 Camera_CalcAtForScreen(Camera* camera, VecGeo* eyeAtDir, f32 yOffset, f32* f
focalActorAtOffsetTarget.x = 0.0f; focalActorAtOffsetTarget.x = 0.0f;
focalActorAtOffsetTarget.z = 0.0f; focalActorAtOffsetTarget.z = 0.0f;
Actor_GetScreenPos(camera->play, camera->focalActor, &absScreenY, &screenY); Actor_GetScreenPos(camera->play, camera->focalActor, &absScreenPosY, &screenPosY);
screenY -= SCREEN_HEIGHT / 2; screenPosY -= SCREEN_HEIGHT / 2;
absScreenY = ABS(screenY); absScreenPosY = ABS(screenPosY);
// result unused // result unused
clampedAbsScreenY = OLib_ClampMaxDist(absScreenY / (f32)(SCREEN_HEIGHT / 2), 1.0f); clampedAbsScreenY = OLib_ClampMaxDist(absScreenPosY / (f32)(SCREEN_HEIGHT / 2), 1.0f);
deltaY = focalActorPosRot->pos.y - *focalActorPosY; deltaY = focalActorPosRot->pos.y - *focalActorPosY;
clampedDeltaY = OLib_ClampMaxDist(deltaY, deltaYMax); clampedDeltaY = OLib_ClampMaxDist(deltaY, deltaYMax);
if (absScreenY > (SCREEN_HEIGHT / 4)) { if (absScreenPosY > (SCREEN_HEIGHT / 4)) {
absScreenY = SCREEN_HEIGHT / 4; absScreenPosY = SCREEN_HEIGHT / 4;
} }
clampedAbsScreenY = OLib_ClampMaxDist(absScreenY / (f32)(SCREEN_HEIGHT / 4), 1.0f); clampedAbsScreenY = OLib_ClampMaxDist(absScreenPosY / (f32)(SCREEN_HEIGHT / 4), 1.0f);
focalActorAtOffsetTarget.y -= clampedDeltaY * clampedAbsScreenY * clampedAbsScreenY; focalActorAtOffsetTarget.y -= clampedDeltaY * clampedAbsScreenY * clampedAbsScreenY;
Camera_ScaledStepToCeilVec3f(&focalActorAtOffsetTarget, &camera->focalActorAtOffset, camera->xzOffsetUpdateRate, Camera_ScaledStepToCeilVec3f(&focalActorAtOffsetTarget, &camera->focalActorAtOffset, camera->xzOffsetUpdateRate,
@ -3785,8 +3785,8 @@ s32 Camera_Battle1(Camera* camera) {
rwData->unk_1A &= ~0x10; rwData->unk_1A &= ~0x10;
} else if (!camera->play->envCtx.skyboxDisabled || (roData->interfaceFlags & BATTLE1_FLAG_0)) { } else if (!camera->play->envCtx.skyboxDisabled || (roData->interfaceFlags & BATTLE1_FLAG_0)) {
if (func_800CBC84(camera, at, &spC4, 0) != 0) { if (func_800CBC84(camera, at, &spC4, 0) != 0) {
s16 screenX; s16 screenPosX;
s16 screenY; s16 screenPosY;
rwData->unk_1A |= 0x1000; rwData->unk_1A |= 0x1000;
spF8 = OLib_Vec3fDist(at, &focalActorFocus->pos); spF8 = OLib_Vec3fDist(at, &focalActorFocus->pos);
@ -3796,10 +3796,10 @@ s32 Camera_Battle1(Camera* camera) {
spF4 = OLib_Vec3fDist(at, &spC4.pos); spF4 = OLib_Vec3fDist(at, &spC4.pos);
spF8 += (rwData->unk_1A & 0x10) ? 40.0f : 0.0f; spF8 += (rwData->unk_1A & 0x10) ? 40.0f : 0.0f;
Actor_GetScreenPos(camera->play, camera->focalActor, &screenX, &screenY); Actor_GetScreenPos(camera->play, camera->focalActor, &screenPosX, &screenPosY);
if ((spF4 < spF8) || if ((spF4 < spF8) || ((screenPosX >= 0) && (screenPosX <= SCREEN_WIDTH) && (screenPosY >= 0) &&
((screenX >= 0) && (screenX <= SCREEN_WIDTH) && (screenY >= 0) && (screenY <= SCREEN_HEIGHT))) { (screenPosY <= SCREEN_HEIGHT))) {
rwData->unk_1A |= 0x10; rwData->unk_1A |= 0x10;
spB4.yaw = spA4.yaw + 0x8000; spB4.yaw = spA4.yaw + 0x8000;
spB4.pitch = -spA4.pitch; spB4.pitch = -spA4.pitch;
@ -4140,18 +4140,18 @@ s32 Camera_KeepOn1(Camera* camera) {
rwData->unk_18 &= ~0x10; rwData->unk_18 &= ~0x10;
} else if (!camera->play->envCtx.skyboxDisabled || (roData->interfaceFlags & KEEPON1_FLAG_0)) { } else if (!camera->play->envCtx.skyboxDisabled || (roData->interfaceFlags & KEEPON1_FLAG_0)) {
if (func_800CBC84(camera, at, &sp7C, 0) != 0) { if (func_800CBC84(camera, at, &sp7C, 0) != 0) {
s16 screenX; s16 screenPosX;
s16 screenY; s16 screenPosY;
rwData->unk_18 |= 0x1000; rwData->unk_18 |= 0x1000;
spF8 = OLib_Vec3fDist(at, &focalActorFocus->pos); spF8 = OLib_Vec3fDist(at, &focalActorFocus->pos);
spF4 = OLib_Vec3fDist(at, &sp7C.pos); spF4 = OLib_Vec3fDist(at, &sp7C.pos);
spF8 += (rwData->unk_18 & 0x10) ? 40 : 0.0f; spF8 += (rwData->unk_18 & 0x10) ? 40 : 0.0f;
Actor_GetScreenPos(camera->play, camera->focalActor, &screenX, &screenY); Actor_GetScreenPos(camera->play, camera->focalActor, &screenPosX, &screenPosY);
if ((spF4 < spF8) || if ((spF4 < spF8) || ((screenPosX >= 0) && (screenPosX <= SCREEN_WIDTH) && (screenPosY >= 0) &&
((screenX >= 0) && (screenX <= SCREEN_WIDTH) && (screenY >= 0) && (screenY <= SCREEN_HEIGHT))) { (screenPosY <= SCREEN_HEIGHT))) {
rwData->unk_18 |= 0x10; rwData->unk_18 |= 0x10;
spE0.yaw = (s16)(spD0.yaw + 0x8000); spE0.yaw = (s16)(spD0.yaw + 0x8000);
spE0.pitch = -spD0.pitch; spE0.pitch = -spD0.pitch;
@ -5642,8 +5642,8 @@ s32 Camera_Demo1(Camera* camera) {
PosRot* targetPosRot = &camera->targetPosRot; PosRot* targetPosRot = &camera->targetPosRot;
f32 temp_f0; f32 temp_f0;
Actor* sp98[1]; Actor* sp98[1];
s16 screenX; s16 screenPosX;
s16 screenY; s16 screenPosY;
s32 phi_v0; s32 phi_v0;
VecGeo sp88; VecGeo sp88;
PosRot sp74; PosRot sp74;
@ -5671,10 +5671,11 @@ s32 Camera_Demo1(Camera* camera) {
camera->animState++; camera->animState++;
} }
Actor_GetScreenPos(camera->play, camera->target, &screenX, &screenY); Actor_GetScreenPos(camera->play, camera->target, &screenPosX, &screenPosY);
temp_f0 = rwData->unk_0C.r; temp_f0 = rwData->unk_0C.r;
if ((screenX > 20) && (screenX < (SCREEN_WIDTH - 20)) && (screenY > 40) && (screenY < (SCREEN_HEIGHT - 40))) { if ((screenPosX > 20) && (screenPosX < (SCREEN_WIDTH - 20)) && (screenPosY > 40) &&
(screenPosY < (SCREEN_HEIGHT - 40))) {
if (temp_f0 < 700.0f) { if (temp_f0 < 700.0f) {
phi_v0 = 0; phi_v0 = 0;
} else { } else {

View File

@ -5208,11 +5208,11 @@ void Message_Update(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx; PauseContext* pauseCtx = &play->pauseCtx;
InterfaceContext* interfaceCtx = &play->interfaceCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx;
Input* input = CONTROLLER1(&play->state); Input* input = CONTROLLER1(&play->state);
s16 averageY; s16 avgScreenPosY;
s16 sp50; s16 screenPosX;
u16 temp_v1_2; u16 temp_v1_2;
s16 sp4C; s16 playerScreenPosY;
s16 sp4A; s16 actorScreenPosY;
s16 sp48; s16 sp48;
s32 sp44; s32 sp44;
s32 sp40; s32 sp40;
@ -5223,7 +5223,7 @@ void Message_Update(PlayState* play) {
msgCtx->stickAdjX = input->rel.stick_x; msgCtx->stickAdjX = input->rel.stick_x;
msgCtx->stickAdjY = input->rel.stick_y; msgCtx->stickAdjY = input->rel.stick_y;
averageY = 0; avgScreenPosY = 0;
// If stickAdj is held, set a delay to allow the cursor to read the next input. // If stickAdj is held, set a delay to allow the cursor to read the next input.
// The first delay is given a longer time than all subsequent delays. // The first delay is given a longer time than all subsequent delays.
@ -5309,12 +5309,12 @@ void Message_Update(PlayState* play) {
} }
if (temp) { if (temp) {
if (msgCtx->talkActor != NULL) { if (msgCtx->talkActor != NULL) {
Actor_GetScreenPos(play, &GET_PLAYER(play)->actor, &sp50, &sp4C); Actor_GetScreenPos(play, &GET_PLAYER(play)->actor, &screenPosX, &playerScreenPosY);
Actor_GetScreenPos(play, msgCtx->talkActor, &sp50, &sp4A); Actor_GetScreenPos(play, msgCtx->talkActor, &screenPosX, &actorScreenPosY);
if (sp4C >= sp4A) { if (playerScreenPosY >= actorScreenPosY) {
averageY = ((sp4C - sp4A) / 2) + sp4A; avgScreenPosY = ((playerScreenPosY - actorScreenPosY) / 2) + actorScreenPosY;
} else { } else {
averageY = ((sp4A - sp4C) / 2) + sp4C; avgScreenPosY = ((actorScreenPosY - playerScreenPosY) / 2) + playerScreenPosY;
} }
} else { } else {
msgCtx->textboxX = msgCtx->textboxXTarget; msgCtx->textboxX = msgCtx->textboxXTarget;
@ -5326,13 +5326,13 @@ void Message_Update(PlayState* play) {
if ((u32)msgCtx->textBoxPos == 0) { if ((u32)msgCtx->textBoxPos == 0) {
if ((play->sceneId == SCENE_UNSET_04) || (play->sceneId == SCENE_UNSET_05) || if ((play->sceneId == SCENE_UNSET_04) || (play->sceneId == SCENE_UNSET_05) ||
(play->sceneId == SCENE_UNSET_06)) { (play->sceneId == SCENE_UNSET_06)) {
if (averageY < 0x64) { if (avgScreenPosY < 100) {
msgCtx->textboxYTarget = sTextboxLowerYPositions[var_v1]; msgCtx->textboxYTarget = sTextboxLowerYPositions[var_v1];
} else { } else {
msgCtx->textboxYTarget = sTextboxUpperYPositions[var_v1]; msgCtx->textboxYTarget = sTextboxUpperYPositions[var_v1];
} }
} else { } else {
if (averageY < 0xA0) { if (avgScreenPosY < 160) {
msgCtx->textboxYTarget = sTextboxLowerYPositions[var_v1]; msgCtx->textboxYTarget = sTextboxLowerYPositions[var_v1];
} else { } else {
msgCtx->textboxYTarget = sTextboxUpperYPositions[var_v1]; msgCtx->textboxYTarget = sTextboxUpperYPositions[var_v1];

View File

@ -826,11 +826,11 @@ s32 SubS_CopyPointFromPathCheckBounds(Path* path, s32 pointIndex, Vec3f* dst) {
*/ */
s32 SubS_Offer(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 itemId, SubSOfferMode mode) { s32 SubS_Offer(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 itemId, SubSOfferMode mode) {
s32 canAccept = false; s32 canAccept = false;
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
f32 xzDistToPlayerTemp; f32 xzDistToPlayerTemp;
Actor_GetScreenPos(play, actor, &x, &y); Actor_GetScreenPos(play, actor, &screenPosX, &screenPosY);
switch (mode) { switch (mode) {
case SUBS_OFFER_MODE_GET_ITEM: case SUBS_OFFER_MODE_GET_ITEM:
@ -847,7 +847,8 @@ s32 SubS_Offer(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 itemI
case SUBS_OFFER_MODE_ONSCREEN: case SUBS_OFFER_MODE_ONSCREEN:
//! @bug: Both x and y conditionals are always true, || should be an && //! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) { if (((screenPosX >= 0) || (screenPosX < SCREEN_WIDTH)) &&
((screenPosY >= 0) || (screenPosY < SCREEN_HEIGHT))) {
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId); canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
} }
break; break;
@ -864,8 +865,9 @@ s32 SubS_Offer(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 itemI
case SUBS_OFFER_MODE_AUTO_TARGETED: case SUBS_OFFER_MODE_AUTO_TARGETED:
//! @bug: Both x and y conditionals are always true, || should be an && //! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT)) && if (((screenPosX >= 0) || (screenPosX < SCREEN_WIDTH)) &&
(fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange) && actor->isLockedOn) { ((screenPosY >= 0) || (screenPosY < SCREEN_HEIGHT)) && (fabsf(actor->playerHeightRel) <= yRange) &&
(actor->xzDistToPlayer <= xzRange) && actor->isLockedOn) {
actor->flags |= ACTOR_FLAG_10000; actor->flags |= ACTOR_FLAG_10000;
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId); canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
} }
@ -873,8 +875,9 @@ s32 SubS_Offer(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 itemI
case SUBS_OFFER_MODE_AUTO_NEARBY_ONSCREEN: case SUBS_OFFER_MODE_AUTO_NEARBY_ONSCREEN:
//! @bug: Both x and y conditionals are always true, || should be an && //! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT)) && if (((screenPosX >= 0) || (screenPosX < SCREEN_WIDTH)) &&
(fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange)) { ((screenPosY >= 0) || (screenPosY < SCREEN_HEIGHT)) && (fabsf(actor->playerHeightRel) <= yRange) &&
(actor->xzDistToPlayer <= xzRange)) {
actor->flags |= ACTOR_FLAG_10000; actor->flags |= ACTOR_FLAG_10000;
canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId); canAccept = Actor_OfferTalkExchange(actor, play, xzRange, yRange, itemId);
} }

View File

@ -173,11 +173,11 @@ s32 func_80B82454(BgDblueBalance* this, PlayState* play) {
void func_80B8259C(BgDblueBalance* this, PlayState* play) { void func_80B8259C(BgDblueBalance* this, PlayState* play) {
s32 pad; s32 pad;
WaterBox* sp30; WaterBox* waterBox;
f32 sp2C; f32 sp2C;
if (WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, &sp2C, if (WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, &sp2C,
&sp30)) { &waterBox)) {
this->dyna.actor.depthInWater = sp2C - this->dyna.actor.world.pos.y; this->dyna.actor.depthInWater = sp2C - this->dyna.actor.world.pos.y;
this->unk_228 = sp2C; this->unk_228 = sp2C;
if ((this->dyna.actor.depthInWater < 150.0f) && (this->dyna.actor.depthInWater > -150.0f)) { if ((this->dyna.actor.depthInWater < 150.0f) && (this->dyna.actor.depthInWater > -150.0f)) {

View File

@ -270,12 +270,13 @@ void func_80B84348(BgDblueWaterfall* this, PlayState* play, f32 arg2, f32 arg3,
void func_80B84568(BgDblueWaterfall* this, PlayState* play) { void func_80B84568(BgDblueWaterfall* this, PlayState* play) {
s32 pad; s32 pad;
CollisionPoly* sp40; CollisionPoly* sp40;
WaterBox* sp3C; WaterBox* waterBox;
s32 sp38; s32 sp38;
f32 sp34 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp40, &sp38, &this->actor, &this->actor.world.pos); f32 sp34 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp40, &sp38, &this->actor, &this->actor.world.pos);
f32 sp30; f32 sp30;
if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30, &sp3C)) { if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30,
&waterBox)) {
if (sp30 < sp34) { if (sp30 < sp34) {
this->unk_198 = sp34; this->unk_198 = sp34;
} else { } else {

View File

@ -118,12 +118,12 @@ void func_80AC4C18(BgIcefloe* this) {
} }
void func_80AC4C34(BgIcefloe* this, PlayState* play) { void func_80AC4C34(BgIcefloe* this, PlayState* play) {
WaterBox* water; WaterBox* waterBox;
this->timer--; this->timer--;
if ((this->timer == 0) || if ((this->timer == 0) ||
!WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, !WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z,
&this->dyna.actor.home.pos.y, &water)) { &this->dyna.actor.home.pos.y, &waterBox)) {
func_80AC4CF0(this); func_80AC4CF0(this);
} else { } else {
this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y =

View File

@ -148,10 +148,10 @@ void func_80AD6B68(BgLotus* this, PlayState* play) {
void BgLotus_Update(Actor* thisx, PlayState* play) { void BgLotus_Update(Actor* thisx, PlayState* play) {
BgLotus* this = THIS; BgLotus* this = THIS;
s32 pad; s32 pad;
WaterBox* sp2C; WaterBox* waterBox;
WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, WaterBox_GetSurface1_2(play, &play->colCtx, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z,
&this->unk160, &sp2C); &this->unk160, &waterBox);
this->actionFunc(this, play); this->actionFunc(this, play);
} }

View File

@ -270,12 +270,12 @@ void func_8088A894(EnArrow* this, PlayState* play) {
} }
void func_8088AA98(EnArrow* this, PlayState* play) { void func_8088AA98(EnArrow* this, PlayState* play) {
WaterBox* sp54; WaterBox* waterBox;
f32 sp50 = this->actor.world.pos.y; f32 sp50 = this->actor.world.pos.y;
Vec3f sp44; Vec3f sp44;
f32 temp_f0; f32 temp_f0;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) && if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &waterBox) &&
(this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) { (this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
this->actor.bgCheckFlags |= BGCHECKFLAG_WATER; this->actor.bgCheckFlags |= BGCHECKFLAG_WATER;

View File

@ -196,22 +196,22 @@ void EnAttackNiw_AnimateWingHead(EnAttackNiw* this, PlayState* play, s16 animInd
} }
s32 EnAttackNiw_IsOnScreen(EnAttackNiw* this, PlayState* play) { s32 EnAttackNiw_IsOnScreen(EnAttackNiw* this, PlayState* play) {
s16 posX; s16 screenPosX;
s16 posY; s16 screenPosY;
Actor_SetFocus(&this->actor, this->targetHeight); Actor_SetFocus(&this->actor, this->targetHeight);
Actor_GetScreenPos(play, &this->actor, &posX, &posY); Actor_GetScreenPos(play, &this->actor, &screenPosX, &screenPosY);
if ((this->actor.projectedPos.z < -20.0f) || (posX < 0) || (posX > SCREEN_WIDTH) || (posY < 0) || if ((this->actor.projectedPos.z < -20.0f) || (screenPosX < 0) || (screenPosX > SCREEN_WIDTH) || (screenPosY < 0) ||
(posY > SCREEN_HEIGHT)) { (screenPosY > SCREEN_HEIGHT)) {
return false; return false;
} }
return true; return true;
} }
void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) { void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) {
s16 posX; s16 screenPosX;
s16 posY; s16 screenPosY;
Vec3f viewOffset; Vec3f viewOffset;
Vec3f flightTarget; Vec3f flightTarget;
s32 pad; s32 pad;
@ -237,7 +237,7 @@ void EnAttackNiw_EnterViewFromOffscreen(EnAttackNiw* this, PlayState* play) {
Math_ApproachF(&this->rotStep, 5000.0f, 1.0f, 100.0f); Math_ApproachF(&this->rotStep, 5000.0f, 1.0f, 100.0f);
Actor_SetFocus(&this->actor, this->targetHeight); Actor_SetFocus(&this->actor, this->targetHeight);
Actor_GetScreenPos(play, &this->actor, &posX, &posY); Actor_GetScreenPos(play, &this->actor, &screenPosX, &screenPosY);
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
this->targetRotY = this->actor.yawTowardsPlayer; this->targetRotY = this->actor.yawTowardsPlayer;

View File

@ -1348,8 +1348,8 @@ s32 func_80A973B4(EnAz* this, PlayState* play) {
} }
void func_80A97410(EnAz* this, PlayState* play) { void func_80A97410(EnAz* this, PlayState* play) {
s16 sp56; s16 screenPosX;
s16 sp54; s16 screenPosY;
s32 temp_a0; s32 temp_a0;
if (this->unk_378 != 0) { if (this->unk_378 != 0) {
@ -1466,8 +1466,9 @@ void func_80A97410(EnAz* this, PlayState* play) {
this->unk_378 = 9; this->unk_378 = 9;
} }
} else { } else {
Actor_GetScreenPos(play, &this->actor, &sp56, &sp54); Actor_GetScreenPos(play, &this->actor, &screenPosX, &screenPosY);
if ((sp56 >= 0) && (sp56 <= SCREEN_WIDTH) && (sp54 >= 0) && (sp54 <= SCREEN_HEIGHT) && if ((screenPosX >= 0) && (screenPosX <= SCREEN_WIDTH) && (screenPosY >= 0) &&
(screenPosY <= SCREEN_HEIGHT) &&
Actor_OfferTalkExchange(&this->actor, play, 120.0f, 120.0f, PLAYER_IA_NONE)) { Actor_OfferTalkExchange(&this->actor, play, 120.0f, 120.0f, PLAYER_IA_NONE)) {
this->unk_3D2 = func_80A97274(this, play); this->unk_3D2 = func_80A97274(this, play);
if ((this->unk_3D2 == 0x10CE) || (this->unk_3D2 == 0x10D4)) { if ((this->unk_3D2 == 0x10CE) || (this->unk_3D2 == 0x10D4)) {

View File

@ -143,12 +143,13 @@ s32 EnBba01_TestIsTalking(EnBba01* this, PlayState* play) {
} }
s32 func_809CC270(EnBba01* this, PlayState* play) { s32 func_809CC270(EnBba01* this, PlayState* play) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
Actor_GetScreenPos(play, &this->enHy.actor, &x, &y); Actor_GetScreenPos(play, &this->enHy.actor, &screenPosX, &screenPosY);
//! @bug: Both x and y conditionals are always true, || should be an && //! @bug: Both x and y conditionals are always true, || should be an &&
if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) { if (!this->enHy.waitingOnInit && ((screenPosX >= 0) || (screenPosX < SCREEN_WIDTH)) &&
((screenPosY >= 0) || (screenPosY < SCREEN_HEIGHT))) {
Actor_OfferTalkExchangeEquiCylinder(&this->enHy.actor, play, 30.0f, PLAYER_IA_MAGIC_BEANS); Actor_OfferTalkExchangeEquiCylinder(&this->enHy.actor, play, 30.0f, PLAYER_IA_MAGIC_BEANS);
} }
return true; return true;

View File

@ -184,13 +184,13 @@ s32 EnBigokuta_ValidatePictograph(PlayState* play, Actor* thisx) {
} }
s32 EnBigokuta_IsInWater(EnBigokuta* this, PlayState* play) { s32 EnBigokuta_IsInWater(EnBigokuta* this, PlayState* play) {
WaterBox* box; WaterBox* waterBox;
s32 bgId; s32 bgId;
this->picto.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &this->picto.actor.floorPoly, &bgId, this->picto.actor.floorHeight = BgCheck_EntityRaycastFloor5(&play->colCtx, &this->picto.actor.floorPoly, &bgId,
&this->picto.actor, &this->picto.actor.world.pos); &this->picto.actor, &this->picto.actor.world.pos);
if (!WaterBox_GetSurface1_2(play, &play->colCtx, this->picto.actor.world.pos.x, this->picto.actor.world.pos.z, if (!WaterBox_GetSurface1_2(play, &play->colCtx, this->picto.actor.world.pos.x, this->picto.actor.world.pos.z,
&this->picto.actor.home.pos.y, &box) || &this->picto.actor.home.pos.y, &waterBox) ||
(this->picto.actor.home.pos.y <= this->picto.actor.floorHeight)) { (this->picto.actor.home.pos.y <= this->picto.actor.floorHeight)) {
return false; return false;
} else { } else {

View File

@ -371,11 +371,12 @@ void func_80A281B4(EnBigpamet* this) {
} }
void func_80A281DC(EnBigpamet* this, PlayState* play) { void func_80A281DC(EnBigpamet* this, PlayState* play) {
WaterBox* sp2C; WaterBox* waterBox;
f32 sp28; f32 sp28;
if (this->actor.parent->params == GEKKO_GET_SNAPPER) { if (this->actor.parent->params == GEKKO_GET_SNAPPER) {
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp28, &sp2C)) { if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp28,
&waterBox)) {
this->actor.depthInWater = sp28 - this->actor.world.pos.y; this->actor.depthInWater = sp28 - this->actor.world.pos.y;
} else { } else {
this->actor.depthInWater = this->actor.world.pos.y; this->actor.depthInWater = this->actor.world.pos.y;

View File

@ -542,7 +542,7 @@ void func_80C01CD0(EnBomjimb* this, PlayState* play) {
return; return;
} }
if (this->actor.draw == 0) { if (this->actor.draw == NULL) {
this->unk_2E4->shape.rot.z = -this->unk_2E4->shape.rot.z; this->unk_2E4->shape.rot.z = -this->unk_2E4->shape.rot.z;
this->unk_2E4->shape.rot.z *= 0.1f; this->unk_2E4->shape.rot.z *= 0.1f;
if (fabsf(this->unk_2E4->shape.rot.z) < 100.0f) { if (fabsf(this->unk_2E4->shape.rot.z) < 100.0f) {

View File

@ -61,11 +61,11 @@ void EnBoom_SetupAction(EnBoom* this, EnBoomActionFunc actionFunc) {
} }
void func_808A24DC(EnBoom* this, PlayState* play) { void func_808A24DC(EnBoom* this, PlayState* play) {
WaterBox* sp54; WaterBox* waterBox;
f32 sp50 = this->actor.world.pos.y; f32 sp50 = this->actor.world.pos.y;
u16 sp4E = this->actor.bgCheckFlags & BGCHECKFLAG_WATER; u16 sp4E = this->actor.bgCheckFlags & BGCHECKFLAG_WATER;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) && if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &waterBox) &&
(this->actor.world.pos.y < sp50)) { (this->actor.world.pos.y < sp50)) {
Vec3f sp40; Vec3f sp40;

View File

@ -135,12 +135,13 @@ s32 EnCne01_TestIsTalking(EnCne01* this, PlayState* play) {
} }
s32 func_809CB4A0(EnCne01* this, PlayState* play) { s32 func_809CB4A0(EnCne01* this, PlayState* play) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
Actor_GetScreenPos(play, &this->enHy.actor, &x, &y); Actor_GetScreenPos(play, &this->enHy.actor, &screenPosX, &screenPosY);
//! @bug: Both x and y conditionals are always true, || should be an && //! @bug: Both x and y conditionals are always true, || should be an &&
if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) { if (!this->enHy.waitingOnInit && ((screenPosX >= 0) || (screenPosX < SCREEN_WIDTH)) &&
((screenPosY >= 0) || (screenPosY < SCREEN_HEIGHT))) {
Actor_OfferTalkExchangeEquiCylinder(&this->enHy.actor, play, 30.0f, PLAYER_IA_MAGIC_BEANS); Actor_OfferTalkExchangeEquiCylinder(&this->enHy.actor, play, 30.0f, PLAYER_IA_MAGIC_BEANS);
} }
return true; return true;

View File

@ -295,7 +295,7 @@ s32 func_80B2899C(EnFish2* this, PlayState* play) {
} }
void func_80B289DC(EnFish2* this, PlayState* play) { void func_80B289DC(EnFish2* this, PlayState* play) {
WaterBox* sp2C; WaterBox* waterBox;
if (this->unk_2B4 != 0) { if (this->unk_2B4 != 0) {
this->unk_348 = 0; this->unk_348 = 0;
@ -314,7 +314,7 @@ void func_80B289DC(EnFish2* this, PlayState* play) {
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
} }
} else if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, } else if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
&this->unk_334, &sp2C)) { &this->unk_334, &waterBox)) {
if ((this->unk_334 != BGCHECK_Y_MIN) && (this->actor.world.pos.y < (this->unk_334 - this->unk_2D8))) { if ((this->unk_334 != BGCHECK_Y_MIN) && (this->actor.world.pos.y < (this->unk_334 - this->unk_2D8))) {
this->actor.velocity.y = this->actor.world.rot.x * 0.001f * -0.1f; this->actor.velocity.y = this->actor.world.rot.x * 0.001f * -0.1f;
if (this->actionFunc == func_80B297FC) { if (this->actionFunc == func_80B297FC) {
@ -922,10 +922,10 @@ void func_80B2A498(EnFish2* this, PlayState* play) {
if ((this->animIndex == FISH2_ANIM_4) && if ((this->animIndex == FISH2_ANIM_4) &&
(Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 31.0f))) { (Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 31.0f))) {
WaterBox* sp78; WaterBox* waterBox;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_334, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_334,
&sp78)) { &waterBox)) {
Vec3f sp6C; Vec3f sp6C;
s32 i; s32 i;
@ -1136,7 +1136,7 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2) {
void func_80B2AF80(EnFish2* this, PlayState* play) { void func_80B2AF80(EnFish2* this, PlayState* play) {
EnFish2UnkStruct* ptr = &this->unk_3F8[0]; EnFish2UnkStruct* ptr = &this->unk_3F8[0];
WaterBox* sp90; WaterBox* waterBox;
f32 sp8C; f32 sp8C;
s32 i; s32 i;
@ -1154,7 +1154,7 @@ void func_80B2AF80(EnFish2* this, PlayState* play) {
ptr->unk_04.y += 1.0f + ((Rand_ZeroOne() - 0.3f) * 1.2f); ptr->unk_04.y += 1.0f + ((Rand_ZeroOne() - 0.3f) * 1.2f);
ptr->unk_04.z += (0.3f + (Rand_ZeroOne() * 0.5f)) - 0.55f; ptr->unk_04.z += (0.3f + (Rand_ZeroOne() * 0.5f)) - 0.55f;
sp8C = ptr->unk_04.y; sp8C = ptr->unk_04.y;
if (!WaterBox_GetSurface1(play, &play->colCtx, ptr->unk_04.x, ptr->unk_04.z, &sp8C, &sp90)) { if (!WaterBox_GetSurface1(play, &play->colCtx, ptr->unk_04.x, ptr->unk_04.z, &sp8C, &waterBox)) {
ptr->unk_00 = 0; ptr->unk_00 = 0;
} else if (sp8C < ptr->unk_04.y) { } else if (sp8C < ptr->unk_04.y) {
Vec3f sp7C; Vec3f sp7C;

View File

@ -443,14 +443,14 @@ s32 EnFsn_TestCancelOption(EnFsn* this, PlayState* play, Input* input) {
} }
void EnFsn_UpdateCursorPos(EnFsn* this, PlayState* play) { void EnFsn_UpdateCursorPos(EnFsn* this, PlayState* play) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
f32 xOffset = 0.0f; f32 xOffset = 0.0f;
f32 yOffset = 17.0f; f32 yOffset = 17.0f;
Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &x, &y); Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &screenPosX, &screenPosY);
this->cursorPos.x = x + xOffset; this->cursorPos.x = screenPosX + xOffset;
this->cursorPos.y = y + yOffset; this->cursorPos.y = screenPosY + yOffset;
this->cursorPos.z = 1.2f; this->cursorPos.z = 1.2f;
} }

View File

@ -499,11 +499,11 @@ s32 func_8093F6F8(EnGoroiwa* this, PlayState* play) {
} }
if (this->unk_1CA == 0) { if (this->unk_1CA == 0) {
WaterBox* sp44; WaterBox* waterBox;
f32 sp40; f32 sp40;
if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp40, if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp40,
&sp44)) { &waterBox)) {
if ((this->actor.world.pos.y + this->unk_1DC) <= sp40) { if ((this->actor.world.pos.y + this->unk_1DC) <= sp40) {
this->unk_1E5 |= 0x20; this->unk_1E5 |= 0x20;
if (sp40 < (this->unk_1DC + sp78)) { if (sp40 < (this->unk_1DC + sp78)) {

View File

@ -1044,14 +1044,14 @@ void EnGs_Update(Actor* thisx, PlayState* play) {
func_80998040(this, play); func_80998040(this, play);
} }
} else { } else {
s16 sp2E; s16 screenPosX;
s16 sp2C; s16 screenPosY;
if ((this->actor.flags & ACTOR_FLAG_40) || (this->unk_19A & 0x100) || (this->unk_19A & 0x200)) { if ((this->actor.flags & ACTOR_FLAG_40) || (this->unk_19A & 0x100) || (this->unk_19A & 0x200)) {
func_80999BC8(&this->actor, play); func_80999BC8(&this->actor, play);
Actor_GetScreenPos(play, &this->actor, &sp2E, &sp2C); Actor_GetScreenPos(play, &this->actor, &screenPosX, &screenPosY);
if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) || if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (screenPosX < 0) || (screenPosX > SCREEN_WIDTH) ||
(sp2C > SCREEN_HEIGHT)) { (screenPosY < 0) || (screenPosY > SCREEN_HEIGHT)) {
this->unk_216 = 0; this->unk_216 = 0;
} else if (this->quakeY > 0) { } else if (this->quakeY > 0) {
Actor_RequestQuakeAndRumble(&this->actor, play, this->quakeY, this->quakeDuration); Actor_RequestQuakeAndRumble(&this->actor, play, this->quakeY, this->quakeDuration);

View File

@ -355,12 +355,12 @@ void func_80BDBA28(EnHiddenNuts* this, PlayState* play) {
void func_80BDBB48(EnHiddenNuts* this, PlayState* play) { void func_80BDBB48(EnHiddenNuts* this, PlayState* play) {
s32 pad[3]; s32 pad[3];
f32 curFrame = this->skelAnime.curFrame; f32 curFrame = this->skelAnime.curFrame;
WaterBox* sp54; WaterBox* waterBox;
f32 sp50; f32 sp50;
s16 sp4E = false; s16 sp4E = false;
Vec3f sp40; Vec3f sp40;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &sp54) && if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50, &waterBox) &&
(this->actor.world.pos.y < sp50)) { (this->actor.world.pos.y < sp50)) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
Math_Vec3f_Copy(&sp40, &this->actor.world.pos); Math_Vec3f_Copy(&sp40, &this->actor.world.pos);

View File

@ -617,7 +617,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
s32 pathCount; s32 pathCount;
Vec3s* pathPoints; Vec3s* pathPoints;
if (pathIndex == -1) { if (pathIndex == PATH_INDEX_NONE) {
return false; return false;
} }

View File

@ -364,11 +364,11 @@ void func_8095E204(EnIshi* this, PlayState* play) {
s32 func_8095E2B0(EnIshi* this, PlayState* play) { s32 func_8095E2B0(EnIshi* this, PlayState* play) {
s32 pad; s32 pad;
WaterBox* sp30; WaterBox* waterBox;
f32 sp2C; f32 sp2C;
s32 sp28; s32 sp28;
if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, &sp30, if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, &waterBox,
&sp28) && &sp28) &&
(this->actor.world.pos.y < sp2C)) { (this->actor.world.pos.y < sp2C)) {
return true; return true;

View File

@ -346,8 +346,8 @@ void EnKakasi_SetupIdleStanding(EnKakasi* this) {
void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) { void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) {
u32 day = gSaveContext.save.day; u32 day = gSaveContext.save.day;
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
// first talk to scarecrow dialogue // first talk to scarecrow dialogue
this->picto.actor.textId = 0x1644; this->picto.actor.textId = 0x1644;
@ -362,9 +362,9 @@ void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) {
return; return;
} }
if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) { if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) {
Actor_GetScreenPos(play, &this->picto.actor, &x, &y); Actor_GetScreenPos(play, &this->picto.actor, &screenPosX, &screenPosY);
if ((this->picto.actor.projectedPos.z > -20.0f) && (x > 0) && (x < SCREEN_WIDTH) && (y > 0) && if ((this->picto.actor.projectedPos.z > -20.0f) && (screenPosX > 0) && (screenPosX < SCREEN_WIDTH) &&
(y < SCREEN_HEIGHT) && (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING)) { (screenPosY > 0) && (screenPosY < SCREEN_HEIGHT) && (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING)) {
// faster shaking // faster shaking
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING); EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
this->skelAnime.playSpeed = 2.0f; this->skelAnime.playSpeed = 2.0f;

View File

@ -128,14 +128,15 @@ s32 func_80A68860(EnMushi2* this, PlayState* play) {
s32 sp40; s32 sp40;
CollisionPoly* sp3C; CollisionPoly* sp3C;
f32 temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp3C, &sp40, &this->actor, &this->actor.world.pos); f32 temp_f0 = BgCheck_EntityRaycastFloor5(&play->colCtx, &sp3C, &sp40, &this->actor, &this->actor.world.pos);
WaterBox* sp34; WaterBox* waterBox;
f32 sp30; f32 sp30;
if ((temp_f0 > (BGCHECK_Y_MIN + 1)) && ((this->actor.world.pos.y - 150.0f) < temp_f0)) { if ((temp_f0 > (BGCHECK_Y_MIN + 1)) && ((this->actor.world.pos.y - 150.0f) < temp_f0)) {
return true; return true;
} }
return WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30, &sp34); return WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30,
&waterBox);
} }
s32 func_80A68910(EnMushi2* this, PlayState* play) { s32 func_80A68910(EnMushi2* this, PlayState* play) {
@ -528,7 +529,7 @@ void func_80A697C4(EnMushi2* this, PlayState* play) {
s32 bgId = this->polyBgId; s32 bgId = this->polyBgId;
if (!(this->unk_30C & (0x10 | 0x4))) { if (!(this->unk_30C & (0x10 | 0x4))) {
WaterBox* sp30; WaterBox* waterBox;
f32 sp2C; f32 sp2C;
this->unk_30C &= ~(0x40 | 0x8 | 0x2); this->unk_30C &= ~(0x40 | 0x8 | 0x2);
@ -537,7 +538,7 @@ void func_80A697C4(EnMushi2* this, PlayState* play) {
} }
if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, if (WaterBox_GetSurface1_2(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C,
&sp30)) { &waterBox)) {
this->actor.depthInWater = sp2C - this->actor.world.pos.y; this->actor.depthInWater = sp2C - this->actor.world.pos.y;
if (this->actor.depthInWater >= 1.0f) { if (this->actor.depthInWater >= 1.0f) {
this->unk_30C |= 0x20; this->unk_30C |= 0x20;
@ -577,7 +578,7 @@ void func_80A697C4(EnMushi2* this, PlayState* play) {
s32 func_80A699E4(EnMushi2* this, PlayState* play) { s32 func_80A699E4(EnMushi2* this, PlayState* play) {
s32 pad; s32 pad;
WaterBox* sp40; WaterBox* waterBox;
f32 sp3C; f32 sp3C;
if (this->unk_328.y < 0.0f) { if (this->unk_328.y < 0.0f) {
@ -585,7 +586,7 @@ s32 func_80A699E4(EnMushi2* this, PlayState* play) {
f32 y = (2.0f * this->unk_328.y) + this->actor.world.pos.y; f32 y = (2.0f * this->unk_328.y) + this->actor.world.pos.y;
f32 z = (2.0f * this->unk_328.z) + this->actor.world.pos.z; f32 z = (2.0f * this->unk_328.z) + this->actor.world.pos.z;
if (WaterBox_GetSurface1_2(play, &play->colCtx, x, z, &sp3C, &sp40) && (y <= sp3C)) { if (WaterBox_GetSurface1_2(play, &play->colCtx, x, z, &sp3C, &waterBox) && (y <= sp3C)) {
return true; return true;
} }
} }

View File

@ -292,12 +292,12 @@ void EnOssan_Destroy(Actor* thisx, PlayState* play) {
} }
void EnOssan_UpdateCursorPos(PlayState* play, EnOssan* this) { void EnOssan_UpdateCursorPos(PlayState* play, EnOssan* this) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &x, &y); Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &screenPosX, &screenPosY);
this->cursorPos.x = x; this->cursorPos.x = screenPosX;
this->cursorPos.y = y; this->cursorPos.y = screenPosY;
} }
void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { void EnOssan_EndInteraction(PlayState* play, EnOssan* this) {

View File

@ -888,7 +888,7 @@ s32 func_8095C510(EnOwl* this) {
void func_8095C568(EnOwl* this) { void func_8095C568(EnOwl* this) {
if (this->actionFlags & 0x40) { if (this->actionFlags & 0x40) {
if ((this->csIdIndex < 0) || (this->csIdList[this->csIdIndex] < 0)) { if ((this->csIdIndex < 0) || (this->csIdList[this->csIdIndex] <= CS_ID_NONE)) {
this->actionFlags &= ~0x40; this->actionFlags &= ~0x40;
} else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) {
CutsceneManager_Stop(CS_ID_GLOBAL_TALK); CutsceneManager_Stop(CS_ID_GLOBAL_TALK);

View File

@ -105,20 +105,38 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, MASS_IMMOVABLE, 0, 0, 0, 0, MASS_IMMOVABLE,
}; };
static AnimationInfo sAnimationInfo[] = { typedef enum PamelaAnimation {
{ &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, /* -1 */ PAMELA_ANIM_NONE = -1,
{ &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, /* 0x0 */ PAMELA_ANIM_0,
{ &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, /* 0x1 */ PAMELA_ANIM_1,
{ &object_pamera_Anim_00A844, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, /* 0x2 */ PAMELA_ANIM_2,
{ &object_pamera_Anim_00B0C4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, /* 0x3 */ PAMELA_ANIM_3,
{ &object_pamera_Anim_009870, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0x4 */ PAMELA_ANIM_4,
{ &object_pamera_Anim_009F54, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0x5 */ PAMELA_ANIM_5,
{ &object_pamera_Anim_00B5B0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0x6 */ PAMELA_ANIM_6,
{ &object_pamera_Anim_00BCC4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0x7 */ PAMELA_ANIM_7,
{ &object_pamera_Anim_00D9DC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0x8 */ PAMELA_ANIM_8,
{ &object_pamera_Anim_00E16C, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0x9 */ PAMELA_ANIM_9,
{ &object_pamera_Anim_00C9F4, 1.0f, 0, 0.0f, ANIMMODE_ONCE, 0.0f }, /* 0xA */ PAMELA_ANIM_10,
{ &object_pamera_Anim_00D0F0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, /* 0xB */ PAMELA_ANIM_11,
/* 0xC */ PAMELA_ANIM_12,
/* 0xD */ PAMELA_ANIM_MAX
} PamelaAnimation;
static AnimationInfo sAnimationInfo[PAMELA_ANIM_MAX] = {
{ &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, // PAMELA_ANIM_0
{ &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, // PAMELA_ANIM_1
{ &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, // PAMELA_ANIM_2
{ &object_pamera_Anim_00A844, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, // PAMELA_ANIM_3
{ &object_pamera_Anim_00B0C4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f }, // PAMELA_ANIM_4
{ &object_pamera_Anim_009870, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_5
{ &object_pamera_Anim_009F54, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_6
{ &object_pamera_Anim_00B5B0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_7
{ &object_pamera_Anim_00BCC4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_8
{ &object_pamera_Anim_00D9DC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_9
{ &object_pamera_Anim_00E16C, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_10
{ &object_pamera_Anim_00C9F4, 1.0f, 0, 0.0f, ANIMMODE_ONCE, 0.0f }, // PAMELA_ANIM_11
{ &object_pamera_Anim_00D0F0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f }, // PAMELA_ANIM_12
}; };
static Vec3f D_80BDA5F0 = { 1000.0f, 0.0f, 0.0f }; static Vec3f D_80BDA5F0 = { 1000.0f, 0.0f, 0.0f };
@ -148,7 +166,7 @@ void EnPamera_Init(Actor* thisx, PlayState* play) {
this->hideInisdeTimer = 0; this->hideInisdeTimer = 0;
this->unk_322 = 0; this->unk_322 = 0;
this->unk_324 = 0; this->unk_324 = 0;
if ((this->actor.params & 0xF000) >> 0xC) { if (PAMELA_GET_F000(&this->actor)) {
func_80BD9840(this, play); func_80BD9840(this, play);
} else { } else {
func_80BD8588(this, play); func_80BD8588(this, play);
@ -195,7 +213,7 @@ s32 func_80BD84F0(EnPamera* this, PlayState* play) {
} }
void func_80BD8588(EnPamera* this, PlayState* play) { void func_80BD8588(EnPamera* this, PlayState* play) {
Path* path = &play->setupPathList[ENPAMERA_GET_PATH_INDEX(&this->actor)]; Path* path = &play->setupPathList[PAMELA_GET_PATH_INDEX(&this->actor)];
Vec3f sp28; Vec3f sp28;
if (path == NULL) { if (path == NULL) {
@ -234,27 +252,27 @@ void EnPamera_Destroy(Actor* thisx, PlayState* play) {
void func_80BD8700(EnPamera* this) { void func_80BD8700(EnPamera* this) {
this->hideInisdeTimer = 0; this->hideInisdeTimer = 0;
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_0);
this->actionFunc = func_80BD8758; this->actionFunc = func_80BD8758;
} }
void func_80BD8758(EnPamera* this, PlayState* play) { void func_80BD8758(EnPamera* this, PlayState* play) {
if (this->hideInisdeTimer++ > 1800) { if (this->hideInisdeTimer++ > 1800) {
if (CutsceneManager_IsNext(this->csIdList[0]) && (this->csIdList[0] != -1)) { if (CutsceneManager_IsNext(this->csIdList[0]) && (this->csIdList[0] != CS_ID_NONE)) {
CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->actor); CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->actor);
Camera_SetFocalActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csIdList[0])), Camera_SetFocalActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csIdList[0])),
&this->actor); &this->actor);
this->actor.speed = 1.5f; this->actor.speed = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_1);
this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.shape.rot.y = this->actor.home.rot.y;
this->actor.world.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y;
func_80BD9338(this, play); func_80BD9338(this, play);
func_80BD8908(this); func_80BD8908(this);
} else if ((this->csIdList[0] != -1) && (this->actor.xzDistToPlayer < 1000.0f)) { } else if ((this->csIdList[0] != CS_ID_NONE) && (this->actor.xzDistToPlayer < 1000.0f)) {
CutsceneManager_Queue(this->csIdList[0]); CutsceneManager_Queue(this->csIdList[0]);
} else { } else {
this->actor.speed = 1.5f; this->actor.speed = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_1);
this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.shape.rot.y = this->actor.home.rot.y;
this->actor.world.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y;
func_80BD9338(this, play); func_80BD9338(this, play);
@ -276,7 +294,7 @@ void func_80BD8758(EnPamera* this, PlayState* play) {
void func_80BD8908(EnPamera* this) { void func_80BD8908(EnPamera* this) {
this->actor.draw = EnPamera_Draw; this->actor.draw = EnPamera_Draw;
this->actor.flags |= ACTOR_FLAG_TARGETABLE; this->actor.flags |= ACTOR_FLAG_TARGETABLE;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_1);
this->actionFunc = func_80BD8964; this->actionFunc = func_80BD8964;
} }
@ -289,14 +307,14 @@ void func_80BD8964(EnPamera* this, PlayState* play) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) { if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) {
this->actor.speed = 1.5f; this->actor.speed = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_1);
SET_WEEKEVENTREG(WEEKEVENTREG_59_01); SET_WEEKEVENTREG(WEEKEVENTREG_59_01);
func_80BD8B50(this); func_80BD8B50(this);
} }
} }
void func_80BD8A38(EnPamera* this) { void func_80BD8A38(EnPamera* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_1);
this->actionFunc = func_80BD8A7C; this->actionFunc = func_80BD8A7C;
} }
@ -343,14 +361,14 @@ void func_80BD8B70(EnPamera* this, PlayState* play) {
void func_80BD8CCC(EnPamera* this) { void func_80BD8CCC(EnPamera* this) {
this->hideInisdeTimer = 0; this->hideInisdeTimer = 0;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_3);
this->actionFunc = func_80BD8D1C; this->actionFunc = func_80BD8D1C;
} }
void func_80BD8D1C(EnPamera* this, PlayState* play) { void func_80BD8D1C(EnPamera* this, PlayState* play) {
if (this->hideInisdeTimer++ > 200) { if (this->hideInisdeTimer++ > 200) {
this->actor.speed = 1.5f; this->actor.speed = 1.5f;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_1);
func_80BD8D80(this); func_80BD8D80(this);
} }
} }
@ -386,14 +404,14 @@ void func_80BD8DB0(EnPamera* this, PlayState* play) {
void EnPamera_LookDownWell(EnPamera* this) { void EnPamera_LookDownWell(EnPamera* this) {
func_80BD93CC(this, 1, 1); func_80BD93CC(this, 1, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 4); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_4);
this->actionFunc = func_80BD8F60; this->actionFunc = func_80BD8F60;
} }
void func_80BD8F60(EnPamera* this, PlayState* play) { void func_80BD8F60(EnPamera* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 2); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_2);
this->actor.speed = 3.0f; this->actor.speed = 3.0f;
func_80BD93CC(this, 0, 0); func_80BD93CC(this, 0, 0);
func_80BD8D80(this); func_80BD8D80(this);
@ -410,7 +428,7 @@ void func_80BD8FF0(EnPamera* this) {
pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos); pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos);
this->actor.shape.rot.y = pameraYaw; this->actor.shape.rot.y = pameraYaw;
this->actor.world.rot.y = pameraYaw; this->actor.world.rot.y = pameraYaw;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_3);
this->actionFunc = func_80BD909C; this->actionFunc = func_80BD909C;
} }
@ -420,19 +438,19 @@ void func_80BD909C(EnPamera* this, PlayState* play) {
void func_80BD90AC(EnPamera* this, PlayState* play) { void func_80BD90AC(EnPamera* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (Player_GetMask(play) != PLAYER_MASK_STONE && (this->actionFunc != func_80BD8758) && if ((Player_GetMask(play) != PLAYER_MASK_STONE) && (this->actionFunc != func_80BD8758) &&
(this->actionFunc != func_80BD8964) && (this->actionFunc != func_80BD8A7C) && (this->actionFunc != func_80BD8964) && (this->actionFunc != func_80BD8A7C) &&
(this->actionFunc != func_80BD8F60) && ((this->actionFunc != func_80BD8B70) || (this->waypointIndex != 0)) && (this->actionFunc != func_80BD8F60) && ((this->actionFunc != func_80BD8B70) || (this->waypointIndex != 0)) &&
((this->actionFunc != func_80BD8DB0) || (this->actor.speed != 3.0f)) && ((this->actionFunc != func_80BD8DB0) || (this->actor.speed != 3.0f)) &&
((this->actor.xzDistToPlayer < 150.0f) || ((this->actor.xzDistToPlayer < 150.0f) ||
((this->actionFunc == func_80BD909C) && ((this->actionFunc == func_80BD909C) &&
(Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f)))) { (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f)))) {
if ((CutsceneManager_IsNext(this->csIdList[1])) && ((this->csIdList[1] != -1))) { if (CutsceneManager_IsNext(this->csIdList[1]) && (this->csIdList[1] != CS_ID_NONE)) {
CutsceneManager_StartWithPlayerCs(this->csIdList[1], &this->actor); CutsceneManager_StartWithPlayerCs(this->csIdList[1], &this->actor);
Camera_SetFocalActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csIdList[1])), Camera_SetFocalActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csIdList[1])),
&this->actor); &this->actor);
EnPamera_LookDownWell(this); EnPamera_LookDownWell(this);
} else if (this->csIdList[1] != -1) { } else if (this->csIdList[1] != CS_ID_NONE) {
CutsceneManager_Queue(this->csIdList[1]); CutsceneManager_Queue(this->csIdList[1]);
} else { } else {
EnPamera_LookDownWell(this); EnPamera_LookDownWell(this);
@ -446,12 +464,12 @@ s32 func_80BD9234(EnPamera* this, PlayState* play) {
while (actor != NULL) { while (actor != NULL) {
if ((actor->id == ACTOR_EN_BOM) && (Math_Vec3f_DistXZ(&this->actor.world.pos, &actor->world.pos) < 500.0f) && if ((actor->id == ACTOR_EN_BOM) && (Math_Vec3f_DistXZ(&this->actor.world.pos, &actor->world.pos) < 500.0f) &&
(((EnBom*)actor)->timer == 0)) { (((EnBom*)actor)->timer == 0)) {
return 1; return true;
} else { } else {
actor = actor->next; actor = actor->next;
} }
} }
return 0; return false;
} }
void func_80BD92D0(EnPamera* this, PlayState* play) { void func_80BD92D0(EnPamera* this, PlayState* play) {
@ -459,7 +477,7 @@ void func_80BD92D0(EnPamera* this, PlayState* play) {
s32 pathIndex = this->additionalPathIndex; s32 pathIndex = this->additionalPathIndex;
path = &play->setupPathList[pathIndex]; path = &play->setupPathList[pathIndex];
if (pathIndex >= 0) { if (pathIndex > PATH_INDEX_NONE) {
this->pathPoints = Lib_SegmentedToVirtual(path->points); this->pathPoints = Lib_SegmentedToVirtual(path->points);
this->waypointIndex = 0; this->waypointIndex = 0;
this->pathCount = path->count; this->pathCount = path->count;
@ -586,7 +604,7 @@ void func_80BD9840(EnPamera* this, PlayState* play) {
void func_80BD9904(EnPamera* this) { void func_80BD9904(EnPamera* this) {
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
this->actionFunc = &func_80BD9928; this->actionFunc = func_80BD9928;
} }
void func_80BD9928(EnPamera* this, PlayState* play) { void func_80BD9928(EnPamera* this, PlayState* play) {
@ -609,15 +627,13 @@ void func_80BD994C(EnPamera* this, PlayState* play) {
func_80BD93CC(this, 1, 0); func_80BD93CC(this, 1, 0);
Message_StartTextbox(play, 0x158E, &this->actor); Message_StartTextbox(play, 0x158E, &this->actor);
this->unk_324 = 0x158E; this->unk_324 = 0x158E;
} else if (!(this->unk_322 & 1)) {
this->unk_322 |= 1;
Message_StartTextbox(play, 0x1587, &this->actor);
this->unk_324 = 0x1587;
} else { } else {
if (!(this->unk_322 & 1)) { Message_StartTextbox(play, 0x158C, &this->actor);
this->unk_322 |= 1; this->unk_324 = 0x158C;
Message_StartTextbox(play, 0x1587, &this->actor);
this->unk_324 = 0x1587;
} else {
Message_StartTextbox(play, 0x158C, &this->actor);
this->unk_324 = 0x158C;
}
} }
func_80BD9A9C(this); func_80BD9A9C(this);
} else { } else {
@ -662,27 +678,35 @@ void func_80BD9B4C(EnPamera* this, PlayState* play) {
Message_StartTextbox(play, 0x1588, &this->actor); Message_StartTextbox(play, 0x1588, &this->actor);
this->unk_324 = 0x1588; this->unk_324 = 0x1588;
break; break;
case 0x1588: case 0x1588:
Message_StartTextbox(play, 0x1589, &this->actor); Message_StartTextbox(play, 0x1589, &this->actor);
this->unk_324 = 0x1589; this->unk_324 = 0x1589;
break; break;
case 0x1589: case 0x1589:
Message_StartTextbox(play, 0x158A, &this->actor); Message_StartTextbox(play, 0x158A, &this->actor);
this->unk_324 = 0x158A; this->unk_324 = 0x158A;
break; break;
case 0x158A: case 0x158A:
Message_StartTextbox(play, 0x158B, &this->actor); Message_StartTextbox(play, 0x158B, &this->actor);
this->unk_324 = 0x158B; this->unk_324 = 0x158B;
break; break;
case 0x158C: case 0x158C:
Message_StartTextbox(play, 0x158D, &this->actor); Message_StartTextbox(play, 0x158D, &this->actor);
this->unk_324 = 0x158D; this->unk_324 = 0x158D;
break; break;
case 0x158E: case 0x158E:
case 0x15A8: case 0x15A8:
Message_CloseTextbox(play); Message_CloseTextbox(play);
func_80BD9C70(this, play); func_80BD9C70(this, play);
break; break;
default:
break;
} }
} }
} }
@ -706,6 +730,7 @@ s32 func_80BD9CB8(EnPamera* this, PlayState* play) {
case 1: case 1:
func_80BD9E88(this); func_80BD9E88(this);
break; break;
case 2: case 2:
if (this->actor.draw == NULL) { if (this->actor.draw == NULL) {
this->actor.draw = EnPamera_Draw; this->actor.draw = EnPamera_Draw;
@ -713,23 +738,30 @@ s32 func_80BD9CB8(EnPamera* this, PlayState* play) {
} }
func_80BD9EE0(this); func_80BD9EE0(this);
break; break;
case 3: case 3:
func_80BDA038(this); func_80BDA038(this);
break; break;
case 4: case 4:
func_80BDA0A0(this); func_80BDA0A0(this);
break; break;
case 5: case 5:
func_80BDA170(this); func_80BDA170(this);
break; break;
case 6: case 6:
func_80BDA288(this); func_80BDA288(this);
break; break;
default:
break;
} }
} }
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
this->setupFunc(this, play); this->setupFunc(this, play);
return 1; return true;
} }
if ((play->csCtx.state == CS_STATE_IDLE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20)) { if ((play->csCtx.state == CS_STATE_IDLE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20)) {
if ((this->actionFunc != func_80BD994C) && (this->actionFunc != EnPamera_HandleDialogue)) { if ((this->actionFunc != func_80BD994C) && (this->actionFunc != EnPamera_HandleDialogue)) {
@ -739,7 +771,7 @@ s32 func_80BD9CB8(EnPamera* this, PlayState* play) {
} }
} }
this->cueId = 99; this->cueId = 99;
return 0; return false;
} }
void func_80BD9E60(EnPamera* this) { void func_80BD9E60(EnPamera* this) {
@ -751,7 +783,7 @@ void func_80BD9E78(EnPamera* this, PlayState* play) {
} }
void func_80BD9E88(EnPamera* this) { void func_80BD9E88(EnPamera* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_0);
this->unk_31E = 0; this->unk_31E = 0;
this->setupFunc = func_80BD9ED0; this->setupFunc = func_80BD9ED0;
} }
@ -760,7 +792,7 @@ void func_80BD9ED0(EnPamera* this, PlayState* play) {
} }
void func_80BD9EE0(EnPamera* this) { void func_80BD9EE0(EnPamera* this) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 5); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_5);
func_80BD93CC(this, 1, 0); func_80BD93CC(this, 1, 0);
this->unk_31E = 1; this->unk_31E = 1;
this->setupFunc = func_80BD9F3C; this->setupFunc = func_80BD9F3C;
@ -777,14 +809,14 @@ void func_80BD9F3C(EnPamera* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0; this->unk_31E = 0;
func_80BD93CC(this, 0, 0); func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_6);
} }
} }
} }
void func_80BDA038(EnPamera* this) { void func_80BDA038(EnPamera* this) {
func_80BD93CC(this, 0, 1); func_80BD93CC(this, 0, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 7); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_7);
this->unk_31E = 0; this->unk_31E = 0;
this->setupFunc = func_80BDA090; this->setupFunc = func_80BDA090;
} }
@ -794,7 +826,7 @@ void func_80BDA090(EnPamera* this, PlayState* play) {
void func_80BDA0A0(EnPamera* this) { void func_80BDA0A0(EnPamera* this) {
func_80BD93CC(this, 0, 1); func_80BD93CC(this, 0, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 8); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_8);
this->unk_31E = 1; this->unk_31E = 1;
this->setupFunc = func_80BDA0FC; this->setupFunc = func_80BDA0FC;
} }
@ -804,7 +836,7 @@ void func_80BDA0FC(EnPamera* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0; this->unk_31E = 0;
func_80BD93CC(this, 0, 0); func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 6); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_6);
} }
} }
} }
@ -812,7 +844,7 @@ void func_80BDA0FC(EnPamera* this, PlayState* play) {
void func_80BDA170(EnPamera* this) { void func_80BDA170(EnPamera* this) {
this->unk_31E = 1; this->unk_31E = 1;
func_80BD93CC(this, 0, 1); func_80BD93CC(this, 0, 1);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 9); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_9);
this->setupFunc = func_80BDA1C8; this->setupFunc = func_80BDA1C8;
} }
@ -825,7 +857,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0; this->unk_31E = 0;
func_80BD93CC(this, 0, 0); func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 10); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_10);
} }
} }
} }
@ -833,7 +865,7 @@ void func_80BDA1C8(EnPamera* this, PlayState* play) {
void func_80BDA288(EnPamera* this) { void func_80BDA288(EnPamera* this) {
this->unk_31E = 1; this->unk_31E = 1;
func_80BD93CC(this, 0, 0); func_80BD93CC(this, 0, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 11); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_11);
this->setupFunc = func_80BDA2E0; this->setupFunc = func_80BDA2E0;
} }
@ -841,7 +873,7 @@ void func_80BDA2E0(EnPamera* this, PlayState* play) {
if (this->unk_31E == 1) { if (this->unk_31E == 1) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0; this->unk_31E = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PAMELA_ANIM_12);
} }
} }
} }

View File

@ -9,7 +9,8 @@ struct EnPamera;
typedef void (*EnPameraActionFunc)(struct EnPamera*, PlayState*); typedef void (*EnPameraActionFunc)(struct EnPamera*, PlayState*);
typedef void (*EnPameraSetupFunc)(struct EnPamera*, PlayState*); typedef void (*EnPameraSetupFunc)(struct EnPamera*, PlayState*);
#define ENPAMERA_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF0) >> 4) #define PAMELA_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF0) >> 4)
#define PAMELA_GET_F000(thisx) (((thisx)->params & 0xF000) >> 0xC)
typedef struct EnPamera { typedef struct EnPamera {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;

View File

@ -463,7 +463,7 @@ void EnPametfrog_SetupRearOnSnapperWave(EnPametfrog* this) {
} }
void EnPametfrog_RearOnSnapperWave(EnPametfrog* this, PlayState* play) { void EnPametfrog_RearOnSnapperWave(EnPametfrog* this, PlayState* play) {
if (SkelAnime_Update(&this->skelAnime) && this->timer > 0) { if (SkelAnime_Update(&this->skelAnime) && (this->timer > 0)) {
this->timer--; this->timer--;
if (this->timer == 0) { if (this->timer == 0) {
EnPametfrog_SetupRearOnSnapper(this); EnPametfrog_SetupRearOnSnapper(this);
@ -666,7 +666,7 @@ void EnPametfrog_SetupWallPause(EnPametfrog* this) {
this->wallRotation = this->unk_2E8.y > 0.0f ? (M_PI / 30) : (-M_PI / 30); this->wallRotation = this->unk_2E8.y > 0.0f ? (M_PI / 30) : (-M_PI / 30);
} else { } else {
randFloat = Rand_ZeroFloat(0x2000); randFloat = Rand_ZeroFloat(0x2000);
this->wallRotation = (Rand_ZeroOne() < 0.5f ? -1 : 1) * (0x1000 + randFloat) * (M_PI / (15 * 0x8000)); this->wallRotation = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (0x1000 + randFloat) * (M_PI / (15 * 0x8000));
} }
this->timer = 15; this->timer = 15;
Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_RUNAWAY2); Actor_PlaySfx(&this->actor, NA_SE_EN_FROG_RUNAWAY2);
@ -772,7 +772,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) {
} }
void EnPametfrog_JumpOnSnapper(EnPametfrog* this, PlayState* play) { void EnPametfrog_JumpOnSnapper(EnPametfrog* this, PlayState* play) {
f32 temp_f0; f32 lerp;
EnBigpamet* bigpamet; EnBigpamet* bigpamet;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
@ -781,9 +781,9 @@ void EnPametfrog_JumpOnSnapper(EnPametfrog* this, PlayState* play) {
EnPametfrog_SetupLandOnSnapper(this); EnPametfrog_SetupLandOnSnapper(this);
} else { } else {
bigpamet = (EnBigpamet*)this->actor.child; bigpamet = (EnBigpamet*)this->actor.child;
temp_f0 = 1.0f / this->timer; lerp = 1.0f / this->timer;
this->actor.world.pos.x -= (this->actor.world.pos.x - bigpamet->actor.world.pos.x) * temp_f0; this->actor.world.pos.x -= (this->actor.world.pos.x - bigpamet->actor.world.pos.x) * lerp;
this->actor.world.pos.z -= (this->actor.world.pos.z - bigpamet->actor.world.pos.z) * temp_f0; this->actor.world.pos.z -= (this->actor.world.pos.z - bigpamet->actor.world.pos.z) * lerp;
this->actor.world.pos.y = this->actor.world.pos.y =
Math_SinS((-this->timer * 0x1000) + 0x6000) * 65.0f + ((EnBigpamet*)this->actor.child)->unk_2AC; Math_SinS((-this->timer * 0x1000) + 0x6000) * 65.0f + ((EnBigpamet*)this->actor.child)->unk_2AC;
} }
@ -848,7 +848,7 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, PlayState* play) {
void EnPametfrog_FallInAir(EnPametfrog* this, PlayState* play) { void EnPametfrog_FallInAir(EnPametfrog* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
this->actor.colorFilterTimer = 0x10; this->actor.colorFilterTimer = 16;
if (this->timer > 0) { if (this->timer > 0) {
this->timer--; this->timer--;
if (this->timer == 0) { if (this->timer == 0) {
@ -903,7 +903,7 @@ void EnPametfrog_SetupDefeatGekko(EnPametfrog* this, PlayState* play) {
s16 yaw = Actor_WorldYawTowardPoint(this->actor.child, &this->actor.home.pos); s16 yaw = Actor_WorldYawTowardPoint(this->actor.child, &this->actor.home.pos);
s16 yawDiff = this->actor.yawTowardsPlayer - yaw; s16 yawDiff = this->actor.yawTowardsPlayer - yaw;
yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000; yaw = (yawDiff > 0) ? (yaw - 0x2000) : (yaw + 0x2000);
subCamEye.x = this->actor.child->focus.pos.x + 150.0f * Math_SinS(yaw); subCamEye.x = this->actor.child->focus.pos.x + 150.0f * Math_SinS(yaw);
subCamEye.y = this->actor.child->focus.pos.y + 20.0f; subCamEye.y = this->actor.child->focus.pos.y + 20.0f;
subCamEye.z = this->actor.child->focus.pos.z + 150.0f * Math_CosS(yaw); subCamEye.z = this->actor.child->focus.pos.z + 150.0f * Math_CosS(yaw);
@ -928,7 +928,7 @@ void EnPametfrog_SetupDefeatSnapper(EnPametfrog* this, PlayState* play) {
s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
s16 yawDiff = this->actor.yawTowardsPlayer - yaw; s16 yawDiff = this->actor.yawTowardsPlayer - yaw;
yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000; yaw = (yawDiff > 0) ? (yaw - 0x2000) : (yaw + 0x2000);
subCamEye.x = this->actor.world.pos.x + Math_SinS(yaw) * 150.0f; subCamEye.x = this->actor.world.pos.x + Math_SinS(yaw) * 150.0f;
subCamEye.y = this->actor.world.pos.y + 20.0f; subCamEye.y = this->actor.world.pos.y + 20.0f;
subCamEye.z = this->actor.world.pos.z + Math_CosS(yaw) * 150.0f; subCamEye.z = this->actor.world.pos.z + Math_CosS(yaw) * 150.0f;
@ -953,7 +953,7 @@ void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, PlayState* play) {
static Color_RGBA8 envColor = { 180, 180, 180, 255 }; static Color_RGBA8 envColor = { 180, 180, 180, 255 };
s16 yaw = BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))); s16 yaw = BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)));
Vec3f vec1; Vec3f vec1;
Vec3f vel; Vec3f velocity;
s32 i; s32 i;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y,
@ -967,11 +967,11 @@ void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, PlayState* play) {
Flags_SetClearTemp(play, play->roomCtx.curRoom.num); Flags_SetClearTemp(play, play->roomCtx.curRoom.num);
for (i = 0; i < 25; i++) { for (i = 0; i < 25; i++) {
vel.x = Rand_CenteredFloat(5.0f); velocity.x = Rand_CenteredFloat(5.0f);
vel.y = Rand_ZeroFloat(3.0f) + 4.0f; velocity.y = Rand_ZeroFloat(3.0f) + 4.0f;
vel.z = Rand_CenteredFloat(5.0f); velocity.z = Rand_CenteredFloat(5.0f);
EffectSsHahen_Spawn(play, &this->actor.world.pos, &vel, &sAccel, 0, Rand_S16Offset(12, 3), HAHEN_OBJECT_DEFAULT, EffectSsHahen_Spawn(play, &this->actor.world.pos, &velocity, &sAccel, 0, Rand_S16Offset(12, 3),
10, 0); HAHEN_OBJECT_DEFAULT, 10, 0);
} }
this->timer = 40; this->timer = 40;
@ -1056,7 +1056,7 @@ void EnPametfrog_JumpToLink(EnPametfrog* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
EnPametfrog_JumpOnGround(this, play); EnPametfrog_JumpOnGround(this, play);
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
(this->skelAnime.curFrame > 1.0f && this->skelAnime.curFrame < 12.0f)) { ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
this->actor.speed = 8.0f; this->actor.speed = 8.0f;
} else { } else {
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
@ -1096,9 +1096,9 @@ void EnPametfrog_MeleeAttack(EnPametfrog* this, PlayState* play) {
} }
} }
if ((this->skelAnime.animation == &gGekkoJabPunchAnim && Animation_OnFrame(&this->skelAnime, 2.0f)) || if (((this->skelAnime.animation == &gGekkoJabPunchAnim) && Animation_OnFrame(&this->skelAnime, 2.0f)) ||
(this->skelAnime.animation == &gGekkoHookPunchAnim && Animation_OnFrame(&this->skelAnime, 9.0f)) || ((this->skelAnime.animation == &gGekkoHookPunchAnim) && Animation_OnFrame(&this->skelAnime, 9.0f)) ||
(this->skelAnime.animation == &gGekkoKickAnim && Animation_OnFrame(&this->skelAnime, 2.0f)) || ((this->skelAnime.animation == &gGekkoKickAnim) && Animation_OnFrame(&this->skelAnime, 2.0f)) ||
((this->skelAnime.animation == &gGekkoWindupPunchAnim) && Animation_OnFrame(&this->skelAnime, 27.0f))) { ((this->skelAnime.animation == &gGekkoWindupPunchAnim) && Animation_OnFrame(&this->skelAnime, 27.0f))) {
this->collider.base.atFlags |= AT_ON; this->collider.base.atFlags |= AT_ON;
if (this->skelAnime.animation == &gGekkoKickAnim) { if (this->skelAnime.animation == &gGekkoKickAnim) {
@ -1186,8 +1186,8 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, PlayState* play) {
subCamAt.x = this->actor.world.pos.x; subCamAt.x = this->actor.world.pos.x;
subCamAt.z = this->actor.world.pos.z; subCamAt.z = this->actor.world.pos.z;
subCamAt.y = this->actor.world.pos.y + 45.0f; subCamAt.y = this->actor.world.pos.y + 45.0f;
subCamEye.x = (Math_SinS(this->actor.shape.rot.y) * 90.0f) + subCamAt.x; subCamEye.x = subCamAt.x + (Math_SinS(this->actor.shape.rot.y) * 90.0f);
subCamEye.z = (Math_CosS(this->actor.shape.rot.y) * 90.0f) + subCamAt.z; subCamEye.z = subCamAt.z + (Math_CosS(this->actor.shape.rot.y) * 90.0f);
subCamEye.y = subCamAt.y + 4.0f; subCamEye.y = subCamAt.y + 4.0f;
// Zooms in on Gekko // Zooms in on Gekko
@ -1330,7 +1330,7 @@ void EnPametfrog_ApplyDamageEffect(EnPametfrog* this, PlayState* play) {
void EnPametfrog_Update(Actor* thisx, PlayState* play) { void EnPametfrog_Update(Actor* thisx, PlayState* play) {
EnPametfrog* this = THIS; EnPametfrog* this = THIS;
f32 unk2C4; f32 unk2C4;
f32 arg3; f32 wallCheckRadius;
if (this->actor.params == GEKKO_CUTSCENE) { if (this->actor.params == GEKKO_CUTSCENE) {
EnPametfrog_SetupCutscene(this); EnPametfrog_SetupCutscene(this);
@ -1341,11 +1341,12 @@ void EnPametfrog_Update(Actor* thisx, PlayState* play) {
} }
this->actionFunc(this, play); this->actionFunc(this, play);
if ((this->actionFunc != EnPametfrog_JumpOnSnapper) && (this->actionFunc != EnPametfrog_RearOnSnapperRise)) { if ((this->actionFunc != EnPametfrog_JumpOnSnapper) && (this->actionFunc != EnPametfrog_RearOnSnapperRise)) {
if (this->actor.gravity < -0.1f) { if (this->actor.gravity < -0.1f) {
Actor_MoveWithGravity(&this->actor); Actor_MoveWithGravity(&this->actor);
arg3 = this->actionFunc == EnPametfrog_FallInAir ? 3.0f : 15.0f; wallCheckRadius = (this->actionFunc == EnPametfrog_FallInAir) ? 3.0f : 15.0f;
Actor_UpdateBgCheckInfo(play, &this->actor, 25.0f, arg3, 3.0f, Actor_UpdateBgCheckInfo(play, &this->actor, 25.0f, wallCheckRadius, 3.0f,
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_4 |
UPDBGCHECKINFO_FLAG_8 | UPDBGCHECKINFO_FLAG_10); UPDBGCHECKINFO_FLAG_8 | UPDBGCHECKINFO_FLAG_10);
} else if (this->freezeTimer == 0) { } else if (this->freezeTimer == 0) {
@ -1421,9 +1422,9 @@ void EnPametfrog_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s
center->y = vec.y; center->y = vec.y;
center->z = vec.z; center->z = vec.z;
center = &this->collider.elements[1].dim.worldSphere.center; center = &this->collider.elements[1].dim.worldSphere.center;
center->x = (Math_SinS(this->actor.shape.rot.y) * 35.0f) + this->actor.focus.pos.x; center->x = this->actor.focus.pos.x + (Math_SinS(this->actor.shape.rot.y) * 35.0f);
center->y = this->actor.focus.pos.y - 10.0f; center->y = this->actor.focus.pos.y - 10.0f;
center->z = (Math_CosS(this->actor.shape.rot.y) * 35.0f) + this->actor.focus.pos.z; center->z = this->actor.focus.pos.z + (Math_CosS(this->actor.shape.rot.y) * 35.0f);
} }
bodyPartIndex = sLimbToBodyParts[limbIndex]; bodyPartIndex = sLimbToBodyParts[limbIndex];

View File

@ -48,6 +48,7 @@ void func_80865390(EnPart* this, PlayState* play) {
this->actor.gravity = -0.6f - (Rand_ZeroOne() * 0.5f); this->actor.gravity = -0.6f - (Rand_ZeroOne() * 0.5f);
this->unk14C = 0.15f; this->unk14C = 0.15f;
break; break;
case ENPART_TYPE_15: case ENPART_TYPE_15:
this->actor.world.rot.y = this->actor.parent->shape.rot.y + 0x8000; this->actor.world.rot.y = this->actor.parent->shape.rot.y + 0x8000;
this->unk146 = 100; this->unk146 = 100;
@ -55,6 +56,9 @@ void func_80865390(EnPart* this, PlayState* play) {
this->actor.speed = 2.0f; this->actor.speed = 2.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
break; break;
default:
break;
} }
} }
@ -88,6 +92,7 @@ void func_808654C4(EnPart* this, PlayState* play) {
1); 1);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_EXTINCT); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 10, NA_SE_EN_EXTINCT);
break; break;
case ENPART_TYPE_4: case ENPART_TYPE_4:
for (i = 7; i >= 0; i--) { for (i = 7; i >= 0; i--) {
effectPos.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x; effectPos.x = Rand_CenteredFloat(60.0f) + this->actor.world.pos.x;
@ -100,6 +105,9 @@ void func_808654C4(EnPart* this, PlayState* play) {
DTBUBBLE_COLOR_PROFILE_RED, true); DTBUBBLE_COLOR_PROFILE_RED, true);
} }
break; break;
default:
break;
} }
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} else { } else {
@ -114,7 +122,8 @@ void EnPart_Update(Actor* thisx, PlayState* play) {
EnPart* this = THIS; EnPart* this = THIS;
Actor_MoveWithGravity(&this->actor); Actor_MoveWithGravity(&this->actor);
(*sActionFuncs[this->actionFuncIndex])(this, play);
sActionFuncs[this->actionFuncIndex](this, play);
} }
void EnPart_Draw(Actor* thisx, PlayState* play) { void EnPart_Draw(Actor* thisx, PlayState* play) {

View File

@ -8,7 +8,6 @@
#include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_ph/object_ph.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10) #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10)
@ -180,7 +179,7 @@ void EnPeehat_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_Init(play, &this->skelAnime, &object_ph_Skel_001C80, &object_ph_Anim_0009C4, this->jointTable, SkelAnime_Init(play, &this->skelAnime, &object_ph_Skel_001C80, &object_ph_Anim_0009C4, this->jointTable,
this->morphTable, 24); this->morphTable, OBJECT_PH_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 27.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 27.0f);
this->unk_2B0 = 0; this->unk_2B0 = 0;
Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos); Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos);
@ -382,12 +381,14 @@ void func_80897910(EnPeehat* this, PlayState* play) {
Math_StepToF(&this->actor.speed, 3.0f, 0.25f); Math_StepToF(&this->actor.speed, 3.0f, 0.25f);
Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 80.0f, 3.0f); Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 80.0f, 3.0f);
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (!gSaveContext.save.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) { if (!gSaveContext.save.isNight && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 1200.0f)) {
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1000); Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1000);
this->actor.shape.rot.y += (s16)(this->unk_2AD * 450); this->actor.shape.rot.y += (s16)(this->unk_2AD * 450);
} else { } else {
func_80898124(this); func_80898124(this);
} }
Math_ScaledStepToS(&this->unk_2B2, 4000, 500); Math_ScaledStepToS(&this->unk_2B2, 4000, 500);
this->unk_2B4 += this->unk_2B2; this->unk_2B4 += this->unk_2B2;
Math_StepToF(&this->unk_2C4, 0.075f, 0.005f); Math_StepToF(&this->unk_2C4, 0.075f, 0.005f);
@ -472,11 +473,12 @@ void func_80897D48(EnPeehat* this, PlayState* play) {
Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f); Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f);
Math_StepToF(&this->actor.speed, 0.0f, 1.0f); Math_StepToF(&this->actor.speed, 0.0f, 1.0f);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 50); Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 50);
if (SkelAnime_Update(&this->skelAnime)) { if (SkelAnime_Update(&this->skelAnime)) {
func_80897498(this); func_80897498(this);
this->actor.world.pos.y = this->actor.floorHeight; this->actor.world.pos.y = this->actor.floorHeight;
Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_LAND); Actor_PlaySfx(&this->actor, NA_SE_EN_PIHAT_LAND);
} else if (this->actor.floorHeight < this->actor.world.pos.y) { } else if (this->actor.world.pos.y > this->actor.floorHeight) {
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight, 0.3f, 3.5f, 0.25f); Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight, 0.3f, 3.5f, 0.25f);
if ((this->actor.world.pos.y - this->actor.floorHeight) < 60.0f) { if ((this->actor.world.pos.y - this->actor.floorHeight) < 60.0f) {
Math_Vec3f_Copy(&sp34, &this->actor.world.pos); Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
@ -794,16 +796,15 @@ void EnPeehat_Update(Actor* thisx, PlayState* play2) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderTris.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderTris.base);
if (thisx->params == 0) { if (thisx->params == 0) {
Vec3f sp74; Vec3f sp74;
CollisionPoly* sp70; CollisionPoly* poly = NULL;
s32 sp6C; s32 bgId;
s32 i; s32 i;
sp70 = NULL;
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base);
for (i = 1; i >= 0; i--) { for (i = 1; i >= 0; i--) {
if (BgCheck_EntityLineTest1(&play->colCtx, &thisx->world.pos, &this->unk_2D4[i], &sp74, &sp70, true, if (BgCheck_EntityLineTest1(&play->colCtx, &thisx->world.pos, &this->unk_2D4[i], &sp74, &poly, true,
true, false, true, &sp6C)) { true, false, true, &bgId)) {
func_800BBFB0(play, &sp74, 0.0f, 1, 300, 150, 1); func_800BBFB0(play, &sp74, 0.0f, 1, 300, 150, 1);
func_80897258(play, this, &sp74, 0.0f, 1.5f); func_80897258(play, this, &sp74, 0.0f, 1.5f);
} }
@ -837,10 +838,11 @@ s32 EnPeehat_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
EnPeehat* this = THIS; EnPeehat* this = THIS;
s32 pad; s32 pad;
if (limbIndex == 4) { if (limbIndex == OBJECT_PH_LIMB_04) {
rot->x = -this->unk_2B4; rot->x = -this->unk_2B4;
} else if ((limbIndex == 3) || } else if ((limbIndex == OBJECT_PH_LIMB_03) ||
((limbIndex == 23) && ((this->actionFunc == func_80898594) || (this->actionFunc == func_80897520)))) { ((limbIndex == OBJECT_PH_LIMB_17) &&
((this->actionFunc == func_80898594) || (this->actionFunc == func_80897520)))) {
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
Gfx* gfx = POLY_OPA_DISP; Gfx* gfx = POLY_OPA_DISP;
@ -912,10 +914,10 @@ void EnPeehat_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s*
Matrix_MultVecX(4000.0f, &this->bodyPartsPos[bodyPartIndex + 1]); Matrix_MultVecX(4000.0f, &this->bodyPartsPos[bodyPartIndex + 1]);
} }
if (limbIndex == 4) { if (limbIndex == OBJECT_PH_LIMB_04) {
Matrix_MultVecZ(5500.0f, &this->unk_2D4[0]); Matrix_MultVecZ(5500.0f, &this->unk_2D4[0]);
Matrix_MultVecZ(-5500.0f, &this->unk_2D4[1]); Matrix_MultVecZ(-5500.0f, &this->unk_2D4[1]);
} else if ((limbIndex == 3) && (thisx->params == 0)) { } else if ((limbIndex == OBJECT_PH_LIMB_03) && (thisx->params == 0)) {
Vec3f* vec = &D_80899570[0]; Vec3f* vec = &D_80899570[0];
Vec3f* bodyPartPosPtr = &this->bodyPartsPos[PEEHAT_BODYPART_12]; Vec3f* bodyPartPosPtr = &this->bodyPartsPos[PEEHAT_BODYPART_12];

View File

@ -2,6 +2,7 @@
#define Z_EN_PEEHAT_H #define Z_EN_PEEHAT_H
#include "global.h" #include "global.h"
#include "objects/object_ph/object_ph.h"
struct EnPeehat; struct EnPeehat;
@ -32,8 +33,8 @@ typedef enum PeehatBodyPart {
typedef struct EnPeehat { typedef struct EnPeehat {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime; /* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[24]; /* 0x188 */ Vec3s jointTable[OBJECT_PH_LIMB_MAX];
/* 0x188 */ Vec3s morphTable[24]; /* 0x188 */ Vec3s morphTable[OBJECT_PH_LIMB_MAX];
/* 0x2A8 */ EnPeehatActionFunc actionFunc; /* 0x2A8 */ EnPeehatActionFunc actionFunc;
/* 0x2AC */ u8 unk_2AC; /* 0x2AC */ u8 unk_2AC;
/* 0x2AD */ s8 unk_2AD; /* 0x2AD */ s8 unk_2AD;

View File

@ -148,7 +148,6 @@ static InitChainEntry sInitChain[] = {
// clang-format off // clang-format off
// PoSisters have their own flags variable for cross function behavior detection // PoSisters have their own flags variable for cross function behavior detection
#define POE_SISTERS_FLAG_CLEAR (0)
#define POE_SISTERS_FLAG_CHECK_AC (1 << 0) #define POE_SISTERS_FLAG_CHECK_AC (1 << 0)
#define POE_SISTERS_FLAG_UPDATE_SHAPE_ROT (1 << 1) #define POE_SISTERS_FLAG_UPDATE_SHAPE_ROT (1 << 1)
#define POE_SISTERS_FLAG_CHECK_Z_TARGET (1 << 2) // Meg doesnt go invisible if you ztarget her for too long #define POE_SISTERS_FLAG_CHECK_Z_TARGET (1 << 2) // Meg doesnt go invisible if you ztarget her for too long
@ -230,12 +229,10 @@ void EnPoSisters_UpdateDeathFlameSwirl(EnPoSisters* this, s32 deathTimerParam, V
for (i = 0; i < this->fireCount; i++) { for (i = 0; i < this->fireCount; i++) {
firePos = &this->firePos[i]; firePos = &this->firePos[i];
firePos->x = Math_SinS(this->actor.shape.rot.y + (this->deathTimer * 0x800) + (i * 0x2000)) * firePos->x = pos->x + Math_SinS(this->actor.shape.rot.y + (this->deathTimer * 0x800) + (i * 0x2000)) *
(SQ(deathTimerParamF) * 0.1f) + (SQ(deathTimerParamF) * 0.1f);
pos->x; firePos->z = pos->z + Math_CosS(this->actor.shape.rot.y + (this->deathTimer * 0x800) + (i * 0x2000)) *
firePos->z = Math_CosS(this->actor.shape.rot.y + (this->deathTimer * 0x800) + (i * 0x2000)) * (SQ(deathTimerParamF) * 0.1f);
(SQ(deathTimerParamF) * 0.1f) +
pos->z;
firePos->y = pos->y + deathTimerParamF; firePos->y = pos->y + deathTimerParamF;
} }
} }
@ -257,8 +254,8 @@ void EnPoSisters_MatchPlayerXZ(EnPoSisters* this, PlayState* play) {
dist = this->actor.parent->xzDistToPlayer; dist = this->actor.parent->xzDistToPlayer;
} }
this->actor.world.pos.x = (Math_SinS(BINANG_ROT180(this->actor.shape.rot.y)) * dist) + player->actor.world.pos.x; this->actor.world.pos.x = player->actor.world.pos.x + (Math_SinS(BINANG_ROT180(this->actor.shape.rot.y)) * dist);
this->actor.world.pos.z = (Math_CosS(BINANG_ROT180(this->actor.shape.rot.y)) * dist) + player->actor.world.pos.z; this->actor.world.pos.z = player->actor.world.pos.z + (Math_CosS(BINANG_ROT180(this->actor.shape.rot.y)) * dist);
} }
void EnPoSisters_MatchPlayerY(EnPoSisters* this, PlayState* play) { void EnPoSisters_MatchPlayerY(EnPoSisters* this, PlayState* play) {
@ -663,7 +660,7 @@ void EnPoSisters_SetupDeathStage1(EnPoSisters* this) {
this->actor.world.pos.y += 42.0f; this->actor.world.pos.y += 42.0f;
this->actor.shape.yOffset = -6000.0f; this->actor.shape.yOffset = -6000.0f;
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
this->poSisterFlags = POE_SISTERS_FLAG_CLEAR; this->poSisterFlags = 0;
this->actionFunc = EnPoSisters_DeathStage1; this->actionFunc = EnPoSisters_DeathStage1;
} }

View File

@ -850,11 +850,12 @@ s32 EnPoh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
Gfx** gfx) { Gfx** gfx) {
EnPoh* this = THIS; EnPoh* this = THIS;
if ((this->unk_197 == 0) || (limbIndex == 18) || ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 2))) { if ((this->unk_197 == 0) || (limbIndex == POE_LIMB_LANTERN) ||
((this->actionFunc == func_80B2D300) && (this->unk_18E >= 2))) {
*dList = NULL; *dList = NULL;
} }
if (limbIndex == 19) { if (limbIndex == POE_LIMB_RIGHT_FOREARM) {
gDPPipeSync((*gfx)++); gDPPipeSync((*gfx)++);
gDPSetEnvColor((*gfx)++, this->unk_194, this->unk_195, this->unk_196, this->unk_197); gDPSetEnvColor((*gfx)++, this->unk_194, this->unk_195, this->unk_196, this->unk_197);
} }
@ -899,12 +900,13 @@ void EnPoh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
s32 pad; s32 pad;
Collider_UpdateSpheres(limbIndex, &this->colliderSph); Collider_UpdateSpheres(limbIndex, &this->colliderSph);
if ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 2) && (limbIndex == 5)) {
if ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 2) && (limbIndex == POE_LIMB_TOP_CLOAK)) {
gSPMatrix((*gfx)++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix((*gfx)++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList((*gfx)++, gPoeBurnDL); gSPDisplayList((*gfx)++, gPoeBurnDL);
} }
if (limbIndex == 18) { if (limbIndex == POE_LIMB_LANTERN) {
if ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 19) && (this->actor.scale.x != 0.0f)) { if ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 19) && (this->actor.scale.x != 0.0f)) {
Matrix_Scale(0.01f / this->actor.scale.x, 0.01f / this->actor.scale.x, 0.01f / this->actor.scale.x, Matrix_Scale(0.01f / this->actor.scale.x, 0.01f / this->actor.scale.x, 0.01f / this->actor.scale.x,
MTXMODE_APPLY); MTXMODE_APPLY);

View File

@ -206,31 +206,6 @@ static Color_RGBA8 sDustPrimColor = { 60, 50, 20, 255 };
static Color_RGBA8 sDustEnvColor = { 40, 30, 30, 255 }; static Color_RGBA8 sDustEnvColor = { 40, 30, 30, 255 };
typedef enum {
/* 0 */ EN_PP_ANIM_IDLE,
/* 1 */ EN_PP_ANIM_WALK,
/* 2 */ EN_PP_ANIM_WIND_UP,
/* 3 */ EN_PP_ANIM_CHARGE,
/* 4 */ EN_PP_ANIM_ATTACK,
/* 5 */ EN_PP_ANIM_DAMAGE,
/* 6 */ EN_PP_ANIM_ROAR,
/* 7 */ EN_PP_ANIM_TURN_TO_FACE_PLAYER,
/* 8 */ EN_PP_ANIM_JUMP,
/* 9 */ EN_PP_ANIM_LAND
} EnPpAnimation;
static AnimationHeader* sAnimations[] = {
&gHiploopIdleAnim, &gHiploopWalkAnim, &gHiploopWindUpAnim, &gHiploopChargeAnim, &gHiploopAttackAnim,
&gHiploopDamageAnim, &gHiploopRoarAnim, &gHiploopWalkAnim, &gHiploopWindUpAnim, &gHiploopWalkAnim,
};
static u8 sAnimationModes[] = {
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_ONCE,
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE,
};
static s16 sLedgeCheckAngles[] = { 0x0000, 0x1000, 0xF000 };
void EnPp_Init(Actor* thisx, PlayState* play) { void EnPp_Init(Actor* thisx, PlayState* play) {
EnPp* this = THIS; EnPp* this = THIS;
EffectBlureInit1 blureInit; EffectBlureInit1 blureInit;
@ -411,13 +386,53 @@ void EnPp_SpawnDust(EnPp* this, PlayState* play) {
} }
} }
typedef enum {
/* 0 */ EN_PP_ANIM_IDLE,
/* 1 */ EN_PP_ANIM_WALK,
/* 2 */ EN_PP_ANIM_WIND_UP,
/* 3 */ EN_PP_ANIM_CHARGE,
/* 4 */ EN_PP_ANIM_ATTACK,
/* 5 */ EN_PP_ANIM_DAMAGE,
/* 6 */ EN_PP_ANIM_ROAR,
/* 7 */ EN_PP_ANIM_TURN_TO_FACE_PLAYER,
/* 8 */ EN_PP_ANIM_JUMP,
/* 9 */ EN_PP_ANIM_LAND,
/* 10 */ EN_PP_ANIM_MAX
} EnPpAnimation;
static AnimationHeader* sAnimations[EN_PP_ANIM_MAX] = {
&gHiploopIdleAnim, // EN_PP_ANIM_IDLE
&gHiploopWalkAnim, // EN_PP_ANIM_WALK
&gHiploopWindUpAnim, // EN_PP_ANIM_WIND_UP
&gHiploopChargeAnim, // EN_PP_ANIM_CHARGE
&gHiploopAttackAnim, // EN_PP_ANIM_ATTACK
&gHiploopDamageAnim, // EN_PP_ANIM_DAMAGE
&gHiploopRoarAnim, // EN_PP_ANIM_ROAR
&gHiploopWalkAnim, // EN_PP_ANIM_TURN_TO_FACE_PLAYER
&gHiploopWindUpAnim, // EN_PP_ANIM_JUMP
&gHiploopWalkAnim, // EN_PP_ANIM_LAND
};
static u8 sAnimationModes[EN_PP_ANIM_MAX] = {
ANIMMODE_LOOP, // EN_PP_ANIM_IDLE
ANIMMODE_LOOP, // EN_PP_ANIM_WALK
ANIMMODE_ONCE, // EN_PP_ANIM_WIND_UP
ANIMMODE_LOOP, // EN_PP_ANIM_CHARGE
ANIMMODE_ONCE, // EN_PP_ANIM_ATTACK
ANIMMODE_LOOP, // EN_PP_ANIM_DAMAGE
ANIMMODE_LOOP, // EN_PP_ANIM_ROAR
ANIMMODE_LOOP, // EN_PP_ANIM_TURN_TO_FACE_PLAYER
ANIMMODE_ONCE, // EN_PP_ANIM_JUMP
ANIMMODE_ONCE, // EN_PP_ANIM_LAND
};
void EnPp_ChangeAnim(EnPp* this, s32 animIndex) { void EnPp_ChangeAnim(EnPp* this, s32 animIndex) {
f32 morphFrames = -10.0f; f32 morphFrames = -10.0f;
f32 playSpeed; f32 playSpeed;
f32 startFrame; f32 startFrame;
this->animIndex = animIndex; this->animIndex = animIndex;
this->endFrame = Animation_GetLastFrame(sAnimations[this->animIndex]); this->animEndFrame = Animation_GetLastFrame(sAnimations[this->animIndex]);
if (this->animIndex >= EN_PP_ANIM_WIND_UP) { if (this->animIndex >= EN_PP_ANIM_WIND_UP) {
morphFrames = 0.0f; morphFrames = 0.0f;
@ -430,10 +445,10 @@ void EnPp_ChangeAnim(EnPp* this, s32 animIndex) {
startFrame = 0.0f; startFrame = 0.0f;
if (this->action == EN_PP_ACTION_BODY_PART_MOVE) { if (this->action == EN_PP_ACTION_BODY_PART_MOVE) {
startFrame = this->endFrame; startFrame = this->animEndFrame;
} }
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], playSpeed, startFrame, this->endFrame, Animation_Change(&this->skelAnime, sAnimations[this->animIndex], playSpeed, startFrame, this->animEndFrame,
sAnimationModes[this->animIndex], morphFrames); sAnimationModes[this->animIndex], morphFrames);
} }
@ -477,6 +492,7 @@ void EnPp_PlaySfxForAnimation(EnPp* this) {
* Checks to see if the Hiploop is about to walk off a ledge or into a wall. * Checks to see if the Hiploop is about to walk off a ledge or into a wall.
*/ */
s32 EnPp_CheckCollision(EnPp* this, PlayState* play) { s32 EnPp_CheckCollision(EnPp* this, PlayState* play) {
static s16 sLedgeCheckAngles[] = { 0x0000, 0x1000, 0xF000 };
s16 angle; s16 angle;
s32 i; s32 i;
@ -618,7 +634,7 @@ void EnPp_Charge(EnPp* this, PlayState* play) {
} else if (this->animIndex == EN_PP_ANIM_TURN_TO_FACE_PLAYER) { } else if (this->animIndex == EN_PP_ANIM_TURN_TO_FACE_PLAYER) {
EnPp_ChangeAnim(this, EN_PP_ANIM_WIND_UP); EnPp_ChangeAnim(this, EN_PP_ANIM_WIND_UP);
} else if (this->animIndex == EN_PP_ANIM_WIND_UP) { } else if (this->animIndex == EN_PP_ANIM_WIND_UP) {
if (this->endFrame <= curFrame) { if (curFrame >= this->animEndFrame) {
this->chargeAndBounceSpeed = 14.0f; this->chargeAndBounceSpeed = 14.0f;
this->timer = 20; this->timer = 20;
EnPp_ChangeAnim(this, EN_PP_ANIM_CHARGE); EnPp_ChangeAnim(this, EN_PP_ANIM_CHARGE);
@ -686,7 +702,7 @@ void EnPp_Attack(EnPp* this, PlayState* play) {
f32 curFrame = this->skelAnime.curFrame; f32 curFrame = this->skelAnime.curFrame;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->endFrame <= curFrame) { if (curFrame >= this->animEndFrame) {
EnPp_SetupCharge(this); EnPp_SetupCharge(this);
} }
} }
@ -773,7 +789,7 @@ void EnPp_Roar(EnPp* this, PlayState* play) {
this->secondaryTimer = 3; this->secondaryTimer = 3;
} }
if (!this->actionVar.hasDoneFirstRoar && (this->endFrame <= curFrame)) { if (!this->actionVar.hasDoneFirstRoar && (curFrame >= this->animEndFrame)) {
this->skelAnime.startFrame = 6.0f; this->skelAnime.startFrame = 6.0f;
this->actionVar.hasDoneFirstRoar = true; this->actionVar.hasDoneFirstRoar = true;
} }
@ -836,7 +852,7 @@ void EnPp_Jump(EnPp* this, PlayState* play) {
this->actionVar.hasLandedFromJump = true; this->actionVar.hasLandedFromJump = true;
EnPp_ChangeAnim(this, EN_PP_ANIM_LAND); EnPp_ChangeAnim(this, EN_PP_ANIM_LAND);
} }
} else if (this->endFrame <= curFrame) { } else if (curFrame >= this->animEndFrame) {
EnPp_SetupIdle(this); EnPp_SetupIdle(this);
} }
} }

View File

@ -75,7 +75,7 @@ typedef struct EnPp {
} actionVar; } actionVar;
/* 0x2D4 */ s16 maskBounceAngularVelocity; // Controls the speed that the Hiploop rotates to face the player when an attack bounces off the mask. /* 0x2D4 */ s16 maskBounceAngularVelocity; // Controls the speed that the Hiploop rotates to face the player when an attack bounces off the mask.
/* 0x2D6 */ s16 deadBodyPartsSpawnedCount; /* 0x2D6 */ s16 deadBodyPartsSpawnedCount;
/* 0x2D8 */ f32 endFrame; /* 0x2D8 */ f32 animEndFrame;
/* 0x2DC */ f32 chargeAndBounceSpeed; /* 0x2DC */ f32 chargeAndBounceSpeed;
/* 0x2DC */ Vec3f ledgeCheckPos[3]; /* 0x2DC */ Vec3f ledgeCheckPos[3];
/* 0x304 */ Vec3f wallCheckPos; /* 0x304 */ Vec3f wallCheckPos;

View File

@ -7,7 +7,6 @@
#include "z_en_pr.h" #include "z_en_pr.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "overlays/actors/ovl_En_Prz/z_en_prz.h" #include "overlays/actors/ovl_En_Prz/z_en_prz.h"
#include "objects/object_pr/object_pr.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10) #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10)
@ -107,13 +106,29 @@ static ColliderCylinderInit sCylinderInit = {
{ 18, 20, 5, { 0, 0, 0 } }, { 18, 20, 5, { 0, 0, 0 } },
}; };
static AnimationHeader* sAnimations[] = { typedef enum EnPrAnimation {
&object_pr_Anim_0021E8, &object_pr_Anim_001E10, &object_pr_Anim_0021E8, /* 0 */ ENPR_ANIM_0,
&object_pr_Anim_000740, &object_pr_Anim_000268, /* 1 */ ENPR_ANIM_1,
/* 2 */ ENPR_ANIM_2,
/* 3 */ ENPR_ANIM_3,
/* 4 */ ENPR_ANIM_4,
/* 5 */ ENPR_ANIM_MAX
} EnPrAnimation;
static AnimationHeader* sAnimations[ENPR_ANIM_MAX] = {
&object_pr_Anim_0021E8, // ENPR_ANIM_0
&object_pr_Anim_001E10, // ENPR_ANIM_1
&object_pr_Anim_0021E8, // ENPR_ANIM_2
&object_pr_Anim_000740, // ENPR_ANIM_3
&object_pr_Anim_000268, // ENPR_ANIM_4
}; };
u8 D_80A33934[] = { static u8 sAnimationModes[ENPR_ANIM_MAX] = {
ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP, // ENPR_ANIM_0
ANIMMODE_ONCE, // ENPR_ANIM_1
ANIMMODE_LOOP, // ENPR_ANIM_2
ANIMMODE_LOOP, // ENPR_ANIM_3
ANIMMODE_ONCE, // ENPR_ANIM_4
}; };
void EnPr_Init(Actor* thisx, PlayState* play2) { void EnPr_Init(Actor* thisx, PlayState* play2) {
@ -140,7 +155,7 @@ void EnPr_Init(Actor* thisx, PlayState* play2) {
this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.damageTable = &sDamageTable;
SkelAnime_InitFlex(play, &this->skelAnime, &object_pr_Skel_0038B8, &object_pr_Anim_0021E8, this->jointTable, SkelAnime_InitFlex(play, &this->skelAnime, &object_pr_Skel_0038B8, &object_pr_Anim_0021E8, this->jointTable,
this->morphTable, 10); this->morphTable, OBJECT_PR_1_LIMB_MAX);
this->unk_2C8 = this->actor.world.rot.z * 20.0f; this->unk_2C8 = this->actor.world.rot.z * 20.0f;
if (this->unk_2C8 < 80.0f) { if (this->unk_2C8 < 80.0f) {
@ -182,26 +197,26 @@ void EnPr_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider); Collider_DestroyCylinder(play, &this->collider);
} }
void func_80A3242C(EnPr* this, s32 arg0) { void EnPr_ChangeAnim(EnPr* this, s32 animIndex) {
f32 sp34; f32 playSpeed;
this->unk_21C = arg0; this->animIndex = animIndex;
sp34 = 1.0f; playSpeed = 1.0f;
this->unk_2BC = Animation_GetLastFrame(sAnimations[arg0]); this->unk_2BC = Animation_GetLastFrame(sAnimations[animIndex]);
if (this->unk_21C == 2) { if (this->animIndex == ENPR_ANIM_2) {
sp34 = 2.0f; playSpeed = 2.0f;
} }
Animation_Change(&this->skelAnime, sAnimations[this->unk_21C], sp34, 0.0f, this->unk_2BC, D_80A33934[this->unk_21C], Animation_Change(&this->skelAnime, sAnimations[this->animIndex], playSpeed, 0.0f, this->unk_2BC,
-2.0f); sAnimationModes[this->animIndex], -2.0f);
} }
s32 func_80A324E0(EnPr* this, PlayState* play) { s32 func_80A324E0(EnPr* this, PlayState* play) {
CollisionPoly* sp54; CollisionPoly* sp54;
Vec3f sp48; Vec3f sp48;
s32 sp44; s32 sp44;
WaterBox* sp40; WaterBox* waterBox;
if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->unk_2E0, &sp48, &sp54, 1, 0, 0, 1, if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->unk_2E0, &sp48, &sp54, 1, 0, 0, 1,
&sp44)) { &sp44)) {
@ -209,7 +224,7 @@ s32 func_80A324E0(EnPr* this, PlayState* play) {
} }
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4,
&sp40)) { &waterBox)) {
if ((this->unk_2B4 - 30.0f) < this->actor.world.pos.y) { if ((this->unk_2B4 - 30.0f) < this->actor.world.pos.y) {
this->unk_2B8 = this->unk_2B4 - 30.0f; this->unk_2B8 = this->unk_2B4 - 30.0f;
return 2; return 2;
@ -244,8 +259,8 @@ s32 func_80A325E4(EnPr* this) {
} }
void func_80A326F0(EnPr* this) { void func_80A326F0(EnPr* this) {
if (this->unk_21C != 0) { if (this->animIndex != ENPR_ANIM_0) {
func_80A3242C(this, 0); EnPr_ChangeAnim(this, ENPR_ANIM_0);
} }
this->unk_206 = 0; this->unk_206 = 0;
this->actor.speed = 1.0f; this->actor.speed = 1.0f;
@ -278,8 +293,8 @@ void func_80A32740(EnPr* this, PlayState* play) {
} }
void func_80A32854(EnPr* this) { void func_80A32854(EnPr* this) {
if (this->unk_21C != 0) { if (this->animIndex != ENPR_ANIM_0) {
func_80A3242C(this, 0); EnPr_ChangeAnim(this, ENPR_ANIM_0);
} }
this->unk_206 = 1; this->unk_206 = 1;
this->actionFunc = func_80A3289C; this->actionFunc = func_80A3289C;
@ -312,8 +327,8 @@ void func_80A32984(EnPr* this, PlayState* play) {
if (func_80A324E0(this, play)) { if (func_80A324E0(this, play)) {
this->unk_22C += 0x1000; this->unk_22C += 0x1000;
} else { } else {
if (this->unk_21C != 0) { if (this->animIndex != ENPR_ANIM_0) {
func_80A3242C(this, 0); EnPr_ChangeAnim(this, ENPR_ANIM_0);
} }
this->unk_206 = 3; this->unk_206 = 3;
this->actionFunc = func_80A32A40; this->actionFunc = func_80A32A40;
@ -323,13 +338,13 @@ void func_80A32984(EnPr* this, PlayState* play) {
void func_80A32A40(EnPr* this, PlayState* play) { void func_80A32A40(EnPr* this, PlayState* play) {
Vec3f sp34; Vec3f sp34;
WaterBox* sp30; WaterBox* waterBox;
Math_Vec3f_Copy(&sp34, &this->actor.world.pos); Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
sp34.y = Rand_CenteredFloat(50.0f) + this->actor.home.pos.y; sp34.y = Rand_CenteredFloat(50.0f) + this->actor.home.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4,
&sp30)) { &waterBox)) {
if (sp34.y < (this->unk_2B4 - 30.0f)) { if (sp34.y < (this->unk_2B4 - 30.0f)) {
this->unk_2B8 = sp34.y; this->unk_2B8 = sp34.y;
} else { } else {
@ -372,7 +387,7 @@ void func_80A32B20(EnPr* this, PlayState* play) {
} }
void func_80A32CDC(EnPr* this) { void func_80A32CDC(EnPr* this) {
func_80A3242C(this, 3); EnPr_ChangeAnim(this, ENPR_ANIM_3);
this->unk_206 = 5; this->unk_206 = 5;
this->unk_20A = 400; this->unk_20A = 400;
this->unk_2C0 = 0.0f; this->unk_2C0 = 0.0f;
@ -401,7 +416,7 @@ void func_80A32D28(EnPr* this, PlayState* play) {
} }
void func_80A32E60(EnPr* this) { void func_80A32E60(EnPr* this) {
func_80A3242C(this, 4); EnPr_ChangeAnim(this, ENPR_ANIM_4);
this->unk_206 = 6; this->unk_206 = 6;
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
this->actionFunc = func_80A32EA4; this->actionFunc = func_80A32EA4;
@ -427,7 +442,7 @@ void func_80A32EA4(EnPr* this, PlayState* play) {
} }
void func_80A32F48(EnPr* this, PlayState* play) { void func_80A32F48(EnPr* this, PlayState* play) {
WaterBox* sp2C; WaterBox* waterBox;
if (this->unk_208 > 0) { if (this->unk_208 > 0) {
this->unk_208 -= 2; this->unk_208 -= 2;
@ -436,7 +451,7 @@ void func_80A32F48(EnPr* this, PlayState* play) {
} }
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_2B4,
&sp2C)) { &waterBox)) {
if ((this->unk_2B4 - 100.0f) < this->actor.world.pos.y) { if ((this->unk_2B4 - 100.0f) < this->actor.world.pos.y) {
this->unk_212 += 0xBB8; this->unk_212 += 0xBB8;
this->unk_2C4 = 2.0f * Math_SinS(this->unk_212); this->unk_2C4 = 2.0f * Math_SinS(this->unk_212);
@ -572,7 +587,7 @@ void EnPr_Update(Actor* thisx, PlayState* play) {
s32 EnPr_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { s32 EnPr_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnPr* this = THIS; EnPr* this = THIS;
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_1_LIMB_02) {
rot->y += this->unk_214; rot->y += this->unk_214;
} }
return false; return false;
@ -582,13 +597,16 @@ void EnPr_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
Vec3f sp24 = { 0.0f, 0.0f, 0.0f }; Vec3f sp24 = { 0.0f, 0.0f, 0.0f };
EnPr* this = THIS; EnPr* this = THIS;
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_1_LIMB_02) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_MultVec3f(&sp24, &this->unk_2D4); Matrix_MultVec3f(&sp24, &this->unk_2D4);
} }
if ((limbIndex == 0) || (limbIndex == 1) || (limbIndex == 2) || (limbIndex == 3) || (limbIndex == 4) || if ((limbIndex == OBJECT_PR_1_LIMB_NONE) || (limbIndex == OBJECT_PR_1_LIMB_01) ||
(limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 9)) { (limbIndex == OBJECT_PR_1_LIMB_02) || (limbIndex == OBJECT_PR_1_LIMB_03) ||
(limbIndex == OBJECT_PR_1_LIMB_04) || (limbIndex == OBJECT_PR_1_LIMB_05) ||
(limbIndex == OBJECT_PR_1_LIMB_06) || (limbIndex == OBJECT_PR_1_LIMB_07) ||
(limbIndex == OBJECT_PR_1_LIMB_08) || (limbIndex == OBJECT_PR_1_LIMB_09)) {
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]); Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++; this->bodyPartsCount++;
if (this->bodyPartsCount >= ENPR_BODYPART_MAX) { if (this->bodyPartsCount >= ENPR_BODYPART_MAX) {

View File

@ -2,6 +2,7 @@
#define Z_EN_PR_H #define Z_EN_PR_H
#include "global.h" #include "global.h"
#include "objects/object_pr/object_pr.h"
struct EnPr; struct EnPr;
@ -29,8 +30,8 @@ typedef enum EnPrBodyPart {
typedef struct EnPr { typedef struct EnPr {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime; /* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[10]; /* 0x188 */ Vec3s jointTable[OBJECT_PR_1_LIMB_MAX];
/* 0x1C4 */ Vec3s morphTable[10]; /* 0x1C4 */ Vec3s morphTable[OBJECT_PR_1_LIMB_MAX];
/* 0x200 */ EnPrActionFunc actionFunc; /* 0x200 */ EnPrActionFunc actionFunc;
/* 0x204 */ u8 unk_204; /* 0x204 */ u8 unk_204;
/* 0x206 */ s16 unk_206; /* 0x206 */ s16 unk_206;
@ -43,7 +44,7 @@ typedef struct EnPr {
/* 0x214 */ s16 unk_214; /* 0x214 */ s16 unk_214;
/* 0x216 */ s16 unk_216; /* 0x216 */ s16 unk_216;
/* 0x218 */ UNK_TYPE1 unk218[4]; /* 0x218 */ UNK_TYPE1 unk218[4];
/* 0x21C */ s32 unk_21C; /* 0x21C */ s32 animIndex;
/* 0x220 */ UNK_TYPE1 unk220[0x8]; /* 0x220 */ UNK_TYPE1 unk220[0x8];
/* 0x228 */ s32 bodyPartsCount; /* 0x228 */ s32 bodyPartsCount;
/* 0x22C */ s16 unk_22C; /* 0x22C */ s16 unk_22C;

View File

@ -5,7 +5,6 @@
*/ */
#include "z_en_pr2.h" #include "z_en_pr2.h"
#include "objects/object_pr/object_pr.h"
#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10) #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10)
@ -93,13 +92,24 @@ ActorInit En_Pr2_InitVars = {
/**/ EnPr2_Draw, /**/ EnPr2_Draw,
}; };
static AnimationHeader* sAnimations[] = { typedef enum EnPr2Animation {
&object_pr_Anim_004340, /* 0 */ ENPR2_ANIM_0,
&object_pr_Anim_004274, /* 1 */ ENPR2_ANIM_1,
&object_pr_Anim_003904, /* 2 */ ENPR2_ANIM_2,
/* 3 */ ENPR2_ANIM_MAX
} EnPr2Animation;
static AnimationHeader* sAnimations[ENPR2_ANIM_MAX] = {
&object_pr_Anim_004340, // ENPR2_ANIM_0
&object_pr_Anim_004274, // ENPR2_ANIM_1
&object_pr_Anim_003904, // ENPR2_ANIM_2
}; };
u8 D_80A75C38[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE }; static u8 sAnimationModes[ENPR2_ANIM_MAX] = {
ANIMMODE_LOOP, // ENPR2_ANIM_0
ANIMMODE_LOOP, // ENPR2_ANIM_1
ANIMMODE_ONCE, // ENPR2_ANIM_2
};
s16 D_80A75C3C[] = { s16 D_80A75C3C[] = {
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
@ -115,7 +125,7 @@ void EnPr2_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.damageTable = &sDamageTable;
SkelAnime_InitFlex(play, &this->skelAnime, &object_pr_Skel_004188, &object_pr_Anim_004340, this->jointTable, SkelAnime_InitFlex(play, &this->skelAnime, &object_pr_Skel_004188, &object_pr_Anim_004340, this->jointTable,
this->morphTable, 5); this->morphTable, OBJECT_PR_2_LIMB_MAX);
this->unk_1E0 = ENPR2_GET_F(&this->actor); this->unk_1E0 = ENPR2_GET_F(&this->actor);
this->actor.colChkInfo.mass = 10; this->actor.colChkInfo.mass = 10;
Math_Vec3f_Copy(&this->unk_228, &this->actor.home.pos); Math_Vec3f_Copy(&this->unk_228, &this->actor.home.pos);
@ -198,13 +208,14 @@ void EnPr2_Destroy(Actor* thisx, PlayState* play) {
s32 func_80A7429C(EnPr2* this, PlayState* play) { s32 func_80A7429C(EnPr2* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
s16 sp1A; s16 screenPosX;
s16 sp18; s16 screenPosY;
Actor_GetScreenPos(play, &this->actor, &sp1A, &sp18); Actor_GetScreenPos(play, &this->actor, &screenPosX, &screenPosY);
if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 160.0f) || if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 160.0f) ||
(this->actor.projectedPos.z < -40.0f) || (sp1A < 0) || (sp1A > 320) || (sp18 < 0) || (sp18 > 240)) { (this->actor.projectedPos.z < -40.0f) || (screenPosX < 0) || (screenPosX > SCREEN_WIDTH) || (screenPosY < 0) ||
(screenPosY > SCREEN_HEIGHT)) {
return false; return false;
} }
@ -242,19 +253,20 @@ void func_80A7436C(EnPr2* this, s16 arg1) {
Math_SmoothStepToS(&this->actor.world.rot.y, arg1, 1, 2000, 300); Math_SmoothStepToS(&this->actor.world.rot.y, arg1, 1, 2000, 300);
} }
void func_80A74510(EnPr2* this, s32 arg0) { void EnPr2_ChangeAnim(EnPr2* this, s32 animIndex) {
f32 sp34 = 1.0f; f32 playSpeed = 1.0f;
this->unk_210 = arg0; this->animIndex = animIndex;
this->unk_1F8 = Animation_GetLastFrame(sAnimations[arg0]); this->animEndFrame = Animation_GetLastFrame(sAnimations[animIndex]);
if (this->unk_210 == 3) { if (this->animIndex == ENPR2_ANIM_MAX) {
sp34 = 0.0f; playSpeed = 0.0f;
} }
Animation_Change(&this->skelAnime, sAnimations[arg0], sp34, 0.0f, this->unk_1F8, D_80A75C38[arg0], 0.0f); Animation_Change(&this->skelAnime, sAnimations[animIndex], playSpeed, 0.0f, this->animEndFrame,
sAnimationModes[animIndex], 0.0f);
} }
void func_80A745C4(EnPr2* this) { void func_80A745C4(EnPr2* this) {
func_80A74510(this, 0); EnPr2_ChangeAnim(this, ENPR2_ANIM_0);
this->unk_1D4 = 0; this->unk_1D4 = 0;
this->actionFunc = func_80A745FC; this->actionFunc = func_80A745FC;
} }
@ -310,7 +322,7 @@ void func_80A745FC(EnPr2* this, PlayState* play) {
} }
void func_80A74888(EnPr2* this) { void func_80A74888(EnPr2* this) {
func_80A74510(this, 0); EnPr2_ChangeAnim(this, ENPR2_ANIM_0);
this->unk_1DA = 2; this->unk_1DA = 2;
this->unk_1D8 = 0; this->unk_1D8 = 0;
Math_Vec3f_Copy(&this->unk_21C, &this->unk_228); Math_Vec3f_Copy(&this->unk_21C, &this->unk_228);
@ -376,6 +388,9 @@ void func_80A748E8(EnPr2* this, PlayState* play) {
} }
} }
break; break;
default:
break;
} }
if (!sp4C) { if (!sp4C) {
@ -432,7 +447,7 @@ void func_80A74DEC(EnPr2* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
this->unk_1F0 = 0; this->unk_1F0 = 0;
func_80A74510(this, 1); EnPr2_ChangeAnim(this, ENPR2_ANIM_1);
Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_ATTACK); Actor_PlaySfx(&this->actor, NA_SE_EN_PIRANHA_ATTACK);
Math_Vec3f_Copy(&this->unk_21C, &player->actor.world.pos); Math_Vec3f_Copy(&this->unk_21C, &player->actor.world.pos);
@ -446,7 +461,7 @@ void func_80A74DEC(EnPr2* this, PlayState* play) {
void func_80A74E90(EnPr2* this, PlayState* play) { void func_80A74E90(EnPr2* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
WaterBox* sp40; WaterBox* waterBox;
Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f); Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f);
if ((this->unk_1D8 == 0) || !(player->stateFlags1 & PLAYER_STATE1_8000000) || (this->unk_1E0 == 0)) { if ((this->unk_1D8 == 0) || !(player->stateFlags1 & PLAYER_STATE1_8000000) || (this->unk_1E0 == 0)) {
@ -491,8 +506,8 @@ void func_80A74E90(EnPr2* this, PlayState* play) {
} }
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_200, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_200,
&sp40)) { &waterBox)) {
if ((this->unk_200 - 40.0f) < this->unk_21C.y) { if (this->unk_21C.y > (this->unk_200 - 40.0f)) {
this->unk_21C.y = this->unk_200 - 40.0f; this->unk_21C.y = this->unk_200 - 40.0f;
} }
} }
@ -520,11 +535,11 @@ void func_80A751B4(EnPr2* this) {
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON; this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
if (this->unk_1E0 < 10) { if (this->unk_1E0 < 10) {
func_80A74510(this, 2); EnPr2_ChangeAnim(this, ENPR2_ANIM_2);
} else { } else {
this->unk_1F8 = Animation_GetLastFrame(&object_pr_Anim_003904); this->animEndFrame = Animation_GetLastFrame(&object_pr_Anim_003904);
Animation_Change(&this->skelAnime, &object_pr_Anim_003904, 1.0f, this->unk_1F8, this->unk_1F8, ANIMMODE_ONCE, Animation_Change(&this->skelAnime, &object_pr_Anim_003904, 1.0f, this->animEndFrame, this->animEndFrame,
0.0f); ANIMMODE_ONCE, 0.0f);
this->unk_1D8 = Rand_S16Offset(20, 30); this->unk_1D8 = Rand_S16Offset(20, 30);
this->unk_1E4 = 0x4000; this->unk_1E4 = 0x4000;
if (Rand_ZeroOne() < 0.5f) { if (Rand_ZeroOne() < 0.5f) {
@ -545,16 +560,16 @@ void func_80A751B4(EnPr2* this) {
void func_80A75310(EnPr2* this, PlayState* play) { void func_80A75310(EnPr2* this, PlayState* play) {
s32 temp; s32 temp;
f32 frame; f32 curFrame;
WaterBox* sp74; WaterBox* waterBox;
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (this->unk_1E0 < 10) { if (this->unk_1E0 < 10) {
s32 i; s32 i;
frame = this->skelAnime.curFrame; curFrame = this->skelAnime.curFrame;
if (this->unk_1F8 <= frame) { if (curFrame >= this->animEndFrame) {
for (i = 0; i < ARRAY_COUNT(this->unk_234); i++) { for (i = 0; i < ARRAY_COUNT(this->unk_234); i++) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_PR2, this->unk_234[i].x, this->unk_234[i].y, Actor_Spawn(&play->actorCtx, play, ACTOR_EN_PR2, this->unk_234[i].x, this->unk_234[i].y,
this->unk_234[i].z, this->actor.world.rot.x, this->actor.world.rot.y, this->unk_234[i].z, this->actor.world.rot.x, this->actor.world.rot.y,
@ -577,13 +592,11 @@ void func_80A75310(EnPr2* this, PlayState* play) {
} }
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_200, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_200,
&sp74)) { &waterBox)) {
frame = this->unk_200 - 15.0f; if (this->actor.world.pos.y >= (this->unk_200 - 15.0f)) {
if (frame <= this->actor.world.pos.y) {
temp = true; temp = true;
} else { } else {
Math_ApproachF(&this->actor.world.pos.y, frame, 0.3f, 1.0f); Math_ApproachF(&this->actor.world.pos.y, this->unk_200 - 15.0f, 0.3f, 1.0f);
} }
} }
@ -599,9 +612,8 @@ void func_80A75310(EnPr2* this, PlayState* play) {
sp64.x += Rand_CenteredFloat(20.0f); sp64.x += Rand_CenteredFloat(20.0f);
sp64.y += Rand_CenteredFloat(5.0f); sp64.y += Rand_CenteredFloat(5.0f);
sp64.z += Rand_CenteredFloat(20.0f); sp64.z += Rand_CenteredFloat(20.0f);
frame = Rand_ZeroFloat(0.03f) + 0.07f;
EffectSsBubble_Spawn(play, &sp64, 0.0f, 5.0f, 5.0f, frame); EffectSsBubble_Spawn(play, &sp64, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f);
} }
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
@ -638,6 +650,7 @@ void EnPr2_Update(Actor* thisx, PlayState* play) {
EnPr2* this = THIS; EnPr2* this = THIS;
f32 rand; f32 rand;
//! FAKE:
if (thisx) {} if (thisx) {}
Actor_SetScale(&this->actor, this->unk_204); Actor_SetScale(&this->actor, this->unk_204);
@ -702,7 +715,7 @@ s32 func_80A758E8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
EnPr2* this = THIS; EnPr2* this = THIS;
if (this->unk_1E0 < 10) { if (this->unk_1E0 < 10) {
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_2_LIMB_02) {
rot->y += (s16)this->unk_1FC * -1; rot->y += (s16)this->unk_1FC * -1;
} }
} else if ((limbIndex + 10) != this->unk_1E0) { } else if ((limbIndex + 10) != this->unk_1E0) {
@ -715,7 +728,7 @@ void func_80A75950(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
EnPr2* this = THIS; EnPr2* this = THIS;
if (this->unk_1E0 < 10) { if (this->unk_1E0 < 10) {
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_2_LIMB_02) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_MultZero(&this->unk_270); Matrix_MultZero(&this->unk_270);
} }
@ -727,7 +740,7 @@ s32 func_80A759D8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
EnPr2* this = THIS; EnPr2* this = THIS;
if (this->unk_1E0 < 10) { if (this->unk_1E0 < 10) {
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_2_LIMB_02) {
rot->y += (s16)this->unk_1FC * -1; rot->y += (s16)this->unk_1FC * -1;
} }
} else if ((limbIndex + 10) != this->unk_1E0) { } else if ((limbIndex + 10) != this->unk_1E0) {

View File

@ -2,6 +2,7 @@
#define Z_EN_PR2_H #define Z_EN_PR2_H
#include "global.h" #include "global.h"
#include "objects/object_pr/object_pr.h"
struct EnPr2; struct EnPr2;
@ -16,8 +17,8 @@ typedef void (*EnPr2ActionFunc)(struct EnPr2*, PlayState*);
typedef struct EnPr2 { typedef struct EnPr2 {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime; /* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[5]; /* 0x188 */ Vec3s jointTable[OBJECT_PR_2_LIMB_MAX];
/* 0x1A6 */ Vec3s morphTable[5]; /* 0x1A6 */ Vec3s morphTable[OBJECT_PR_2_LIMB_MAX];
/* 0x1C4 */ EnPr2ActionFunc actionFunc; /* 0x1C4 */ EnPr2ActionFunc actionFunc;
/* 0x1C8 */ s16 pathIndex; /* 0x1C8 */ s16 pathIndex;
/* 0x1CC */ Path* path; /* 0x1CC */ Path* path;
@ -38,13 +39,13 @@ typedef struct EnPr2 {
/* 0x1F0 */ s16 unk_1F0; /* 0x1F0 */ s16 unk_1F0;
/* 0x1F2 */ s16 unk_1F2; /* 0x1F2 */ s16 unk_1F2;
/* 0x1F4 */ s16 unk_1F4; /* 0x1F4 */ s16 unk_1F4;
/* 0x1F8 */ f32 unk_1F8; /* 0x1F8 */ f32 animEndFrame;
/* 0x1FC */ f32 unk_1FC; /* 0x1FC */ f32 unk_1FC;
/* 0x200 */ f32 unk_200; /* 0x200 */ f32 unk_200;
/* 0x204 */ f32 unk_204; /* 0x204 */ f32 unk_204;
/* 0x208 */ f32 unk_208; /* 0x208 */ f32 unk_208;
/* 0x20C */ f32 unk_20C; /* 0x20C */ f32 unk_20C;
/* 0x210 */ s32 unk_210; /* 0x210 */ s32 animIndex;
/* 0x214 */ UNK_TYPE1 unk214[4]; /* 0x214 */ UNK_TYPE1 unk214[4];
/* 0x218 */ s32 unk_218; /* 0x218 */ s32 unk_218;
/* 0x21C */ Vec3f unk_21C; /* 0x21C */ Vec3f unk_21C;

View File

@ -5,7 +5,6 @@
*/ */
#include "z_en_prz.h" #include "z_en_prz.h"
#include "objects/object_pr/object_pr.h"
#include "overlays/actors/ovl_En_Pr/z_en_pr.h" #include "overlays/actors/ovl_En_Pr/z_en_pr.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10) #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY | ACTOR_FLAG_10)
@ -100,12 +99,6 @@ ActorInit En_Prz_InitVars = {
/**/ EnPrz_Draw, /**/ EnPrz_Draw,
}; };
AnimationHeader* D_80A77240[] = { &object_pr_Anim_004340, &object_pr_Anim_004274 };
u8 D_80A77248[] = { ANIMMODE_LOOP, ANIMMODE_LOOP };
Vec3f D_80A7724C = { 0.0f, 0.0f, 0.0f };
void EnPrz_Init(Actor* thisx, PlayState* play) { void EnPrz_Init(Actor* thisx, PlayState* play) {
EnPrz* this = THIS; EnPrz* this = THIS;
@ -121,7 +114,7 @@ void EnPrz_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.health = 1; this->actor.colChkInfo.health = 1;
SkelAnime_InitFlex(play, &this->skelAnime, &object_pr_Skel_004188, &object_pr_Anim_004340, this->jointTable, SkelAnime_InitFlex(play, &this->skelAnime, &object_pr_Skel_004188, &object_pr_Anim_004340, this->jointTable,
this->morphTable, 5); this->morphTable, OBJECT_PR_2_LIMB_MAX);
this->unk_1E6 = ENPRZ_GET(&this->actor); this->unk_1E6 = ENPRZ_GET(&this->actor);
this->actor.shape.yOffset = 500.0f; this->actor.shape.yOffset = 500.0f;
@ -141,18 +134,34 @@ void EnPrz_Init(Actor* thisx, PlayState* play) {
void EnPrz_Destroy(Actor* thisx, PlayState* play) { void EnPrz_Destroy(Actor* thisx, PlayState* play) {
} }
void func_80A75F18(EnPrz* this, s32 arg1) { typedef enum EnPrzAnimation {
this->unk_204 = arg1; /* 0 */ ENPRZ_ANIM_0,
Animation_Change(&this->skelAnime, D_80A77240[arg1], 1.0f, 0.0f, Animation_GetLastFrame(D_80A77240[arg1]), /* 1 */ ENPRZ_ANIM_1,
D_80A77248[arg1], -2.0f); /* 2 */ ENPRZ_ANIM_MAX
} EnPrzAnimation;
static AnimationHeader* sAnimations[ENPRZ_ANIM_MAX] = {
&object_pr_Anim_004340, // ENPRZ_ANIM_0
&object_pr_Anim_004274, // ENPRZ_ANIM_1
};
static u8 sAnimationModes[ENPRZ_ANIM_MAX] = {
ANIMMODE_LOOP, // ENPRZ_ANIM_0
ANIMMODE_LOOP, // ENPRZ_ANIM_1
};
void EnPrz_ChangeAnim(EnPrz* this, s32 animIndex) {
this->animIndex = animIndex;
Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f,
Animation_GetLastFrame(sAnimations[animIndex]), sAnimationModes[animIndex], -2.0f);
} }
s32 func_80A75FA4(EnPrz* this, PlayState* play) { s32 func_80A75FA4(EnPrz* this, PlayState* play) {
WaterBox* sp2C; WaterBox* waterBox;
f32 temp_f0; f32 temp_f0;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_210, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_210,
&sp2C)) { &waterBox)) {
temp_f0 = BREG(10) + (this->unk_210 - 10.0f); temp_f0 = BREG(10) + (this->unk_210 - 10.0f);
if (temp_f0 < this->actor.world.pos.y) { if (temp_f0 < this->actor.world.pos.y) {
this->unk_1D8.y = temp_f0; this->unk_1D8.y = temp_f0;
@ -225,7 +234,7 @@ s32 func_80A762C0(EnPrz* this, PlayState* play) {
void func_80A76388(EnPrz* this) { void func_80A76388(EnPrz* this) {
this->actor.speed = Rand_CenteredFloat(1.0f) + 4.0f; this->actor.speed = Rand_CenteredFloat(1.0f) + 4.0f;
func_80A75F18(this, 0); EnPrz_ChangeAnim(this, ENPRZ_ANIM_0);
this->unk_1EA = 1; this->unk_1EA = 1;
this->actionFunc = func_80A763E8; this->actionFunc = func_80A763E8;
} }
@ -271,6 +280,7 @@ void func_80A763E8(EnPrz* this, PlayState* play) {
Math_Vec3f_Copy(&this->unk_1D8, &sp3C->world.pos); Math_Vec3f_Copy(&this->unk_1D8, &sp3C->world.pos);
} }
//! FAKE:
if (1) {} if (1) {}
if ((Rand_ZeroOne() < 0.1f) && (this->unk_1C8 == 0)) { if ((Rand_ZeroOne() < 0.1f) && (this->unk_1C8 == 0)) {
@ -322,7 +332,7 @@ void func_80A767A8(EnPrz* this, PlayState* play) {
s32 pad[2]; s32 pad[2];
if (func_80A762C0(this, play)) { if (func_80A762C0(this, play)) {
func_80A75F18(this, 0); EnPrz_ChangeAnim(this, ENPRZ_ANIM_0);
this->actor.speed = Rand_CenteredFloat(1.0f) + 4.0f; this->actor.speed = Rand_CenteredFloat(1.0f) + 4.0f;
func_80A76604(this, play); func_80A76604(this, play);
return; return;
@ -339,13 +349,13 @@ void func_80A767A8(EnPrz* this, PlayState* play) {
} }
if ((this->actor.xzDistToPlayer < 200.0f) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { if ((this->actor.xzDistToPlayer < 200.0f) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) {
if (this->unk_204 != 1) { if (this->animIndex != ENPRZ_ANIM_1) {
func_80A75F18(this, 1); EnPrz_ChangeAnim(this, ENPRZ_ANIM_1);
} }
this->skelAnime.playSpeed = 1.0f; this->skelAnime.playSpeed = 1.0f;
} else { } else {
if (this->unk_204 != 0) { if (this->animIndex != ENPRZ_ANIM_0) {
func_80A75F18(this, 0); EnPrz_ChangeAnim(this, ENPRZ_ANIM_0);
} }
this->skelAnime.playSpeed = 2.0f; this->skelAnime.playSpeed = 2.0f;
} }
@ -384,13 +394,13 @@ void func_80A76A1C(EnPrz* this) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 30); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 30);
this->unk_1EE = 50; this->unk_1EE = 50;
func_80A75F18(this, 0); EnPrz_ChangeAnim(this, ENPRZ_ANIM_0);
this->unk_1EA = 7; this->unk_1EA = 7;
this->actionFunc = func_80A76B14; this->actionFunc = func_80A76B14;
} }
void func_80A76B14(EnPrz* this, PlayState* play) { void func_80A76B14(EnPrz* this, PlayState* play) {
WaterBox* sp7C; WaterBox* waterBox;
s32 i; s32 i;
Vec3f sp6C; Vec3f sp6C;
s32 phi_s0 = false; s32 phi_s0 = false;
@ -400,7 +410,7 @@ void func_80A76B14(EnPrz* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_1FE, 5, 0x2710, 0x3E8); Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_1FE, 5, 0x2710, 0x3E8);
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_210, if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &this->unk_210,
&sp7C)) { &waterBox)) {
if ((this->unk_210 - 15.0f) <= this->actor.world.pos.y) { if ((this->unk_210 - 15.0f) <= this->actor.world.pos.y) {
phi_s0 = true; phi_s0 = true;
} else { } else {
@ -491,19 +501,19 @@ void EnPrz_Update(Actor* thisx, PlayState* play) {
s32 func_80A76F70(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { s32 func_80A76F70(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnPrz* this = THIS; EnPrz* this = THIS;
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_2_LIMB_02) {
rot->y += (s16)this->unk_218 * -100; rot->y += (s16)this->unk_218 * -100;
} }
return false; return false;
} }
void func_80A76FCC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { void func_80A76FCC(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
Vec3f sp1C = D_80A7724C; Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
EnPrz* this = THIS; EnPrz* this = THIS;
if (limbIndex == 2) { if (limbIndex == OBJECT_PR_2_LIMB_02) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_MultVec3f(&sp1C, &this->unk_1CC); Matrix_MultVec3f(&sZeroVec, &this->unk_1CC);
} }
} }

View File

@ -2,6 +2,7 @@
#define Z_EN_PRZ_H #define Z_EN_PRZ_H
#include "global.h" #include "global.h"
#include "objects/object_pr/object_pr.h"
struct EnPrz; struct EnPrz;
@ -12,8 +13,8 @@ typedef void (*EnPrzActionFunc)(struct EnPrz*, PlayState*);
typedef struct EnPrz { typedef struct EnPrz {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime; /* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[5]; /* 0x188 */ Vec3s jointTable[OBJECT_PR_2_LIMB_MAX];
/* 0x1A6 */ Vec3s morphTable[5]; /* 0x1A6 */ Vec3s morphTable[OBJECT_PR_2_LIMB_MAX];
/* 0x1C4 */ EnPrzActionFunc actionFunc; /* 0x1C4 */ EnPrzActionFunc actionFunc;
/* 0x1C8 */ u8 unk_1C8; /* 0x1C8 */ u8 unk_1C8;
/* 0x1CC */ Vec3f unk_1CC; /* 0x1CC */ Vec3f unk_1CC;
@ -31,7 +32,7 @@ typedef struct EnPrz {
/* 0x1FE */ s16 unk_1FE; /* 0x1FE */ s16 unk_1FE;
/* 0x200 */ UNK_TYPE1 unk200[2]; /* 0x200 */ UNK_TYPE1 unk200[2];
/* 0x202 */ s16 unk_202; /* 0x202 */ s16 unk_202;
/* 0x204 */ s32 unk_204; /* 0x204 */ s32 animIndex;
/* 0x208 */ f32 unk_208; /* 0x208 */ f32 unk_208;
/* 0x20C */ f32 unk_20C; /* 0x20C */ f32 unk_20C;
/* 0x210 */ f32 unk_210; /* 0x210 */ f32 unk_210;

View File

@ -15,7 +15,6 @@ void EnPst_Destroy(Actor* thisx, PlayState* play);
void EnPst_Update(Actor* thisx, PlayState* play); void EnPst_Update(Actor* thisx, PlayState* play);
void EnPst_Draw(Actor* thisx, PlayState* play); void EnPst_Draw(Actor* thisx, PlayState* play);
void EnPst_FollowSchedule(EnPst* this, PlayState* play);
void EnPst_Talk(EnPst* this, PlayState* play); void EnPst_Talk(EnPst* this, PlayState* play);
typedef enum { typedef enum {
@ -152,7 +151,14 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE };
static AnimationInfoS sAnimationInfo[] = { { &gPostboxOpenSlotAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 } }; typedef enum PostboxAnimation {
/* 0 */ POSTBOX_ANIM_IDLE,
/* 1 */ POSTBOX_ANIM_MAX
} PostboxAnimation;
static AnimationInfoS sAnimationInfo[POSTBOX_ANIM_MAX] = {
{ &gPostboxIdleAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // POSTBOX_ANIM_IDLE
};
void EnPst_UpdateCollision(EnPst* this, PlayState* play) { void EnPst_UpdateCollision(EnPst* this, PlayState* play) {
Collider_UpdateCylinder(&this->actor, &this->collider); Collider_UpdateCylinder(&this->actor, &this->collider);
@ -163,14 +169,19 @@ s32 EnPst_HandleLetterDay1(EnPst* this) {
switch (this->actor.params) { switch (this->actor.params) {
case POSTBOX_SOUTH_UPPER_CLOCKTOWN: case POSTBOX_SOUTH_UPPER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN); return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_UPPER_CLOCKTOWN);
case POSTBOX_NORTH_CLOCKTOWN: case POSTBOX_NORTH_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN); return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_NORTH_CLOCKTOWN);
case POSTBOX_EAST_UPPER_CLOCKTOWN: case POSTBOX_EAST_UPPER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN); return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_UPPER_CLOCKTOWN);
case POSTBOX_EAST_LOWER_CLOCKTOWN: case POSTBOX_EAST_LOWER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN); return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_EAST_LOWER_CLOCKTOWN);
case POSTBOX_SOUTH_LOWER_CLOCKTOWN: case POSTBOX_SOUTH_LOWER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN); return CHECK_WEEKEVENTREG(WEEKEVENTREG_DEPOSITED_LETTER_TO_KAFEI_SOUTH_LOWER_CLOCKTOWN);
default: default:
return false; return false;
} }
@ -180,14 +191,19 @@ s32 EnPst_HandleLetterDay2(EnPst* this) {
switch (this->actor.params) { switch (this->actor.params) {
case POSTBOX_SOUTH_UPPER_CLOCKTOWN: case POSTBOX_SOUTH_UPPER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_40); return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_40);
case POSTBOX_NORTH_CLOCKTOWN: case POSTBOX_NORTH_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_80); return CHECK_WEEKEVENTREG(WEEKEVENTREG_27_80);
case POSTBOX_EAST_UPPER_CLOCKTOWN: case POSTBOX_EAST_UPPER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_28_01); return CHECK_WEEKEVENTREG(WEEKEVENTREG_28_01);
case POSTBOX_EAST_LOWER_CLOCKTOWN: case POSTBOX_EAST_LOWER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_28_02); return CHECK_WEEKEVENTREG(WEEKEVENTREG_28_02);
case POSTBOX_SOUTH_LOWER_CLOCKTOWN: case POSTBOX_SOUTH_LOWER_CLOCKTOWN:
return CHECK_WEEKEVENTREG(WEEKEVENTREG_28_04); return CHECK_WEEKEVENTREG(WEEKEVENTREG_28_04);
default: default:
return false; return false;
} }
@ -220,13 +236,20 @@ s32 EnPst_ChooseBehaviour(Actor* thisx, PlayState* play) {
} }
} }
break; break;
default:
break;
} }
break; break;
case POSTBOX_BEHAVIOUR_TAKE_ITEM: case POSTBOX_BEHAVIOUR_TAKE_ITEM:
if (this->exchangeItemAction == PLAYER_IA_LETTER_TO_KAFEI) { if (this->exchangeItemAction == PLAYER_IA_LETTER_TO_KAFEI) {
scriptBranch = 1; scriptBranch = 1;
} }
break; break;
default:
break;
} }
return scriptBranch; return scriptBranch;
} }
@ -240,39 +263,52 @@ s32* EnPst_GetMsgEventScript(EnPst* this, PlayState* play) {
switch (this->actor.params) { switch (this->actor.params) {
case POSTBOX_SOUTH_UPPER_CLOCKTOWN: case POSTBOX_SOUTH_UPPER_CLOCKTOWN:
return D_80B2C3E8; return D_80B2C3E8;
case POSTBOX_NORTH_CLOCKTOWN: case POSTBOX_NORTH_CLOCKTOWN:
return D_80B2C408; return D_80B2C408;
case POSTBOX_EAST_UPPER_CLOCKTOWN: case POSTBOX_EAST_UPPER_CLOCKTOWN:
return D_80B2C428; return D_80B2C428;
case POSTBOX_EAST_LOWER_CLOCKTOWN: case POSTBOX_EAST_LOWER_CLOCKTOWN:
return D_80B2C448; return D_80B2C448;
case POSTBOX_SOUTH_LOWER_CLOCKTOWN: case POSTBOX_SOUTH_LOWER_CLOCKTOWN:
return D_80B2C468; return D_80B2C468;
default: default:
return NULL; return NULL;
} }
} else if (this->stateFlags & 0x20) { }
if (this->stateFlags & 0x20) {
if (this->exchangeItemAction == PLAYER_IA_LETTER_MAMA) { if (this->exchangeItemAction == PLAYER_IA_LETTER_MAMA) {
return D_80B2C488; return D_80B2C488;
} else { } else {
return D_80B2C490; return D_80B2C490;
} }
} else { }
this->msgEventCallback = EnPst_ChooseBehaviour;
switch (this->actor.params) { this->msgEventCallback = EnPst_ChooseBehaviour;
case POSTBOX_SOUTH_UPPER_CLOCKTOWN:
return D_80B2C23C; switch (this->actor.params) {
case POSTBOX_NORTH_CLOCKTOWN: case POSTBOX_SOUTH_UPPER_CLOCKTOWN:
return D_80B2C288; return D_80B2C23C;
case POSTBOX_EAST_UPPER_CLOCKTOWN:
return D_80B2C2D4; case POSTBOX_NORTH_CLOCKTOWN:
case POSTBOX_EAST_LOWER_CLOCKTOWN: return D_80B2C288;
return D_80B2C320;
case POSTBOX_SOUTH_LOWER_CLOCKTOWN: case POSTBOX_EAST_UPPER_CLOCKTOWN:
return D_80B2C36C; return D_80B2C2D4;
default:
return NULL; case POSTBOX_EAST_LOWER_CLOCKTOWN:
} return D_80B2C320;
case POSTBOX_SOUTH_LOWER_CLOCKTOWN:
return D_80B2C36C;
default:
return NULL;
} }
} }
@ -321,6 +357,9 @@ s32 EnPst_ProcessScheduleOutput(EnPst* this, PlayState* play, ScheduleOutput* sc
case POSTBOX_SCH_CHECKED_BY_POSTMAN: case POSTBOX_SCH_CHECKED_BY_POSTMAN:
ret = true; ret = true;
break; break;
default:
break;
} }
return ret; return ret;
} }
@ -389,7 +428,7 @@ void EnPst_Init(Actor* thisx, PlayState* play) {
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK); SubS_SetOfferMode(&this->stateFlags, SUBS_OFFER_MODE_ONSCREEN, SUBS_OFFER_MODE_MASK);
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, POSTBOX_ANIM_IDLE);
this->actor.targetMode = TARGET_MODE_0; this->actor.targetMode = TARGET_MODE_0;
Actor_SetScale(&this->actor, 0.02f); Actor_SetScale(&this->actor, 0.02f);
this->actionFunc = EnPst_FollowSchedule; this->actionFunc = EnPst_FollowSchedule;

View File

@ -447,14 +447,14 @@ void EnSob1_Destroy(Actor* thisx, PlayState* play) {
} }
void EnSob1_UpdateCursorPos(PlayState* play, EnSob1* this) { void EnSob1_UpdateCursorPos(PlayState* play, EnSob1* this) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
f32 xOffset = 0.0f; f32 xOffset = 0.0f;
f32 yOffset = 17.0f; f32 yOffset = 17.0f;
Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &x, &y); Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &screenPosX, &screenPosY);
this->cursorPos.x = x + xOffset; this->cursorPos.x = screenPosX + xOffset;
this->cursorPos.y = y + yOffset; this->cursorPos.y = screenPosY + yOffset;
this->cursorPos.z = 1.2f; this->cursorPos.z = 1.2f;
} }

View File

@ -199,7 +199,7 @@ void func_80BB5318(EnTanron1* this, PlayState* play) {
Vec3f* spB4 = NULL; Vec3f* spB4 = NULL;
f32 spB0; f32 spB0;
Vec3f spA4; Vec3f spA4;
WaterBox* spA0; WaterBox* waterBox;
f32 sp9C; f32 sp9C;
CollisionPoly* sp98; CollisionPoly* sp98;
Actor* temp_v0; Actor* temp_v0;
@ -340,7 +340,7 @@ void func_80BB5318(EnTanron1* this, PlayState* play) {
} }
ptr->unk_3C = BgCheck_EntityRaycastFloor1(&play->colCtx, &sp98, &ptr->unk_00); ptr->unk_3C = BgCheck_EntityRaycastFloor1(&play->colCtx, &sp98, &ptr->unk_00);
sp9C = ptr->unk_00.y; sp9C = ptr->unk_00.y;
WaterBox_GetSurface1(play, &play->colCtx, ptr->unk_00.x, ptr->unk_00.z, &sp9C, &spA0); WaterBox_GetSurface1(play, &play->colCtx, ptr->unk_00.x, ptr->unk_00.z, &sp9C, &waterBox);
if ((sp9C < ptr->unk_00.y) && (ptr->unk_3C < sp9C)) { if ((sp9C < ptr->unk_00.y) && (ptr->unk_3C < sp9C)) {
ptr->unk_3C = sp9C; ptr->unk_3C = sp9C;
} }

View File

@ -35,19 +35,19 @@ void EnTest5_SetupAction(EnTest5* this, EnTest5ActionFunc actionFunc) {
void EnTest5_Init(Actor* thisx, PlayState* play2) { void EnTest5_Init(Actor* thisx, PlayState* play2) {
PlayState* play = play2; PlayState* play = play2;
EnTest5* this = THIS; EnTest5* this = THIS;
WaterBox* water; WaterBox* waterBox;
f32 ySurface; f32 ySurface;
// If not spawned above a water source, immediately despawn // If not spawned above a water source, immediately despawn
if (!WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, if (!WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface,
&water)) { &waterBox)) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
Math_Vec3s_ToVec3f(&this->minPos, &water->minPos); Math_Vec3s_ToVec3f(&this->minPos, &waterBox->minPos);
this->xLength = (f32)water->xLength; this->xLength = (f32)waterBox->xLength;
this->zLength = (f32)water->zLength; this->zLength = (f32)waterBox->zLength;
EnTest5_SetupAction(this, EnTest5_HandleBottleAction); EnTest5_SetupAction(this, EnTest5_HandleBottleAction);
} }

View File

@ -157,14 +157,14 @@ void EnTrt_UpdateCollider(EnTrt* this, PlayState* play) {
} }
void EnTrt_UpdateCursorPos(PlayState* play, EnTrt* this) { void EnTrt_UpdateCursorPos(PlayState* play, EnTrt* this) {
s16 x; s16 screenPosX;
s16 y; s16 screenPosY;
f32 xOffset = 0.0f; f32 xOffset = 0.0f;
f32 yOffset = 17.0f; f32 yOffset = 17.0f;
Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &x, &y); Actor_GetScreenPos(play, &this->items[this->cursorIndex]->actor, &screenPosX, &screenPosY);
this->cursorPos.x = x + xOffset; this->cursorPos.x = screenPosX + xOffset;
this->cursorPos.y = y + yOffset; this->cursorPos.y = screenPosY + yOffset;
this->cursorPos.z = 1.2f; this->cursorPos.z = 1.2f;
} }

View File

@ -834,14 +834,14 @@ void func_80B94E34(EnZog* this, PlayState* play) {
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
} else { } else {
if (this->actor.speed > 0.1f) { if (this->actor.speed > 0.1f) {
WaterBox* sp44; WaterBox* waterBox;
Vec3f sp38; Vec3f sp38;
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, this->actor.shape.rot.y, &D_80B959AC, &sp38); Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, this->actor.shape.rot.y, &D_80B959AC, &sp38);
sp38.x += Rand_CenteredFloat(30.0f); sp38.x += Rand_CenteredFloat(30.0f);
sp38.y += 20.0f; sp38.y += 20.0f;
sp38.z += Rand_CenteredFloat(30.0f); sp38.z += Rand_CenteredFloat(30.0f);
if (WaterBox_GetSurface1(play, &play->colCtx, sp38.x, sp38.z, &sp38.y, &sp44) && if (WaterBox_GetSurface1(play, &play->colCtx, sp38.x, sp38.z, &sp38.y, &waterBox) &&
(this->actor.world.pos.y < sp38.y)) { (this->actor.world.pos.y < sp38.y)) {
EffectSsGSplash_Spawn(play, &sp38, NULL, NULL, 1, EffectSsGSplash_Spawn(play, &sp38, NULL, NULL, 1,
Rand_ZeroFloat(this->actor.speed * 40.0f) + (this->actor.speed * 60.0f)); Rand_ZeroFloat(this->actor.speed * 40.0f) + (this->actor.speed * 60.0f));

View File

@ -591,7 +591,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play) {
} }
void func_80B32C34(EnZoraegg* this, PlayState* play) { void func_80B32C34(EnZoraegg* this, PlayState* play) {
WaterBox* sp34; WaterBox* waterBox;
f32 sp30; f32 sp30;
s32 pad; s32 pad;
@ -600,7 +600,7 @@ void func_80B32C34(EnZoraegg* this, PlayState* play) {
this->actor.focus.pos.y += 10.0f; this->actor.focus.pos.y += 10.0f;
sp30 = this->actor.world.pos.y; sp30 = this->actor.world.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30, &sp34)) { if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30, &waterBox)) {
if ((this->actor.world.pos.y + 50.0f) < sp30) { if ((this->actor.world.pos.y + 50.0f) < sp30) {
this->actionFunc = func_80B32BB8; this->actionFunc = func_80B32BB8;
} }
@ -611,7 +611,7 @@ void func_80B32C34(EnZoraegg* this, PlayState* play) {
} }
void func_80B32D08(EnZoraegg* this, PlayState* play) { void func_80B32D08(EnZoraegg* this, PlayState* play) {
WaterBox* sp44; WaterBox* waterBox;
f32 sp40; f32 sp40;
Vec3f sp34; Vec3f sp34;
s32 pad; s32 pad;
@ -621,7 +621,7 @@ void func_80B32D08(EnZoraegg* this, PlayState* play) {
this->actor.focus.pos.y += 10.0f; this->actor.focus.pos.y += 10.0f;
sp40 = this->actor.world.pos.y; sp40 = this->actor.world.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp40, &sp44)) { if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp40, &waterBox)) {
if (this->actor.world.pos.y < sp40) { if (this->actor.world.pos.y < sp40) {
sp34.x = this->actor.world.pos.x; sp34.x = this->actor.world.pos.x;
sp34.y = sp40; sp34.y = sp40;

View File

@ -148,11 +148,11 @@ s32 func_80939470(Actor* thisx) {
s32 func_8093951C(ObjBombiwa* this, PlayState* play) { s32 func_8093951C(ObjBombiwa* this, PlayState* play) {
s32 pad; s32 pad;
WaterBox* sp30; WaterBox* waterBox;
f32 sp2C; f32 sp2C;
s32 sp28; s32 sp28;
if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, &sp30, if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, &waterBox,
&sp28) && &sp28) &&
(this->actor.world.pos.y < sp2C)) { (this->actor.world.pos.y < sp2C)) {
return true; return true;

View File

@ -148,11 +148,11 @@ void func_809A13A0(ObjHamishi* this, PlayState* play) {
s32 func_809A1408(ObjHamishi* this, PlayState* play) { s32 func_809A1408(ObjHamishi* this, PlayState* play) {
s32 pad; s32 pad;
WaterBox* sp30; WaterBox* waterBox;
f32 sp2C; f32 sp2C;
s32 sp28; s32 sp28;
if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, &sp30, if (WaterBox_GetSurfaceImpl(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C, &waterBox,
&sp28) && &sp28) &&
(this->actor.world.pos.y < sp2C)) { (this->actor.world.pos.y < sp2C)) {
return true; return true;

View File

@ -309,7 +309,7 @@ s32 func_80A23D08(ObjIceblock* this, PlayState* play) {
}; };
s32 pad3; s32 pad3;
ObjIceBlockUnkStruct2* ptr; ObjIceBlockUnkStruct2* ptr;
WaterBox* spC4; WaterBox* waterBox;
s32 i; s32 i;
s32 spBC; s32 spBC;
s32 spB8; s32 spB8;
@ -349,7 +349,7 @@ s32 func_80A23D08(ObjIceblock* this, PlayState* play) {
} }
} }
if (WaterBox_GetSurface1_2(play, &play->colCtx, spA4.x, spA4.z, &ptr->unk_0C, &spC4)) { if (WaterBox_GetSurface1_2(play, &play->colCtx, spA4.x, spA4.z, &ptr->unk_0C, &waterBox)) {
if (phi_f20 < ptr->unk_0C) { if (phi_f20 < ptr->unk_0C) {
spB8 = i; spB8 = i;
phi_f20 = ptr->unk_0C; phi_f20 = ptr->unk_0C;

View File

@ -7168,7 +7168,7 @@ void func_8083827C(Player* this, PlayState* play) {
s32 temp_t0; // sp64 s32 temp_t0; // sp64
CollisionPoly* sp60; CollisionPoly* sp60;
s32 sp5C; s32 sp5C;
WaterBox* sp58; WaterBox* waterBox;
Vec3f sp4C; Vec3f sp4C;
f32 sp48; f32 sp48;
f32 sp44; f32 sp44;
@ -7230,7 +7230,7 @@ void func_8083827C(Player* this, PlayState* play) {
sp48 = func_80835CD8(play, this, &D_8085D154, &sp4C, &sp60, &sp5C); sp48 = func_80835CD8(play, this, &D_8085D154, &sp4C, &sp60, &sp5C);
sp44 = this->actor.world.pos.y; sp44 = this->actor.world.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, sp4C.x, sp4C.z, &sp44, &sp58) && if (WaterBox_GetSurface1(play, &play->colCtx, sp4C.x, sp4C.z, &sp44, &waterBox) &&
((sp44 - sp48) > 50.0f)) { ((sp44 - sp48) > 50.0f)) {
func_80834DB8(this, &gPlayerAnim_link_normal_run_jump_water_fall, 6.0f, play); func_80834DB8(this, &gPlayerAnim_link_normal_run_jump_water_fall, 6.0f, play);
Player_SetAction(play, this, Player_Action_27, 0); Player_SetAction(play, this, Player_Action_27, 0);

View File

@ -10167,7 +10167,7 @@
0x80A3148C:("EnSlime_Draw",), 0x80A3148C:("EnSlime_Draw",),
0x80A32210:("EnPr_Init",), 0x80A32210:("EnPr_Init",),
0x80A32400:("EnPr_Destroy",), 0x80A32400:("EnPr_Destroy",),
0x80A3242C:("func_80A3242C",), 0x80A3242C:("EnPr_ChangeAnim",),
0x80A324E0:("func_80A324E0",), 0x80A324E0:("func_80A324E0",),
0x80A325E4:("func_80A325E4",), 0x80A325E4:("func_80A325E4",),
0x80A326F0:("func_80A326F0",), 0x80A326F0:("func_80A326F0",),
@ -11019,7 +11019,7 @@
0x80A7422C:("EnPr2_Destroy",), 0x80A7422C:("EnPr2_Destroy",),
0x80A7429C:("func_80A7429C",), 0x80A7429C:("func_80A7429C",),
0x80A7436C:("func_80A7436C",), 0x80A7436C:("func_80A7436C",),
0x80A74510:("func_80A74510",), 0x80A74510:("EnPr2_ChangeAnim",),
0x80A745C4:("func_80A745C4",), 0x80A745C4:("func_80A745C4",),
0x80A745FC:("func_80A745FC",), 0x80A745FC:("func_80A745FC",),
0x80A74888:("func_80A74888",), 0x80A74888:("func_80A74888",),
@ -11036,7 +11036,7 @@
0x80A75A40:("EnPr2_Draw",), 0x80A75A40:("EnPr2_Draw",),
0x80A75DC0:("EnPrz_Init",), 0x80A75DC0:("EnPrz_Init",),
0x80A75F08:("EnPrz_Destroy",), 0x80A75F08:("EnPrz_Destroy",),
0x80A75F18:("func_80A75F18",), 0x80A75F18:("EnPrz_ChangeAnim",),
0x80A75FA4:("func_80A75FA4",), 0x80A75FA4:("func_80A75FA4",),
0x80A76070:("func_80A76070",), 0x80A76070:("func_80A76070",),
0x80A762C0:("func_80A762C0",), 0x80A762C0:("func_80A762C0",),

View File

@ -11086,7 +11086,7 @@
0x80A338D4:("En_Pr_InitVars","UNK_TYPE1","",0x1), 0x80A338D4:("En_Pr_InitVars","UNK_TYPE1","",0x1),
0x80A338F4:("D_80A338F4","UNK_TYPE1","",0x1), 0x80A338F4:("D_80A338F4","UNK_TYPE1","",0x1),
0x80A33920:("D_80A33920","UNK_TYPE1","",0x1), 0x80A33920:("D_80A33920","UNK_TYPE1","",0x1),
0x80A33934:("D_80A33934","UNK_TYPE1","",0x1), 0x80A33934:("sAnimationModes","UNK_TYPE1","",0x1),
0x80A3393C:("D_80A3393C","UNK_TYPE4","",0x4), 0x80A3393C:("D_80A3393C","UNK_TYPE4","",0x4),
0x80A33950:("D_80A33950","f32","",0x4), 0x80A33950:("D_80A33950","f32","",0x4),
0x80A33954:("D_80A33954","f32","",0x4), 0x80A33954:("D_80A33954","f32","",0x4),
@ -11945,7 +11945,7 @@
0x80A75BE0:("D_80A75BE0","UNK_TYPE1","",0x1), 0x80A75BE0:("D_80A75BE0","UNK_TYPE1","",0x1),
0x80A75C0C:("En_Pr2_InitVars","UNK_TYPE1","",0x1), 0x80A75C0C:("En_Pr2_InitVars","UNK_TYPE1","",0x1),
0x80A75C2C:("D_80A75C2C","UNK_TYPE1","",0x1), 0x80A75C2C:("D_80A75C2C","UNK_TYPE1","",0x1),
0x80A75C38:("D_80A75C38","UNK_TYPE1","",0x1), 0x80A75C38:("sAnimationModes","UNK_TYPE1","",0x1),
0x80A75C3C:("D_80A75C3C","UNK_TYPE1","",0x1), 0x80A75C3C:("D_80A75C3C","UNK_TYPE1","",0x1),
0x80A75C60:("D_80A75C60","f32","",0x4), 0x80A75C60:("D_80A75C60","f32","",0x4),
0x80A75C64:("D_80A75C64","f32","",0x4), 0x80A75C64:("D_80A75C64","f32","",0x4),
@ -11961,8 +11961,8 @@
0x80A771E0:("D_80A771E0","f32","",0x4), 0x80A771E0:("D_80A771E0","f32","",0x4),
0x80A771F4:("D_80A771F4","UNK_TYPE1","",0x1), 0x80A771F4:("D_80A771F4","UNK_TYPE1","",0x1),
0x80A77220:("En_Prz_InitVars","UNK_TYPE1","",0x1), 0x80A77220:("En_Prz_InitVars","UNK_TYPE1","",0x1),
0x80A77240:("D_80A77240","UNK_TYPE1","",0x1), 0x80A77240:("sAnimations","UNK_TYPE1","",0x1),
0x80A77248:("D_80A77248","UNK_TYPE1","",0x1), 0x80A77248:("sAnimationModes","UNK_TYPE1","",0x1),
0x80A7724C:("D_80A7724C","UNK_TYPE4","",0x4), 0x80A7724C:("D_80A7724C","UNK_TYPE4","",0x4),
0x80A77260:("D_80A77260","f32","",0x4), 0x80A77260:("D_80A77260","f32","",0x4),
0x80A77264:("D_80A77264","f32","",0x4), 0x80A77264:("D_80A77264","f32","",0x4),