Actor Struct Changes (and a few related things) (#617)

* reformat header

* type -> category

* done for now i think

* some more stuff

* first -> head

* focus

* flag comment

* ground -> floor

* remove asm, name wrapper funcs

* name func, format

* review

* targetPriority, format

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0305ec2c2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0305ec2c2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* comment

* review

* feet flags

* horse shadow
This commit is contained in:
fig02
2021-01-18 16:04:04 -05:00
committed by GitHub
parent 20206fba0d
commit 00a5edea71
697 changed files with 8157 additions and 7942 deletions
+3 -3
View File
@@ -22,9 +22,9 @@ void func_800430A0(CollisionContext* colCtx, s32 bgId, Actor* actor) {
colCtx->dyna.bgActors[bgId].curTransform.rot.x, colCtx->dyna.bgActors[bgId].curTransform.rot.y,
colCtx->dyna.bgActors[bgId].curTransform.rot.z, colCtx->dyna.bgActors[bgId].curTransform.pos.x,
colCtx->dyna.bgActors[bgId].curTransform.pos.y, colCtx->dyna.bgActors[bgId].curTransform.pos.z);
SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->posRot.pos, &tempPos);
SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->world.pos, &tempPos);
SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos);
actor->posRot.pos = pos;
actor->world.pos = pos;
if (BGCHECK_XYZ_ABSMAX <= pos.x || pos.x <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.y ||
pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) {
@@ -52,7 +52,7 @@ void func_800432A0(CollisionContext* colCtx, s32 bgId, Actor* actor) {
}
actor->shape.rot.y += rot;
actor->posRot.rot.y += rot;
actor->world.rot.y += rot;
}
}
+9 -9
View File
@@ -20,8 +20,8 @@ void func_800434B8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 2;
}
void func_800434C8(CollisionContext* colCtx, s32 floorPolySource) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource);
void func_800434C8(CollisionContext* colCtx, s32 floorBgId) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId);
if (dynaActor != NULL) {
func_800434B8(dynaActor);
@@ -32,8 +32,8 @@ void func_800434F8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 4;
}
void func_80043508(CollisionContext* colCtx, s32 floorPolySource) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource);
void func_80043508(CollisionContext* colCtx, s32 floorBgId) {
DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId);
if (dynaActor != NULL) {
func_800434F8(dynaActor);
@@ -93,9 +93,9 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16
sign = (0.0f <= actor->unk_150) ? 1.0f : -1.0f;
a2 = (f32)arg2 - 0.1f;
posA.x = actor->actor.posRot.pos.x + (a2 * cos);
posA.y = actor->actor.posRot.pos.y + arg4;
posA.z = actor->actor.posRot.pos.z - (a2 * sin);
posA.x = actor->actor.world.pos.x + (a2 * cos);
posA.y = actor->actor.world.pos.y + arg4;
posA.z = actor->actor.world.pos.z - (a2 * sin);
a3 = (f32)arg3 - 0.1f;
posB.x = sign * a3 * sin + posA.x;
@@ -105,8 +105,8 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16
actor, 0.0f)) {
return false;
}
posA.x = (actor->actor.posRot.pos.x * 2) - posA.x;
posA.z = (actor->actor.posRot.pos.z * 2) - posA.z;
posA.x = (actor->actor.world.pos.x * 2) - posA.x;
posA.z = (actor->actor.world.pos.z * 2) - posA.z;
posB.x = sign * a3 * sin + posA.x;
posB.z = sign * a3 * cos + posA.z;
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId,
+392 -387
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -2507,10 +2507,10 @@ void BgActor_SetActor(BgActor* bgActor, Actor* actor, CollisionHeader* colHeader
bgActor->prevTransform.scale = actor->scale;
bgActor->prevTransform.rot = actor->shape.rot;
bgActor->prevTransform.rot.x--;
bgActor->prevTransform.pos = actor->posRot.pos;
bgActor->prevTransform.pos = actor->world.pos;
bgActor->curTransform.scale = actor->scale;
bgActor->curTransform.rot = actor->shape.rot;
bgActor->curTransform.pos = actor->posRot.pos;
bgActor->curTransform.pos = actor->world.pos;
}
/**
@@ -2742,8 +2742,8 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
actor = dyna->bgActors[bgId].actor;
dyna->bgActors[bgId].dynaLookup.polyStartIndex = *polyStartIndex;
dyna->bgActors[bgId].vtxStartIndex = *vtxStartIndex;
pos = actor->posRot.pos;
pos.y += actor->shape.unk_08 * actor->scale.y;
pos = actor->world.pos;
pos.y += actor->shape.yOffset * actor->scale.y;
ScaleRotPos_SetValue(&dyna->bgActors[bgId].curTransform, &actor->scale, &actor->shape.rot, &pos);
@@ -4494,7 +4494,7 @@ void BgCheck_DrawStaticCollision(GlobalContext* globalCtx, CollisionContext* col
StaticLookup* lookup;
player = PLAYER;
lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.posRot.pos);
lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.world.pos);
if (AREG(23) != 0) {
BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->floor, 0, 0, 255);
}
+92 -92
View File
@@ -459,7 +459,7 @@ s32 Camera_GetDataIdxForPoly(Camera* camera, u32* bgId, CollisionPoly* poly) {
PosRot playerPosRot;
s32 ret;
func_8002EF44(&playerPosRot, &camera->player->actor); // unused.
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); // unused.
camDataIdx = SurfaceType_GetCamDataIndex(&camera->globalCtx->colCtx, poly, *bgId);
if (func_80041A4C(&camera->globalCtx->colCtx, camDataIdx, *bgId) == CAM_SET_NONE) {
@@ -481,7 +481,7 @@ Vec3s* Camera_GetCamBgDataUnderPlayer(Camera* camera, u16* dataCnt) {
s32 bgId;
PosRot playerPosShape;
func_8002EF44(&playerPosShape, &camera->player->actor);
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
playerPosShape.pos.y += Player_GetHeight(camera->player);
if (BgCheck_EntityRaycastFloor3(&camera->globalCtx->colCtx, &floorPoly, &bgId, &playerPosShape.pos) ==
BGCHECK_Y_MIN) {
@@ -503,7 +503,7 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) {
WaterBox* waterBox;
s32 ret;
func_8002EF44(&playerPosShape, &camera->player->actor);
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
*waterY = playerPosShape.pos.y;
if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, playerPosShape.pos.x, playerPosShape.pos.z,
@@ -538,7 +538,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
f32 waterY;
WaterBox* waterBox;
func_8002EF44(&playerPosRot, &camera->player->actor);
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
waterY = playerPosRot.pos.y;
if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, chkPos->x, chkPos->z, &waterY,
@@ -1184,7 +1184,7 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecSph* eyeAtDir, f32 yOffset, f32* yP
playerHeight = Player_GetHeight(camera->player);
player = camera->player;
func_8002EF44(&horsePosRot, player->rideActor);
Actor_GetWorldPosShapeRot(&horsePosRot, player->rideActor);
if (EN_HORSE_CHECK_5((EnHorse*)player->rideActor)) {
horsePosRot.pos.y -= 49.f;
@@ -2171,7 +2171,7 @@ s32 Camera_Jump1(Camera* camera) {
VecSph eyeDiffSph;
VecSph eyeDiffTarget;
PosRot* playerPosRot = &camera->playerPosRot;
PosRot playerPosRot2;
PosRot playerhead;
s16 tangle;
Jump1* jump1 = (Jump1*)camera->paramData;
Jump1Anim* anim = &jump1->anim;
@@ -2196,8 +2196,8 @@ s32 Camera_Jump1(Camera* camera) {
Camera_CopyPREGToModeValues(camera);
}
// playerPosRot2 never gets used.
func_8002EEE4(&playerPosRot2, &camera->player->actor);
// playerhead never gets used.
Actor_GetFocus(&playerhead, &camera->player->actor);
OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, at, eye);
OLib_Vec3fDiffToVecSphGeo(&eyeNextAtOffset, at, eyeNext);
@@ -2506,7 +2506,7 @@ s32 Camera_Jump3(Camera* camera) {
f32 phi_f0;
f32 phi_f2;
f32 playerHeight;
PosRot playerPosRot2;
PosRot playerhead;
f32 yNormal;
f32 temp_f18;
s32 modeSwitch;
@@ -2514,7 +2514,7 @@ s32 Camera_Jump3(Camera* camera) {
Jump3Anim* anim = &jump3->anim;
playerHeight = Player_GetHeight(camera->player);
func_8002EEE4(&playerPosRot2, &camera->player->actor);
Actor_GetFocus(&playerhead, &camera->player->actor);
modeSwitch = false;
if (((camera->waterYPos - eye->y) < OREG(44) || (camera->animState == 0))) {
@@ -2611,10 +2611,10 @@ s32 Camera_Jump3(Camera* camera) {
}
if (!(phi_f0 < 10.0f)) {
if (camera->waterYPos <= playerPosRot2.pos.y) {
phi_f2 = playerPosRot2.pos.y - camera->waterYPos;
if (camera->waterYPos <= playerhead.pos.y) {
phi_f2 = playerhead.pos.y - camera->waterYPos;
} else {
phi_f2 = -(playerPosRot2.pos.y - camera->waterYPos);
phi_f2 = -(playerhead.pos.y - camera->waterYPos);
}
if (!(phi_f2 < 50.0f)) {
camera->pitchUpdateRateInv = 100.0f;
@@ -2829,7 +2829,7 @@ s32 Camera_Battle1(Camera* camera) {
camera->atLERPStepScale =
Camera_ClampLERPScale(camera, isOffGround ? batt1->atLERPScaleOffGround : batt1->atLERPScaleOnGround);
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
if (anim->target != camera->target) {
osSyncPrintf("camera: battle: change target %d -> " VT_FGCOL(BLUE) "%d" VT_RST "\n", anim->target->id,
camera->target->id);
@@ -3108,17 +3108,17 @@ s32 Camera_KeepOn1(Camera* camera) {
switch (camera->paramFlags & 0x18) {
case 8:
if ((camera->player->actor.type == 2) && (camera->player->interactRangeActor == camera->target)) {
if ((camera->player->actor.category == 2) && (camera->player->interactRangeActor == camera->target)) {
PosRot sp54;
func_8002EEE4(&sp54, &camera->player->actor);
Actor_GetFocus(&sp54, &camera->player->actor);
spC8.r = 60.0f;
spC8.yaw = camera->playerPosRot.rot.y;
spC8.pitch = 0x2EE0;
Camera_Vec3fVecSphGeoAdd(&camera->targetPosRot.pos, &sp54.pos, &spC8);
} else {
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
if (anim->unk_0C != camera->target) {
anim->unk_0C = camera->target;
camera->atLERPStepScale = 0.0f;
@@ -3324,8 +3324,8 @@ s32 Camera_KeepOn3(Camera* camera) {
playerHeight += keep3->yOffset;
OLib_Vec3fDiffToVecSphGeo(&atToEyeDir, at, eye);
OLib_Vec3fDiffToVecSphGeo(&atToEyeNextDir, at, eyeNext);
func_8002EEE4(&camera->targetPosRot, camera->target);
func_8002EEE4(&playerPosRot, &camera->player->actor);
Actor_GetFocus(&camera->targetPosRot, camera->target);
Actor_GetFocus(&playerPosRot, &camera->player->actor);
playerHeadPos = camPlayerPosRot->pos;
playerHeadPos.y += playerHeight;
OLib_Vec3fDiffToVecSphGeo(&targetToPlayerDir, &playerHeadPos, &camera->targetPosRot.pos);
@@ -3470,7 +3470,7 @@ s32 Camera_KeepOn4(Camera* camera) {
s16 angleCnt;
s32 i;
player = (Player*)camera->globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first;
player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head;
if (camera->animState == 0 || camera->animState == 0xA || camera->animState == 0x14) {
if (camera->globalCtx->view.unk_124 == 0) {
@@ -3634,7 +3634,7 @@ s32 Camera_KeepOn4(Camera* camera) {
} else if ((keep4->unk_1C & 8) && camera->target != NULL) {
PosRot sp60;
func_8002EF44(&sp60, camera->target);
Actor_GetWorldPosShapeRot(&sp60, camera->target);
spA2 = DEGF_TO_BINANG(keep4->unk_08) - sp60.rot.x;
spA0 = BINANG_SUB(BINANG_ROT180(sp60.rot.y), spA8.yaw) > 0
? BINANG_ROT180(sp60.rot.y) + DEGF_TO_BINANG(keep4->unk_0C)
@@ -3644,7 +3644,7 @@ s32 Camera_KeepOn4(Camera* camera) {
} else if ((keep4->unk_1C & 0x80) && camera->target != NULL) {
PosRot sp4C;
func_8002EF14(&sp4C, camera->target);
Actor_GetWorld(&sp4C, camera->target);
spA2 = DEGF_TO_BINANG(keep4->unk_08);
sp9E = Camera_XZAngle(&sp4C.pos, &playerPosRot->pos);
spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + DEGF_TO_BINANG(keep4->unk_0C)
@@ -3786,7 +3786,7 @@ s32 Camera_KeepOn0(Camera* camera) {
return true;
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, eye, at);
OLib_Vec3fDiffToVecSphGeo(&eyeTargetPosOffset, eye, &camera->targetPosRot.pos);
@@ -4144,7 +4144,7 @@ s32 Camera_Subj3(Camera* camera) {
Vec3f* pad2;
f32 playerHeight;
func_8002EEE4(&sp60, &camera->player->actor);
Actor_GetFocus(&sp60, &camera->player->actor);
playerHeight = Player_GetHeight(camera->player);
if (camera->globalCtx->view.unk_124 == 0) {
@@ -4280,7 +4280,7 @@ s32 Camera_Subj4(Camera* camera) {
return true;
}
func_8002EF44(&sp6C, &camera->player->actor);
Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor);
OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eye);
sCameraInterfaceFlags = subj4->interfaceFlags;
@@ -4333,7 +4333,7 @@ s32 Camera_Subj4(Camera* camera) {
return false;
}
func_8002EF44(&sp6C, &camera->player->actor);
Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor);
Math3D_LineClosestToPoint(&anim->unk_00, &sp6C.pos, eyeNext);
at->x = eyeNext->x + anim->unk_00.b.x;
at->y = eyeNext->y + anim->unk_00.b.y;
@@ -4358,8 +4358,8 @@ s32 Camera_Subj4(Camera* camera) {
}
anim->unk_28 = temp_f16;
camera->player->actor.posRot.pos = *eyeNext;
camera->player->actor.posRot.pos.y = camera->playerGroundY;
camera->player->actor.world.pos = *eyeNext;
camera->player->actor.world.pos.y = camera->playerGroundY;
camera->player->actor.shape.rot.y = sp64.yaw;
temp_f16 = ((240.0f * temp_f16) * (anim->unk_24 * 0.416667f));
temp_a0 = temp_f16 + anim->unk_30;
@@ -4478,7 +4478,7 @@ s32 Camera_Unique1(Camera* camera) {
VecSph eyeAtOffset;
VecSph eyeNextAtOffset;
PosRot* playerPosRot = &camera->playerPosRot;
PosRot playerPosRot2;
PosRot playerhead;
Unique1* uniq1 = (Unique1*)camera->paramData;
Unique1Anim* anim = &uniq1->anim;
s32 pad;
@@ -4522,7 +4522,7 @@ s32 Camera_Unique1(Camera* camera) {
camera->animState++;
}
func_8002EEE4(&playerPosRot2, &camera->player->actor); // unused
Actor_GetFocus(&playerhead, &camera->player->actor); // unused
camera->yawUpdateRateInv = Camera_LERPCeilF(100.0f, camera->yawUpdateRateInv, OREG(25) * 0.01f, 0.1f);
camera->pitchUpdateRateInv = Camera_LERPCeilF(100.0f, camera->pitchUpdateRateInv, OREG(25) * 0.01f, 0.1f);
@@ -5001,8 +5001,8 @@ s32 Camera_Unique9(Camera* camera) {
s16 atInitFlags;
s16 eyeInitFlags;
s16 pad2;
PosRot targetPosRot2;
PosRot playerPosRot2;
PosRot targethead;
PosRot playerhead;
PosRot playerPosRot;
Vec3f* eyeNext = &camera->eyeNext;
Vec3f* at = &camera->at;
@@ -5028,7 +5028,7 @@ s32 Camera_Unique9(Camera* camera) {
sCameraInterfaceFlags = uniq9->interfaceFlags;
func_8002EF14(&playerPosRot, &camera->player->actor);
Actor_GetWorld(&playerPosRot, &camera->player->actor);
if (camera->animState == 0) {
camera->animState++;
@@ -5094,11 +5094,11 @@ s32 Camera_Unique9(Camera* camera) {
}
} else if (atInitFlags == 4 || atInitFlags == 0x84) {
if (camera->target != NULL && camera->target->update != NULL) {
func_8002EEE4(&targetPosRot2, camera->target);
func_8002EEE4(&playerPosRot2, &camera->player->actor);
playerPosRot2.pos.x = playerPosRot.pos.x;
playerPosRot2.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos);
Actor_GetFocus(&targethead, camera->target);
Actor_GetFocus(&playerhead, &camera->player->actor);
playerhead.pos.x = playerPosRot.pos.x;
playerhead.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos);
if (atInitFlags & (s16)0x8080) {
scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.x);
scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.y);
@@ -5108,7 +5108,7 @@ s32 Camera_Unique9(Camera* camera) {
}
scratchSph.yaw += playerTargetOffset.yaw;
scratchSph.pitch += playerTargetOffset.pitch;
Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targetPosRot2.pos, &scratchSph);
Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targethead.pos, &scratchSph);
} else {
if (camera->target == NULL) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: warning: demo C: actor is not valid\n" VT_RST);
@@ -5130,14 +5130,14 @@ s32 Camera_Unique9(Camera* camera) {
if (focusActor != NULL) {
if ((atInitFlags & 0xF) == 1) {
// posRot2
func_8002EEE4(&atFocusPosRot, focusActor);
// head
Actor_GetFocus(&atFocusPosRot, focusActor);
} else if ((atInitFlags & 0xF) == 2) {
// posRot
func_8002EF14(&atFocusPosRot, focusActor);
// world
Actor_GetWorld(&atFocusPosRot, focusActor);
} else {
// posRot, shape rot
func_8002EF44(&atFocusPosRot, focusActor);
// world, shape rot
Actor_GetWorldPosShapeRot(&atFocusPosRot, focusActor);
}
if (atInitFlags & (s16)0x8080) {
@@ -5181,13 +5181,13 @@ s32 Camera_Unique9(Camera* camera) {
if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400 || eyeInitFlags == 0x500 ||
eyeInitFlags == (s16)0x8500) {
if (camera->target != NULL && camera->target->update != NULL) {
func_8002EEE4(&targetPosRot2, camera->target);
func_8002EEE4(&playerPosRot2, &camera->player->actor);
playerPosRot2.pos.x = playerPosRot.pos.x;
playerPosRot2.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos);
Actor_GetFocus(&targethead, camera->target);
Actor_GetFocus(&playerhead, &camera->player->actor);
playerhead.pos.x = playerPosRot.pos.x;
playerhead.pos.z = playerPosRot.pos.z;
OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos);
if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400) {
eyeLookAtPos = targetPosRot2.pos;
eyeLookAtPos = targethead.pos;
} else {
eyeLookAtPos = anim->atTarget;
}
@@ -5224,14 +5224,14 @@ s32 Camera_Unique9(Camera* camera) {
if (focusActor != NULL) {
if ((eyeInitFlags & 0xF00) == 0x100) {
// posRot2
func_8002EEE4(&eyeFocusPosRot, focusActor);
// head
Actor_GetFocus(&eyeFocusPosRot, focusActor);
} else if ((eyeInitFlags & 0xF00) == 0x200) {
// posRot
func_8002EF14(&eyeFocusPosRot, focusActor);
// world
Actor_GetWorld(&eyeFocusPosRot, focusActor);
} else {
// posRot, shapeRot
func_8002EF44(&eyeFocusPosRot, focusActor);
// world, shapeRot
Actor_GetWorldPosShapeRot(&eyeFocusPosRot, focusActor);
}
if (eyeInitFlags & (s16)0x8080) {
@@ -5436,10 +5436,10 @@ s32 Camera_Unique9(Camera* camera) {
if (anim->curKeyFrame->actionFlags & 0x40) {
// Set the player's position
camera->player->actor.posRot.pos.x = anim->playerPos.x;
camera->player->actor.posRot.pos.z = anim->playerPos.z;
camera->player->actor.world.pos.x = anim->playerPos.x;
camera->player->actor.world.pos.z = anim->playerPos.z;
if (camera->player->stateFlags1 & 0x8000000 && player->currentBoots != PLAYER_BOOTS_IRON) {
camera->player->actor.posRot.pos.y = anim->playerPos.y;
camera->player->actor.world.pos.y = anim->playerPos.y;
}
} else {
anim->playerPos.x = playerPosRot.pos.x;
@@ -5555,7 +5555,7 @@ s32 Camera_Demo1(Camera* camera) {
// if the camera is set to be relative to the player, move the interpolated points
// relative to the player's position
if (camera->player != NULL && camera->player->actor.update != NULL) {
func_8002EF14(&curPlayerPosRot, &camera->player->actor);
Actor_GetWorld(&curPlayerPosRot, &camera->player->actor);
Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext);
Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at);
} else {
@@ -5811,8 +5811,8 @@ s32 Camera_Demo5(Camera* camera) {
VecSph playerTargetGeo;
VecSph eyePlayerGeo;
VecSph sp78;
PosRot playerPosRot2;
PosRot targetPosRot2;
PosRot playerhead;
PosRot targethead;
Player* player;
s16 sp4A;
s32 pad;
@@ -5820,7 +5820,7 @@ s32 Camera_Demo5(Camera* camera) {
s16 t;
s32 pad2;
func_8002EEE4(&playerPosRot2, &camera->player->actor);
Actor_GetFocus(&playerhead, &camera->player->actor);
player = camera->player;
sCameraInterfaceFlags = 0x3200;
if ((camera->target == NULL) || (camera->target->update == NULL)) {
@@ -5830,14 +5830,14 @@ s32 Camera_Demo5(Camera* camera) {
camera->target = NULL;
return true;
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
OLib_Vec3fDiffToVecSphGeo(&playerTargetGeo, &camera->targetPosRot.pos, &camera->playerPosRot.pos);
D_8011D3AC = camera->target->type;
D_8011D3AC = camera->target->category;
func_8002F374(camera->globalCtx, camera->target, &sp78.yaw, &sp78.pitch);
eyeTargetDist = OLib_Vec3fDist(&camera->targetPosRot.pos, &camera->eye);
OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerPosRot2.pos, &camera->eyeNext);
OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerhead.pos, &camera->eyeNext);
sp4A = eyePlayerGeo.yaw - playerTargetGeo.yaw;
if (camera->target->type == ACTORTYPE_PLAYER) {
if (camera->target->category == ACTORCAT_PLAYER) {
// camera is targeting a(the) player actor
if (eyePlayerGeo.r > 30.0f) {
D_8011D6AC[1].timerInit = camera->timer - 1;
@@ -5925,7 +5925,7 @@ s32 Camera_Demo5(Camera* camera) {
camera->timer += D_8011D8DC[1].timerInit + D_8011D8DC[2].timerInit;
}
}
} else if (camera->target->type == ACTORTYPE_DOOR) {
} else if (camera->target->category == ACTORCAT_DOOR) {
// the target is a door.
D_8011D954[0].timerInit = camera->timer - 5;
sp4A = 0;
@@ -5945,10 +5945,10 @@ s32 Camera_Demo5(Camera* camera) {
temp_v0 = Rand_ZeroOne() * (sp90 * -0.2f);
D_8011D954[1].rollTargetInit = temp_v0;
D_8011D954[0].rollTargetInit = temp_v0;
func_8002EEE4(&targetPosRot2, camera->target);
targetPosRot2.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A));
targetPosRot2.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A));
if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) {
Actor_GetFocus(&targethead, camera->target);
targethead.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A));
targethead.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A));
if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) {
D_8011D954[1].actionFlags = 0xC1;
D_8011D954[2].actionFlags = 0x8F;
} else {
@@ -5971,8 +5971,8 @@ s32 Camera_Demo5(Camera* camera) {
}
Player_GetHeight(camera->player);
D_8011D9F4[0].timerInit = camera->timer;
func_8002EEE4(&targetPosRot2, camera->target);
if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) {
Actor_GetFocus(&targethead, camera->target);
if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) {
D_8011D9F4[1].timerInit = 4;
D_8011D9F4[1].actionFlags = 0x8F;
} else {
@@ -6006,8 +6006,8 @@ s32 Camera_Demo5(Camera* camera) {
// env frozen
player->actor.freezeTimer = camera->timer;
} else {
sp4A = playerPosRot2.rot.y - playerTargetGeo.yaw;
if (camera->target->type == ACTORTYPE_PLAYER) {
sp4A = playerhead.rot.y - playerTargetGeo.yaw;
if (camera->target->category == ACTORCAT_PLAYER) {
pad = camera->globalCtx->state.frames - sDemo5PrevAction12Frame;
if (player->stateFlags1 & 0x800) {
// holding object over head.
@@ -6063,7 +6063,7 @@ s32 Camera_Demo6(Camera* camera) {
// initalizes the camera state.
anim->animTimer = 0;
camera->fov = 60.0f;
func_8002EF14(&focusPosRot, camFocus);
Actor_GetWorld(&focusPosRot, camFocus);
camera->at.x = focusPosRot.pos.x;
camera->at.y = focusPosRot.pos.y + 20.0f;
camera->at.z = focusPosRot.pos.z;
@@ -6078,7 +6078,7 @@ s32 Camera_Demo6(Camera* camera) {
case 1:
if (stateTimers[camera->animState] < anim->animTimer) {
func_8002DF54(camera->globalCtx, &camera->player->actor, 8);
func_8002EF14(&focusPosRot, camFocus);
Actor_GetWorld(&focusPosRot, camFocus);
anim->atTarget.x = focusPosRot.pos.x;
anim->atTarget.y = focusPosRot.pos.y - 20.0f;
anim->atTarget.z = focusPosRot.pos.z;
@@ -6103,7 +6103,7 @@ s32 Camera_Demo6(Camera* camera) {
}
anim->animTimer++;
func_8002EF14(&focusPosRot, camFocus);
Actor_GetWorld(&focusPosRot, camFocus);
return true;
}
@@ -6198,13 +6198,13 @@ s32 Camera_Demo9(Camera* camera) {
Camera_RotateAroundPoint(cam0PlayerPosRot, &csAtUpdate, &newAt);
} else if (demo9OnePoint->onePointDemo.actionParameters == 4) {
// rotate around the current camera's player
func_8002EF14(&focusPosRot, &camera->player->actor);
Actor_GetWorld(&focusPosRot, &camera->player->actor);
Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye);
Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt);
} else if (demo9OnePoint->onePointDemo.actionParameters == 8) {
// rotate around the current camera's target
if (camera->target != NULL && camera->target->update != NULL) {
func_8002EF14(&focusPosRot, camera->target);
Actor_GetWorld(&focusPosRot, camera->target);
Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye);
Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt);
} else {
@@ -6297,7 +6297,7 @@ s32 Camera_Special0(Camera* camera) {
return true;
}
func_8002EEE4(&camera->targetPosRot, camera->target);
Actor_GetFocus(&camera->targetPosRot, camera->target);
Camera_LERPCeilVec3f(&camera->targetPosRot.pos, &camera->at, spec0->lerpAtScale, spec0->lerpAtScale, 0.1f);
camera->posOffset.x = camera->at.x - playerPosRot->pos.x;
@@ -6343,7 +6343,7 @@ s32 Camera_Special4(Camera* camera) {
return false;
} else {
camera->roll = -0x1F4;
func_8002EF14(&curTargetPosRot, camera->target);
Actor_GetWorld(&curTargetPosRot, camera->target);
camera->at = curTargetPosRot.pos;
camera->at.y -= 150.0f;
@@ -6401,7 +6401,7 @@ s32 Camera_Special5(Camera* camera) {
OLib_Vec3fDiffToVecSphGeo(&sp64, at, eye);
OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eyeNext);
func_8002EF14(&spA8, camera->target);
Actor_GetWorld(&spA8, camera->target);
sCameraInterfaceFlags = spec5->interfaceFlags;
@@ -6647,7 +6647,7 @@ s32 Camera_Special9(Camera* camera) {
}
if (spec9->doorParams.doorActor != NULL) {
func_8002EF44(&adjustedPlayerPosRot, spec9->doorParams.doorActor);
Actor_GetWorldPosShapeRot(&adjustedPlayerPosRot, spec9->doorParams.doorActor);
} else {
adjustedPlayerPosRot = *playerPosRot;
adjustedPlayerPosRot.pos.y += playerYOffset + params->yOffset;
@@ -6894,7 +6894,7 @@ void Camera_InitPlayerSettings(Camera* camera, Player* player) {
Vec3f* at = &camera->at;
Vec3f* eyeNext = &camera->eyeNext;
func_8002EF44(&playerPosShape, &player->actor);
Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor);
playerYOffset = Player_GetHeight(player);
camera->player = player;
camera->playerPosRot = playerPosShape;
@@ -7333,7 +7333,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) {
sUpdateCameraDirection = false;
if (camera->player != NULL) {
func_8002EF44(&curPlayerPosRot, &camera->player->actor);
Actor_GetWorldPosShapeRot(&curPlayerPosRot, &camera->player->actor);
camera->xzSpeed = playerXZSpeed = OLib_Vec3fDistXZ(&curPlayerPosRot.pos, &camera->playerPosRot.pos);
camera->speedRatio = OLib_ClampMaxDist(playerXZSpeed / (func_8002DCE4(camera->player) * PCT(OREG(8))), 1.0f);
@@ -7558,7 +7558,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) {
*/
void Camera_Finish(Camera* camera) {
Camera* defaultCam = camera->globalCtx->cameraPtrs[0];
Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first;
Player* player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head;
if (camera->timer == 0) {
Gameplay_ChangeCameraStatus(camera->globalCtx, camera->parentCamIdx, 7);
@@ -7966,7 +7966,7 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa
if (camera->data2 != 0) {
camera->player = player;
func_8002EF44(&playerPosRot, &player->actor);
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
camera->playerPosRot = playerPosRot;
camera->nextCamDataIdx = -1;
@@ -8042,7 +8042,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) {
func_80043B60(dstCamera);
if (dstCamera->player != NULL) {
func_8002EF14(&dstCamera->playerPosRot, &dstCamera->player->actor);
Actor_GetWorld(&dstCamera->playerPosRot, &dstCamera->player->actor);
dstCamera->posOffset.x = dstCamera->at.x - dstCamera->playerPosRot.pos.x;
dstCamera->posOffset.y = dstCamera->at.y - dstCamera->playerPosRot.pos.y;
dstCamera->posOffset.z = dstCamera->at.z - dstCamera->playerPosRot.pos.z;
+11 -11
View File
@@ -1632,7 +1632,7 @@ void CollisionCheck_HitSolid(GlobalContext* globalCtx, ColliderInfo* info, Colli
* Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemType.
*/
s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) {
if (at->actor != NULL && at->actor->type == ACTORTYPE_PLAYER) {
if (at->actor != NULL && at->actor->category == ACTORCAT_PLAYER) {
if (acInfo->elemType == ELEMTYPE_UNK0) {
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
@@ -2962,8 +2962,8 @@ void CollisionCheck_ResetDamage(CollisionCheckInfo* info) {
*/
void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init) {
info->health = init->health;
info->unk_10 = init->unk_02;
info->unk_12 = init->unk_04;
info->cylRadius = init->cylRadius;
info->cylHeight = init->cylHeight;
info->mass = init->mass;
}
@@ -2973,8 +2973,8 @@ void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionChec
void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) {
info->health = init->health;
info->damageTable = damageTable;
info->unk_10 = init->unk_02;
info->unk_12 = init->unk_04;
info->cylRadius = init->cylRadius;
info->cylHeight = init->cylHeight;
info->mass = init->mass;
}
@@ -2984,9 +2984,9 @@ void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable,
void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) {
info->health = init->health;
info->damageTable = damageTable;
info->unk_10 = init->unk_02;
info->unk_12 = init->unk_04;
info->unk_14 = init->unk_06;
info->cylRadius = init->cylRadius;
info->cylHeight = init->cylHeight;
info->cylYShift = init->cylYShift;
info->mass = init->mass;
}
@@ -3218,9 +3218,9 @@ s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext*
* Moves the ColliderCylinder's position to the actor's position
*/
void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider) {
collider->dim.pos.x = actor->posRot.pos.x;
collider->dim.pos.y = actor->posRot.pos.y;
collider->dim.pos.z = actor->posRot.pos.z;
collider->dim.pos.x = actor->world.pos.x;
collider->dim.pos.y = actor->world.pos.y;
collider->dim.pos.z = actor->world.pos.z;
}
/**
+23 -24
View File
@@ -23,7 +23,7 @@ void func_8001D5C8(EnAObj* this, s16 params);
const ActorInit En_A_Obj_InitVars = {
ACTOR_EN_A_OBJ,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnAObj),
@@ -108,9 +108,9 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
sp28 = 12.0f;
}
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28);
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, sp28);
thisx->posRot2.pos = thisx->posRot.pos;
thisx->focus.pos = thisx->world.pos;
this->dyna.bgId = BGACTOR_NEG_ONE;
this->dyna.unk_160 = 0;
this->dyna.unk_15C = DPM_UNK;
@@ -121,13 +121,13 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
case A_OBJ_BLOCK_LARGE:
case A_OBJ_BLOCK_HUGE:
this->dyna.bgId = 1;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
func_8001D5C8(this, thisx->params);
break;
case A_OBJ_BLOCK_SMALL_ROT:
case A_OBJ_BLOCK_LARGE_ROT:
this->dyna.bgId = 3;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
func_8001D310(this, thisx->params);
break;
case A_OBJ_UNKNOWN_6:
@@ -146,14 +146,14 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
case A_OBJ_SIGNPOST_ARROW:
thisx->textId = (this->textId & 0xFF) | 0x300;
// clang-format off
thisx->flags |= 0x1 | 0x8; thisx->unk_4C = 500.0f;
thisx->flags |= 0x1 | 0x8; thisx->targetArrowOffset = 500.0f;
// clang-format on
this->unk_178 = 45.0f;
func_8001D234(this, thisx->params);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
thisx->colChkInfo.mass = MASS_IMMOVABLE;
thisx->unk_1F = 0;
thisx->targetMode = 0;
break;
case A_OBJ_KNOB:
thisx->gravity = -1.5f;
@@ -201,7 +201,7 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
s16 var;
if (this->dyna.actor.textId != 0) {
var = this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y;
var = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) {
if (func_8002F194(&this->dyna.actor, globalCtx)) {
EnAObj_SetupAction(this, func_8001D204);
@@ -215,8 +215,8 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
void func_8001D310(EnAObj* this, s16 params) {
this->unk_16E = 0;
this->unk_168 = 10;
this->dyna.actor.posRot.rot.y = 0;
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
this->dyna.actor.world.rot.y = 0;
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
EnAObj_SetupAction(this, func_8001D360);
}
@@ -226,13 +226,13 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
this->unk_16E++;
this->unk_170 = 20;
if ((s16)(this->dyna.actor.yawTowardsLink + 0x4000) < 0) {
if ((s16)(this->dyna.actor.yawTowardsPlayer + 0x4000) < 0) {
this->unk_174 = -1000;
} else {
this->unk_174 = 1000;
}
if (this->dyna.actor.yawTowardsLink < 0) {
if (this->dyna.actor.yawTowardsPlayer < 0) {
this->unk_172 = -this->unk_174;
} else {
this->unk_172 = this->unk_174;
@@ -248,12 +248,12 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
this->dyna.actor.gravity = -1.0f;
if (this->unk_170 == 0) {
this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos;
this->dyna.actor.world.pos = this->dyna.actor.home.pos;
this->unk_16E = 0;
this->unk_168 = 10;
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
}
}
}
@@ -265,14 +265,13 @@ void func_8001D480(EnAObj* this, s16 params) {
void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.posRot.rot.x >> 1);
this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.posRot.rot.z >> 1);
this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.world.rot.x >> 1);
this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.world.rot.z >> 1);
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 0x8)) {
if (1) { // Necessary to match
this->dyna.actor.posRot.rot.y =
((this->dyna.actor.wallPolyRot - this->dyna.actor.posRot.rot.y) + this->dyna.actor.wallPolyRot) -
0x8000;
this->dyna.actor.world.rot.y =
((this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw) - 0x8000;
}
this->dyna.actor.bgCheckFlags &= ~0x8;
}
@@ -296,7 +295,7 @@ void func_8001D5C8(EnAObj* this, s16 params) {
void func_8001D608(EnAObj* this, GlobalContext* globalCtx) {
this->dyna.actor.speedXZ += this->dyna.unk_150;
this->dyna.actor.posRot.rot.y = this->dyna.unk_158;
this->dyna.actor.world.rot.y = this->dyna.unk_158;
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f);
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
@@ -317,14 +316,14 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->dyna.actor.gravity != 0.0f) {
if (this->dyna.actor.params != A_OBJ_KNOB) {
func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
} else {
func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
}
}
this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos;
this->dyna.actor.posRot2.pos.y += this->unk_178;
this->dyna.actor.focus.pos = this->dyna.actor.world.pos;
this->dyna.actor.focus.pos.y += this->unk_178;
switch (this->dyna.actor.params) {
case A_OBJ_SIGNPOST_OBLONG:
+57 -57
View File
@@ -18,7 +18,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx);
const ActorInit En_Item00_InitVars = {
ACTOR_EN_ITEM00,
ACTORTYPE_MISC,
ACTORCAT_MISC,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnItem00),
@@ -96,7 +96,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.02f;
break;
case ITEM00_HEART:
this->actor.initPosRot.rot.z = Rand_CenteredFloat(65535.0f);
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
sp34 = 430.0f;
Actor_SetScale(&this->actor, 0.02f);
this->unk_15C = 0.02f;
@@ -157,7 +157,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.5f;
sp34 = 0.0f;
sp30 = 0.6f;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
break;
case ITEM00_SHIELD_HYLIAN:
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2);
@@ -166,7 +166,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.5f;
sp34 = 0.0f;
sp30 = 0.6f;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
break;
case ITEM00_TUNIC_ZORA:
case ITEM00_TUNIC_GORON:
@@ -176,14 +176,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_15C = 0.5f;
sp34 = 0.0f;
sp30 = 0.6f;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
break;
}
this->unk_156 = 0;
ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawFunc_Circle, sp30);
this->actor.shape.unk_14 = 0xB4;
this->actor.posRot2.pos = this->actor.posRot.pos;
ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawCircle, sp30);
this->actor.shape.shadowAlpha = 0xB4;
this->actor.focus.pos = this->actor.world.pos;
this->unk_152 = 0;
if (!spawnParam8000) {
@@ -286,20 +286,20 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
} else {
if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
if (this->unk_15A == -1) {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) {
this->unk_15A = -2;
}
} else {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) {
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) {
this->unk_15A = -1;
}
}
Math_SmoothStepToS(&this->actor.posRot.rot.x, 0, 2, 2500, 500);
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
}
}
if (this->actor.params == ITEM00_HEART_PIECE) {
this->actor.shape.unk_08 = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f;
}
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
@@ -332,9 +332,9 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) {
}
if (globalCtx->gameplayFrames & 1) {
pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(10.0f);
pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(10.0f);
pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(10.0f);
pos.x = this->actor.world.pos.x + Rand_CenteredFloat(10.0f);
pos.y = this->actor.world.pos.y + Rand_CenteredFloat(10.0f);
pos.z = this->actor.world.pos.z + Rand_CenteredFloat(10.0f);
EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
}
@@ -364,20 +364,20 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
if (this->actor.velocity.y < -1.5f) {
this->actor.velocity.y = -1.5f;
}
this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
this->actor.posRot.pos.x +=
Math_CosS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z));
this->actor.posRot.pos.z +=
Math_SinS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z));
this->actor.home.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
this->actor.world.pos.x +=
Math_CosS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z));
this->actor.world.pos.z +=
Math_SinS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z));
}
}
if (this->actor.params <= ITEM00_RUPEE_RED) {
this->actor.shape.rot.y += 960;
} else if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) {
this->actor.posRot.rot.x -= 700;
this->actor.world.rot.x -= 700;
this->actor.shape.rot.y += 400;
this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000;
this->actor.shape.rot.x = this->actor.world.rot.x - 0x4000;
}
if (this->actor.velocity.y <= 2.0f) {
@@ -390,9 +390,9 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) {
}
if (!(globalCtx->gameplayFrames & 1)) {
pos.x = this->actor.posRot.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.z = this->actor.posRot.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.y = this->actor.world.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f;
pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f;
EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
}
@@ -421,7 +421,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
return;
}
this->actor.posRot.pos = player->actor.posRot.pos;
this->actor.world.pos = player->actor.world.pos;
if (this->actor.params <= ITEM00_RUPEE_RED) {
this->actor.shape.rot.y += 960;
@@ -429,10 +429,10 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = 0;
}
this->actor.posRot.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
this->actor.world.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
if (LINK_IS_ADULT) {
this->actor.posRot.pos.y += 20.0f;
this->actor.world.pos.y += 20.0f;
}
}
@@ -475,9 +475,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
if (globalCtx->colCtx.dyna.bgActorFlags[i] & 1) {
dynaActor = globalCtx->colCtx.dyna.bgActors[i].actor;
if ((dynaActor != NULL) && (dynaActor->update != NULL) &&
((dynaActor->posRot.pos.x != dynaActor->pos4.x) ||
(dynaActor->posRot.pos.y != dynaActor->pos4.y) ||
(dynaActor->posRot.pos.z != dynaActor->pos4.z))) {
((dynaActor->world.pos.x != dynaActor->prevPos.x) ||
(dynaActor->world.pos.y != dynaActor->prevPos.y) ||
(dynaActor->world.pos.z != dynaActor->prevPos.z))) {
D_80157D94++;
break;
}
@@ -490,9 +490,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (sp3A || D_80157D94) {
func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
if (this->actor.groundY <= -10000.0f) {
if (this->actor.floorHeight <= -10000.0f) {
Actor_Kill(&this->actor);
return;
}
@@ -505,11 +505,11 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actor.params == ITEM00_SHIELD_DEKU) || (this->actor.params == ITEM00_SHIELD_HYLIAN) ||
(this->actor.params == ITEM00_TUNIC_ZORA) || (this->actor.params == ITEM00_TUNIC_GORON)) {
f32 newUnkBC = Math_CosS(this->actor.shape.rot.x) * 37.0f;
this->actor.shape.unk_08 = newUnkBC;
this->actor.shape.yOffset = newUnkBC;
if (newUnkBC >= 0.0f) {
this->actor.shape.unk_08 = this->actor.shape.unk_08;
this->actor.shape.yOffset = this->actor.shape.yOffset;
} else {
this->actor.shape.unk_08 = -this->actor.shape.unk_08;
this->actor.shape.yOffset = -this->actor.shape.yOffset;
}
}
@@ -517,8 +517,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (!((this->actor.xzDistToLink <= 30.0f) && (this->actor.yDistToLink >= -50.0f) &&
(this->actor.yDistToLink <= 50.0f))) {
if (!((this->actor.xzDistToPlayer <= 30.0f) && (this->actor.yDistToPlayer >= -50.0f) &&
(this->actor.yDistToPlayer <= 50.0f))) {
if (!Actor_HasParent(&this->actor, globalCtx)) {
return;
}
@@ -890,7 +890,7 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 pa
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
Actor_SetScale(&spawnedActor->actor, 0.0f);
EnItem00_SetupAction(spawnedActor, func_8001E304);
spawnedActor->unk_15A = 220;
@@ -931,7 +931,7 @@ EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 p
spawnedActor->actor.velocity.y = 0.0f;
spawnedActor->actor.speedXZ = 0.0f;
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.flags |= 0x0010;
}
}
@@ -953,31 +953,31 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
params = params & 0x7FFF;
if (fromActor != NULL) {
if (fromActor->unk_116) {
if (fromActor->unk_116 & 0x01) {
if (fromActor->dropFlag) {
if (fromActor->dropFlag & 0x01) {
params = 1 * 0x10;
dropTableIndex = 0xB;
} else if (fromActor->unk_116 & 0x02) {
dropTableIndex = 11;
} else if (fromActor->dropFlag & 0x02) {
params = 1 * 0x10;
dropTableIndex = 0x6;
} else if (fromActor->unk_116 & 0x04) {
dropTableIndex = 6;
} else if (fromActor->dropFlag & 0x04) {
params = 6 * 0x10;
dropTableIndex = 0x9;
} else if (fromActor->unk_116 & 0x08) {
dropTableIndex = 9;
} else if (fromActor->dropFlag & 0x08) {
params = 3 * 0x10;
dropTableIndex = 0xB;
} else if (fromActor->unk_116 & 0x10) {
dropTableIndex = 11;
} else if (fromActor->dropFlag & 0x10) {
params = 6 * 0x10;
dropTableIndex = 0xC;
} else if (fromActor->unk_116 & 0x20) {
dropTableIndex = 12;
} else if (fromActor->dropFlag & 0x20) {
params = 0 * 0x10;
dropTableIndex = 0x0;
} else if (fromActor->unk_116 & 0x40) {
dropTableIndex = 0;
} else if (fromActor->dropFlag & 0x40) {
params = 0 * 0x10;
dropTableIndex = 0x1;
dropTableIndex = 1;
}
}
if (fromActor->unk_116 & 0x20) {
if (fromActor->dropFlag & 0x20) {
dropId = ITEM00_RUPEE_PURPLE;
} else {
dropId = D_80115574[params + dropTableIndex];
@@ -1043,7 +1043,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
spawnedActor->actor.velocity.y = 8.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.gravity = -0.9f;
spawnedActor->actor.posRot.rot.y = Rand_ZeroOne() * 40000.0f;
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
Actor_SetScale(&spawnedActor->actor, 0.0f);
EnItem00_SetupAction(spawnedActor, func_8001E304);
spawnedActor->actor.flags |= 0x0010;
+20 -21
View File
@@ -48,10 +48,9 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
};
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
player->rideActor =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x,
player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.world.pos.x,
player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x,
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
}
@@ -167,7 +166,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
}
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7);
spawnPos.z, 0, player->actor.world.rot.y, 0, 7);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
}
@@ -203,14 +202,14 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
(((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) {
if (D_8011F9B8[i].type == 7) {
if ((globalCtx->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) {
D_8011F9B8[i].pos.x = player->actor.posRot.pos.x;
D_8011F9B8[i].pos.y = player->actor.posRot.pos.y;
D_8011F9B8[i].pos.z = player->actor.posRot.pos.z;
D_8011F9B8[i].pos.x = player->actor.world.pos.x;
D_8011F9B8[i].pos.y = player->actor.world.pos.y;
D_8011F9B8[i].pos.z = player->actor.world.pos.z;
}
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
player->actor.world.rot.y, 0, D_8011F9B8[i].type);
if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
}
@@ -233,20 +232,20 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
}
player->actor.posRot.pos.x = D_8011F9B8[i].pos.x;
player->actor.posRot.pos.y = D_8011F9B8[i].pos.y;
player->actor.posRot.pos.z = D_8011F9B8[i].pos.z;
player->actor.world.pos.x = D_8011F9B8[i].pos.x;
player->actor.world.pos.y = D_8011F9B8[i].pos.y;
player->actor.world.pos.z = D_8011F9B8[i].pos.z;
player->actor.shape.rot.x = player->actor.shape.rot.z = 0;
player->actor.shape.rot.y = D_8011F9B8[i].angle;
func_8002DECC(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
sp54.x = player->actor.posRot.pos.x - 200.0f;
sp54.y = player->actor.posRot.pos.y + 100.0f;
sp54.z = player->actor.posRot.pos.z;
sp54.x = player->actor.world.pos.x - 200.0f;
sp54.y = player->actor.world.pos.y + 100.0f;
sp54.z = player->actor.world.pos.z;
Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54);
Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.world.pos, &sp54);
} else {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
@@ -284,15 +283,15 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player) {
}
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y;
s16 x = Math_Vec3f_Yaw(&actor->world.pos, arg1) - actor->world.rot.y;
if (x > arg2) {
actor->posRot.rot.y += arg2;
actor->world.rot.y += arg2;
} else if (x < -arg2) {
actor->posRot.rot.y -= arg2;
actor->world.rot.y -= arg2;
} else {
actor->posRot.rot.y += x;
actor->world.rot.y += x;
}
actor->shape.rot.y = actor->posRot.rot.y;
actor->shape.rot.y = actor->world.rot.y;
}
+5 -5
View File
@@ -11,8 +11,8 @@ s16 sEntranceIconMapIndex = 0;
void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
Player* player = PLAYER;
sPlayerInitialPosX = player->actor.posRot.pos.x;
sPlayerInitialPosZ = player->actor.posRot.pos.z;
sPlayerInitialPosX = player->actor.world.pos.x;
sPlayerInitialPosZ = player->actor.world.pos.z;
sPlayerInitialDirection = (s16)((0x7FFF - player->actor.shape.rot.y) / 0x400);
}
@@ -326,8 +326,8 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
tempX = player->actor.posRot.pos.x;
tempZ = player->actor.posRot.pos.z;
tempX = player->actor.world.pos.x;
tempZ = player->actor.world.pos.z;
tempX /= R_COMPASS_SCALE_X;
tempZ /= R_COMPASS_SCALE_Y;
Matrix_Translate((R_COMPASS_OFFSET_X + tempX) / 10.0f, (R_COMPASS_OFFSET_Y - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
@@ -531,7 +531,7 @@ void Map_Update(GlobalContext* globalCtx) {
}
for (floor = 0; floor < 8; floor++) {
if (player->actor.posRot.pos.y > gMapData->floorCoordY[mapIndex][floor]) {
if (player->actor.world.pos.y > gMapData->floorCoordY[mapIndex][floor]) {
break;
}
}
+2 -2
View File
@@ -24,8 +24,8 @@ f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw) {
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos = &pointPos[waypoint];
dx = pointPos->x - actor->posRot.pos.x;
dz = pointPos->z - actor->posRot.pos.z;
dx = pointPos->x - actor->world.pos.x;
dz = pointPos->z - actor->world.pos.z;
*yaw = Math_FAtan2F(dx, dz) * (32768 / M_PI);
+8 -8
View File
@@ -1594,9 +1594,9 @@ s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3
player = camera->player;
if (player != NULL) {
camera->posOffset.x = at->x - player->actor.posRot.pos.x;
camera->posOffset.y = at->y - player->actor.posRot.pos.y;
camera->posOffset.z = at->z - player->actor.posRot.pos.z;
camera->posOffset.x = at->x - player->actor.world.pos.x;
camera->posOffset.y = at->y - player->actor.world.pos.y;
camera->posOffset.z = at->z - player->actor.world.pos.z;
} else {
camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f;
}
@@ -1622,9 +1622,9 @@ s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Ve
player = camera->player;
if (player != NULL) {
camera->posOffset.x = at->x - player->actor.posRot.pos.x;
camera->posOffset.y = at->y - player->actor.posRot.pos.y;
camera->posOffset.z = at->z - player->actor.posRot.pos.z;
camera->posOffset.x = at->x - player->actor.world.pos.x;
camera->posOffset.y = at->y - player->actor.world.pos.y;
camera->posOffset.z = at->z - player->actor.world.pos.z;
} else {
camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f;
}
@@ -1748,7 +1748,7 @@ void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 p
roomIndex = globalCtx->roomCtx.curRoom.num;
entranceIndex = gSaveContext.entranceIndex;
Gameplay_SetRespawnData(globalCtx, respawnMode, entranceIndex, roomIndex, playerParams,
&player->actor.posRot.pos, player->actor.shape.rot.y);
&player->actor.world.pos, player->actor.shape.rot.y);
}
}
@@ -1797,7 +1797,7 @@ s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) {
TransitionActorEntry* transitionActor;
s32 frontRoom;
if (actor->type != ACTORTYPE_DOOR) {
if (actor->category != ACTORCAT_DOOR) {
return 0;
}
+1 -1
View File
@@ -19,7 +19,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Player_InitVars = {
ACTOR_PLAYER,
ACTORTYPE_PLAYER,
ACTORCAT_PLAYER,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(Player),
+12 -13
View File
@@ -389,7 +389,7 @@ void func_8008EDF0(Player* this) {
void func_8008EE08(Player* this) {
if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8A00000) ||
(!(this->stateFlags1 & 0xC0000) && ((this->actor.posRot.pos.y - this->actor.groundY) < 100.0f))) {
(!(this->stateFlags1 & 0xC0000) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) {
this->stateFlags1 &= ~0x400F8000;
} else if (!(this->stateFlags1 & 0x2C0000)) {
this->stateFlags1 |= 0x80000;
@@ -1215,11 +1215,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
if (this->actor.scale.y >= 0.0f) {
if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) {
if (this->stateFlags1 & 0x200) {
Matrix_MultVec3f(&D_80126128, &hookedActor->posRot.pos);
Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos);
Matrix_RotateRPY(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY);
Matrix_Get(&sp14C);
func_800D20CC(&sp14C, &hookedActor->posRot.rot, 0);
hookedActor->shape.rot = hookedActor->posRot.rot;
func_800D20CC(&sp14C, &hookedActor->world.rot, 0);
hookedActor->shape.rot = hookedActor->world.rot;
} else if (this->stateFlags1 & 0x800) {
Vec3s spB8;
@@ -1227,10 +1227,9 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
func_800D20CC(&sp14C, &spB8, 0);
if (hookedActor->flags & 0x20000) {
hookedActor->posRot.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x;
hookedActor->world.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x;
} else {
hookedActor->posRot.rot.y = hookedActor->shape.rot.y =
this->actor.shape.rot.y + this->unk_3BC.y;
hookedActor->world.rot.y = hookedActor->shape.rot.y = this->actor.shape.rot.y + this->unk_3BC.y;
}
}
} else {
@@ -1298,11 +1297,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
MtxF sp44;
s32 pad;
Matrix_MultVec3f(&D_80126190, &heldActor->posRot.pos);
Matrix_MultVec3f(&D_80126190, &heldActor->world.pos);
Matrix_RotateRPY(0, -0x4000, -0x4000, MTXMODE_APPLY);
Matrix_Get(&sp44);
func_800D20CC(&sp44, &heldActor->posRot.rot, 0);
heldActor->shape.rot = heldActor->posRot.rot;
func_800D20CC(&sp44, &heldActor->world.rot, 0);
heldActor->shape.rot = heldActor->world.rot;
if (func_8002DD78(this) != 0) {
Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
@@ -1322,7 +1321,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
if (this->unk_862 == 0) {
Math_Vec3f_Copy(&heldActor->posRot.pos, &sGetItemRefPos);
Math_Vec3f_Copy(&heldActor->world.pos, &sGetItemRefPos);
}
}
}
@@ -1337,11 +1336,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
Matrix_Get(&this->shieldMf);
}
} else if (limbIndex == PLAYER_LIMB_HEAD) {
Matrix_MultVec3f(&D_801260D4, &this->actor.posRot2.pos);
Matrix_MultVec3f(&D_801260D4, &this->actor.focus.pos);
} else {
Vec3f* vec = &D_801261E0[(0, gSaveContext.linkAge)];
func_8002BDB0(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec);
Actor_SetFeetPos(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec);
}
}
}
+3 -3
View File
@@ -1054,9 +1054,9 @@ void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* da
Vec3f diff;
SkelAnime_UpdateTranslation(entry->skelAnime, &diff, actor->shape.rot.y);
actor->posRot.pos.x += diff.x * actor->scale.x;
actor->posRot.pos.y += diff.y * actor->scale.y * entry->unk_08;
actor->posRot.pos.z += diff.z * actor->scale.z;
actor->world.pos.x += diff.x * actor->scale.x;
actor->world.pos.y += diff.y * actor->scale.y * entry->unk_08;
actor->world.pos.z += diff.z * actor->scale.z;
}
/**
+19 -19
View File
@@ -14,7 +14,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx);
const ActorInit Arms_Hook_InitVars = {
ACTOR_ARMS_HOOK,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_LINK_BOY,
sizeof(ArmsHook),
@@ -72,7 +72,7 @@ void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitQuad(globalCtx, &this->collider);
Collider_SetQuad(globalCtx, &this->collider, &this->actor, &sQuadInit);
ArmsHook_SetupAction(this, ArmsHook_Wait);
this->unk_1E8 = this->actor.posRot.pos;
this->unk_1E8 = this->actor.world.pos;
}
void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -130,7 +130,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
((player->stateFlags1 & 0x4000080))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);
Math_Vec3f_Copy(&this->actor.posRot.pos, &player->unk_3C8);
Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8);
return 1;
}
}
@@ -140,7 +140,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) {
actor->flags |= 0x2000;
this->grabbed = actor;
Math_Vec3f_Diff(&actor->posRot.pos, &this->actor.posRot.pos, &this->grabbedDistDiff);
Math_Vec3f_Diff(&actor->world.pos, &this->actor.world.pos, &this->grabbedDistDiff);
}
void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
@@ -200,10 +200,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
this->grabbed = NULL;
} else {
if (this->actor.child != NULL) {
sp94 = func_8002DB48(this, grabbed);
sp94 = Actor_WorldDistXYZToActor(this, grabbed);
sp90 =
sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos);
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
if (50.0f < (sp94 - sp90)) {
ArmsHook_DetachHookFromActor(this);
grabbed = NULL;
@@ -212,7 +212,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
}
}
bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.posRot.pos, &bodyDistDiffVec);
bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.world.pos, &bodyDistDiffVec);
if (bodyDistDiff < 30.0f) {
velocity = 0.0f;
phi_f16 = 0.0f;
@@ -239,17 +239,17 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (this->actor.child == NULL) {
if ((grabbed != NULL) && (grabbed->id == ACTOR_BG_SPOT06_OBJECTS)) {
Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos);
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
phi_f16 = 1.0f;
} else {
Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.posRot.pos);
Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.world.pos);
if (grabbed != NULL) {
Math_Vec3f_Sum(&this->actor.posRot.pos, &this->grabbedDistDiff, &grabbed->posRot.pos);
Math_Vec3f_Sum(&this->actor.world.pos, &this->grabbedDistDiff, &grabbed->world.pos);
}
}
} else {
Math_Vec3f_Diff(&bodyDistDiffVec, &newPos, &player->actor.velocity);
player->actor.posRot.rot.x =
player->actor.world.rot.x =
Math_Atan2S(sqrtf(SQ(bodyDistDiffVec.x) + SQ(bodyDistDiffVec.z)), -bodyDistDiffVec.y);
}
@@ -258,7 +258,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (phi_f16 == 0.0f) {
ArmsHook_SetupAction(this, ArmsHook_Wait);
if (ArmsHook_AttachToPlayer(this, player)) {
Math_Vec3f_Diff(&this->actor.posRot.pos, &player->actor.posRot.pos, &player->actor.velocity);
Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &player->actor.velocity);
player->actor.velocity.y -= 20.0f;
return;
}
@@ -266,7 +266,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
}
} else {
Actor_MoveForward(&this->actor);
Math_Vec3f_Diff(&this->actor.posRot.pos, &this->actor.pos4, &prevFrameDiff);
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff);
Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8);
this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y);
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
@@ -276,9 +276,9 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78) == false) {
sp5C = COLPOLY_GET_NORMAL(poly->normal.x);
sp58 = COLPOLY_GET_NORMAL(poly->normal.z);
Math_Vec3f_Copy(&this->actor.posRot.pos, &sp78);
this->actor.posRot.pos.x += 10.0f * sp5C;
this->actor.posRot.pos.z += 10.0f * sp58;
Math_Vec3f_Copy(&this->actor.world.pos, &sp78);
this->actor.world.pos.x += 10.0f * sp5C;
this->actor.world.pos.z += 10.0f * sp58;
this->timer = 0;
if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId) != 0) {
if (bgId != BGCHECK_SCENE) {
@@ -292,7 +292,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
&D_801333E0, &D_801333E8);
return;
}
CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.posRot.pos);
CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.world.pos);
Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
return;
@@ -342,8 +342,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_0602B288);
Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW);
Math_Vec3f_Diff(&player->unk_3C8, &this->actor.posRot.pos, &sp78);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Math_Vec3f_Diff(&player->unk_3C8, &this->actor.world.pos, &sp78);
sp58 = SQ(sp78.x) + SQ(sp78.z);
sp5C = sqrtf(sp58);
Matrix_RotateY(Math_FAtan2F(sp78.x, sp78.z), MTXMODE_APPLY);
@@ -24,7 +24,7 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx);
const ActorInit Arrow_Fire_InitVars = {
ACTOR_ARROW_FIRE,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(ArrowFire),
@@ -74,14 +74,14 @@ void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx) {
this->radius += 1;
}
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.world.pos = arrow->actor.world.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_FIRE - SFX_FLAG);
// if arrow has no parent, player has fired the arrow
if (arrow->actor.parent == NULL) {
this->unkPos = this->actor.posRot.pos;
this->unkPos = this->actor.world.pos;
this->radius = 10;
ArrowFire_SetupAction(this, ArrowFire_Fly);
this->alpha = 255;
@@ -157,14 +157,14 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) {
return;
}
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.world.pos = arrow->actor.world.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f);
this->unk_158 = distanceScaled;
if (distanceScaled < 1.0f) {
this->unk_158 = 1.0f;
}
func_80865ECC(&this->unkPos, &this->actor.posRot.pos, 0.05f);
func_80865ECC(&this->unkPos, &this->actor.world.pos, 0.05f);
if (arrow->hitWall & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_FRAME);
@@ -207,7 +207,7 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 618);
Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY);
Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY);
@@ -25,7 +25,7 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx);
const ActorInit Arrow_Ice_InitVars = {
ACTOR_ARROW_ICE,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(ArrowIce),
@@ -75,14 +75,14 @@ void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx) {
this->radius += 1;
}
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.world.pos = arrow->actor.world.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_ICE - SFX_FLAG);
// if arrow has no parent, player has fired the arrow
if (arrow->actor.parent == NULL) {
this->unkPos = this->actor.posRot.pos;
this->unkPos = this->actor.world.pos;
this->radius = 10;
ArrowIce_SetupAction(this, ArrowIce_Fly);
this->alpha = 255;
@@ -158,14 +158,14 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) {
return;
}
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.world.pos = arrow->actor.world.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f);
this->unk_160 = distanceScaled;
if (distanceScaled < 1.0f) {
this->unk_160 = 1.0f;
}
func_80867E8C(&this->unkPos, &this->actor.posRot.pos, 0.05f);
func_80867E8C(&this->unkPos, &this->actor.world.pos, 0.05f);
if (arrow->hitWall & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_ICE);
@@ -208,7 +208,7 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 610);
Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY);
Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY);
@@ -25,7 +25,7 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx);
const ActorInit Arrow_Light_InitVars = {
ACTOR_ARROW_LIGHT,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(ArrowLight),
@@ -75,14 +75,14 @@ void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) {
this->radius += 1;
}
// copy position and rotation from arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.world.pos = arrow->actor.world.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_LIGHT - SFX_FLAG);
// if arrow has no parent, player has fired the arrow
if (arrow->actor.parent == NULL) {
this->unkPos = this->actor.posRot.pos;
this->unkPos = this->actor.world.pos;
this->radius = 10;
ArrowLight_SetupAction(this, ArrowLight_Fly);
this->alpha = 255;
@@ -158,14 +158,14 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) {
return;
}
// copy position and rotation from parent arrow
this->actor.posRot.pos = arrow->actor.posRot.pos;
this->actor.world.pos = arrow->actor.world.pos;
this->actor.shape.rot = arrow->actor.shape.rot;
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f);
distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f);
this->unk_160 = distanceScaled;
if (distanceScaled < 1.0f) {
this->unk_160 = 1.0f;
}
func_80869E6C(&this->unkPos, &this->actor.posRot.pos, 0.05f);
func_80869E6C(&this->unkPos, &this->actor.world.pos, 0.05f);
if (arrow->hitWall & 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_LIGHT);
@@ -208,7 +208,7 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_light.c", 598);
Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY);
Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY);
@@ -34,7 +34,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx);
const ActorInit Bg_Bdan_Objects_InitVars = {
ACTOR_BG_BDAN_OBJECTS,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_BDAN_OBJECTS,
sizeof(BgBdanObjects),
@@ -121,7 +121,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->params &= 0xFF;
if (thisx->params == 2) {
thisx->flags |= 0x30;
globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = thisx->posRot.pos.y;
globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = thisx->world.pos.y;
this->actionFunc = func_8086C9A8;
return;
}
@@ -129,20 +129,20 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&D_06008CE0, &colHeader);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, this, &sCylinderInit);
thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f);
thisx->world.pos.y = (f32)(thisx->world.pos.y + -79.0f);
if (Flags_GetClear(globalCtx, thisx->room)) {
Flags_SetSwitch(globalCtx, this->unk_168);
this->actionFunc = func_8086C6EC;
} else {
if (BgBdanObjects_GetContactRu1(this, 4)) {
if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA,
thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, 0,
thisx->shape.rot.y + 0x8000, 0, 3) != NULL) {
thisx->child->posRot.pos.z = thisx->child->initPosRot.pos.z + 263.0f;
if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA, thisx->home.pos.x,
thisx->home.pos.y, thisx->home.pos.z, 0, thisx->shape.rot.y + 0x8000, 0,
3) != NULL) {
thisx->child->world.pos.z = thisx->child->home.pos.z + 263.0f;
}
thisx->posRot.rot.y = 0;
thisx->world.rot.y = 0;
this->actionFunc = func_8086C618;
thisx->posRot.pos.y = thisx->initPosRot.pos.y + -70.0f;
thisx->world.pos.y = thisx->home.pos.y + -70.0f;
} else {
Flags_SetSwitch(globalCtx, this->unk_168);
this->unk_16A = 0;
@@ -159,7 +159,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&D_06005580, &colHeader);
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
this->actionFunc = BgBdanObjects_DoNothing;
thisx->posRot.pos.y = thisx->initPosRot.pos.y - 400.0f;
thisx->world.pos.y = thisx->home.pos.y - 400.0f;
} else {
this->actionFunc = func_8086CB10;
}
@@ -181,13 +181,13 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (BgBdanObjects_GetContactRu1(this, 0)) {
if (this->dyna.actor.xzDistToLink < 250.0f) {
if (this->dyna.actor.xzDistToPlayer < 250.0f) {
BgBdanObjects_SetContactRu1(this, 1);
this->unk_16A = 0x14;
func_800800F8(globalCtx, 0xBFE, -0x63, &this->dyna.actor, 0);
player->actor.posRot.pos.x = -1130.0f;
player->actor.posRot.pos.y = -1025.0f;
player->actor.posRot.pos.z = -3300.0f;
player->actor.world.pos.x = -1130.0f;
player->actor.world.pos.y = -1025.0f;
player->actor.world.pos.z = -3300.0f;
func_800AA000(0.0f, 0xFF, 0x14, 0x96);
}
} else {
@@ -202,15 +202,15 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) {
}
if (!Gameplay_InCsMode(globalCtx) && !BgBdanObjects_GetContactRu1(this, 0)) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -79.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -79.0f;
} else {
this->dyna.actor.posRot.pos.y = (this->dyna.actor.initPosRot.pos.y + -79.0f) - 5.0f;
this->dyna.actor.world.pos.y = (this->dyna.actor.home.pos.y + -79.0f) - 5.0f;
}
}
void func_8086C1A0(BgBdanObjects* this, GlobalContext* globalCtx) {
if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 500.0f, 0.5f, 7.5f,
1.0f) < 0.1f) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 500.0f, 0.5f, 7.5f, 1.0f) <
0.1f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
this->actionFunc = func_8086C29C;
this->unk_16A = 0x1E;
@@ -243,8 +243,8 @@ void func_8086C29C(BgBdanObjects* this, GlobalContext* globalCtx) {
if (BgBdanObjects_GetContactRu1(this, 3)) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_BIGOKUTA,
this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 140.0f,
this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0);
this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 140.0f,
this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0);
BgBdanObjects_SetContactRu1(this, 4);
this->unk_16A = 0xA;
this->actionFunc = func_8086C55C;
@@ -256,19 +256,19 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
this->dyna.actor.velocity.y += 0.5f;
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -70.0f,
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -70.0f,
this->dyna.actor.velocity.y)) {
this->dyna.actor.posRot.rot.y = 0;
this->dyna.actor.world.rot.y = 0;
this->unk_16A = 0x3C;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U);
this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f;
this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f;
this->actionFunc = func_8086C5BC;
func_800800F8(globalCtx, 0xC08, -0x63, this->dyna.actor.child, 0);
player->actor.posRot.pos.x = -1130.0f;
player->actor.posRot.pos.y = -1025.0f;
player->actor.posRot.pos.z = -3500.0f;
player->actor.world.pos.x = -1130.0f;
player->actor.world.pos.y = -1025.0f;
player->actor.world.pos.z = -3500.0f;
player->actor.shape.rot.y = 0x7530;
player->actor.posRot.rot.y = player->actor.shape.rot.y;
player->actor.world.rot.y = player->actor.shape.rot.y;
func_800AA000(0.0f, 0xFF, 0x1E, 0x96);
} else {
func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG);
@@ -280,7 +280,7 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) {
this->unk_16A = 0xB;
}
if (this->dyna.actor.child != NULL) {
this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f;
this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f;
}
}
}
@@ -316,18 +316,18 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (Flags_GetClear(globalCtx, this->dyna.actor.room)) {
Flags_SetSwitch(globalCtx, this->unk_168);
this->dyna.actor.initPosRot.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000;
this->dyna.actor.home.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000;
this->actionFunc = func_8086C6EC;
} else {
this->dyna.actor.shape.rot.y += this->dyna.actor.posRot.rot.y;
func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.posRot.rot.y) / 512.0f);
this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y;
func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.world.rot.y) / 512.0f);
}
}
void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) {
s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.initPosRot.rot.y, 0x200);
s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x200);
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -125.0f, 3.0f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -125.0f, 3.0f)) {
if (cond) {
this->actionFunc = func_8086C76C;
}
@@ -336,7 +336,7 @@ void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) {
void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) {
if (func_8004356C(&this->dyna.actor)) {
if (this->dyna.actor.xzDistToLink < 120.0f) {
if (this->dyna.actor.xzDistToPlayer < 120.0f) {
this->actionFunc = func_8086C7D0;
func_800800F8(globalCtx, 0xC12, -0x63, &this->dyna.actor, 0);
}
@@ -344,8 +344,8 @@ void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) {
}
void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx) {
if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 965.0f, 0.5f, 15.0f,
0.2f) < 0.01f) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) <
0.01f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A);
this->actionFunc = BgBdanObjects_DoNothing;
} else {
@@ -381,8 +381,8 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) {
func_8005ACFC(globalCtx->cameraPtrs[0], 4);
}
}
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y -
(sinf((f32)this->unk_16A * (M_PI / 256.0f)) * 471.239990234375f); // pi * 150
this->dyna.actor.world.pos.y =
this->dyna.actor.home.pos.y - (sinf((f32)this->unk_16A * (M_PI / 256.0f)) * 471.239990234375f); // pi * 150
if (this->unk_16A == 0) {
this->unk_16A = 0x200;
}
@@ -397,18 +397,18 @@ void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx) {
void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx) {
if (this->unk_16A == 0) {
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 0.5f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.5f)) {
Flags_UnsetSwitch(globalCtx, this->unk_168);
this->actionFunc = func_8086C9A8;
}
func_8002F948(this, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
} else {
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 75.0f, 0.5f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 75.0f, 0.5f)) {
this->actionFunc = func_8086CABC;
}
func_8002F948(this, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
}
globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.posRot.pos.y;
globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.world.pos.y;
}
void func_8086CABC(BgBdanObjects* this, GlobalContext* globalCtx) {
@@ -426,7 +426,7 @@ void func_8086CB10(BgBdanObjects* this, GlobalContext* globalCtx) {
Flags_SetSwitch(globalCtx, this->unk_168);
this->unk_16A = 0x32;
this->actionFunc = func_8086CB8C;
this->dyna.actor.initPosRot.pos.y -= 200.0f;
this->dyna.actor.home.pos.y -= 200.0f;
func_800800F8(globalCtx, 0xC1C, 0x33, &this->dyna.actor, 0);
}
}
@@ -435,7 +435,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) {
if (this->unk_16A != 0) {
this->unk_16A -= 1;
}
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f);
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f);
if (this->unk_16A == 0) {
Audio_PlayActorSound2(this, NA_SE_EV_BUYOSTAND_STOP_U);
this->actionFunc = BgBdanObjects_DoNothing;
@@ -448,7 +448,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) {
void BgBdanObjects_Update(Actor* thisx, GlobalContext* globalCtx) {
BgBdanObjects* this = THIS;
Actor_SetHeight(thisx, 50.0f);
Actor_SetFocus(thisx, 50.0f);
this->actionFunc(this, globalCtx);
}
@@ -457,7 +457,7 @@ void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params == 0) {
if (this->actionFunc == func_8086C054) {
if (((thisx->initPosRot.pos.y + -79.0f) - 5.0f) < thisx->posRot.pos.y) {
if (((thisx->home.pos.y + -79.0f) - 5.0f) < thisx->world.pos.y) {
Matrix_Translate(0.0f, -50.0f, 0.0f, MTXMODE_APPLY);
}
}
@@ -45,7 +45,7 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx);
const ActorInit Bg_Bdan_Switch_InitVars = {
ACTOR_BG_BDAN_SWITCH,
ACTORTYPE_SWITCH,
ACTORCAT_SWITCH,
FLAGS,
OBJECT_BDAN_OBJECTS,
sizeof(BgBdanSwitch),
@@ -135,7 +135,7 @@ void func_8086D0EC(BgBdanSwitch* this) {
this->unk_1D0 = ((Math_CosS(this->unk_1CC) * 0.5f) + 20.5f) * (this->unk_1C8 * 0.0050000004f);
this->dyna.actor.scale.y = this->unk_1C8 * 0.1f;
}
this->dyna.actor.shape.unk_08 = 1.2f / this->unk_1D0;
this->dyna.actor.shape.yOffset = 1.2f / this->unk_1D0;
}
void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -154,7 +154,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.scale.x = 0.1f;
}
this->dyna.actor.scale.y = 0.0f;
Actor_SetHeight(&this->dyna.actor, 10.0f);
Actor_SetFocus(&this->dyna.actor, 10.0f);
switch (type) {
case BLUE:
@@ -166,7 +166,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
case YELLOW_TALL_2:
func_8086D098(this, globalCtx);
this->dyna.actor.flags |= 1;
this->dyna.actor.unk_1F = 4;
this->dyna.actor.targetMode = 4;
}
flag = Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F);
@@ -270,12 +270,12 @@ void func_8086D67C(BgBdanSwitch* this) {
}
void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) {
if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) {
this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.1f) {
func_8086D730(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
}
}
}
@@ -337,7 +337,7 @@ void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) {
if (this->unk_1C8 <= 0.6f) {
func_8086D9F8(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
}
}
@@ -347,12 +347,12 @@ void func_8086D944(BgBdanSwitch* this) {
}
void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) {
if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) {
this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.1f) {
func_8086DB24(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
}
}
}
@@ -433,7 +433,7 @@ void func_8086DC30(BgBdanSwitch* this) {
}
void func_8086DC48(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) {
if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) {
this->unk_1C8 -= 0.3f;
if (this->unk_1C8 <= 1.0f) {
func_8086DCCC(this);
@@ -469,7 +469,7 @@ void func_8086DDA8(BgBdanSwitch* this) {
}
void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.type)) ||
if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) ||
(this->unk_1DA <= 0)) {
this->unk_1C8 += 0.3f;
if (this->unk_1C8 >= 2.0f) {
@@ -505,9 +505,9 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) {
func_800D1694(this->dyna.actor.posRot.pos.x,
this->dyna.actor.posRot.pos.y + (this->dyna.actor.shape.unk_08 * this->unk_1D0),
this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot);
func_800D1694(this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y + (this->dyna.actor.shape.yOffset * this->unk_1D0),
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY);
Gfx_DrawDListOpa(globalCtx, dlist);
}
@@ -524,7 +524,7 @@ void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) {
case YELLOW_TALL_2:
func_8086DF58(this, globalCtx, D_060061A0);
Collider_UpdateSpheres(0, &this->collider);
Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.posRot2.pos);
Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.focus.pos);
break;
case BLUE:
func_8086DF58(this, globalCtx, D_06005A20);
@@ -20,7 +20,7 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx);
const ActorInit Bg_Bom_Guard_InitVars = {
ACTOR_BG_BOM_GUARD,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_BOWL,
sizeof(BgBomGuard),
@@ -51,7 +51,7 @@ void BgBomGuard_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->scale.x = 1.0f;
thisx->scale.y = 1.0f;
thisx->scale.z = 1.0f;
this->unk_16C = thisx->posRot.pos;
this->unk_16C = thisx->world.pos;
BgBomGuard_SetupAction(this, func_8086E638);
}
@@ -62,7 +62,7 @@ void BgBomGuard_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) {
Actor* it = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first;
Actor* it = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head;
Actor* thisx = &this->dyna.actor;
this->unk_168 = 0;
@@ -79,9 +79,9 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) {
}
if (this->unk_168 == 0) {
thisx->posRot.pos.y = sREG(64) + -200.0f;
thisx->world.pos.y = sREG(64) + -200.0f;
} else {
thisx->posRot.pos.y = 0.0f;
thisx->world.pos.y = 0.0f;
}
}
@@ -76,7 +76,7 @@ static ColliderTrisInit sTrisInit = {
const ActorInit Bg_Bombwall_InitVars = {
ACTOR_BG_BOMBWALL,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_GAMEPLAY_FIELD_KEEP,
sizeof(BgBombwall),
@@ -143,9 +143,9 @@ void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx) {
BgBombwall_RotateVec(&vecs[j], &sp80, sin, cos);
vecs[j].x += this->dyna.actor.posRot.pos.x;
vecs[j].y += this->dyna.actor.posRot.pos.y;
vecs[j].z += this->dyna.actor.posRot.pos.z;
vecs[j].x += this->dyna.actor.world.pos.x;
vecs[j].y += this->dyna.actor.world.pos.y;
vecs[j].z += this->dyna.actor.world.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]);
}
@@ -187,7 +187,7 @@ void func_8086EB5C(BgBombwall* this, GlobalContext* globalCtx) {
s32 i;
f32 sin = Math_SinS(this->dyna.actor.shape.rot.y);
f32 cos = Math_CosS(this->dyna.actor.shape.rot.y);
Vec3f* pos = &this->dyna.actor.posRot.pos;
Vec3f* pos = &this->dyna.actor.world.pos;
f32 temp;
f32 new_var;
@@ -219,7 +219,7 @@ void func_8086ED70(BgBombwall* this, GlobalContext* globalCtx) {
this->collider.base.acFlags &= ~AC_HIT;
func_8086EDFC(this, globalCtx);
Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F);
} else if (this->dyna.actor.xzDistToLink < 600.0f) {
} else if (this->dyna.actor.xzDistToPlayer < 600.0f) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -31,7 +31,7 @@ extern Gfx D_06001390[];
const ActorInit Bg_Bowl_Wall_InitVars = {
ACTOR_BG_BOWL_WALL,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_BOWL,
sizeof(BgBowlWall),
@@ -65,7 +65,7 @@ void BgBowlWall_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->initPos = this->dyna.actor.posRot.pos;
this->initPos = this->dyna.actor.world.pos;
osSyncPrintf("\n\n");
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ ボーリングおじゃま壁発生 ☆☆☆☆☆ %d\n" VT_RST, this->dyna.actor.params);
this->actionFunc = BgBowlWall_SpawnBullseyes;
@@ -87,12 +87,12 @@ void BgBowlWall_SpawnBullseyes(BgBowlWall* this, GlobalContext* globalCtx) {
type = this->dyna.actor.params;
if (type != 0) {
type += (s16)Rand_ZeroFloat(2.99f);
this->dyna.actor.shape.rot.z = this->dyna.actor.posRot.rot.z = sTargetRot[type];
this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z = sTargetRot[type];
osSyncPrintf("\n\n");
}
this->bullseyeCenter.x = sBullseyeOffset[type].x + this->dyna.actor.posRot.pos.x;
this->bullseyeCenter.y = sBullseyeOffset[type].y + this->dyna.actor.posRot.pos.y;
this->bullseyeCenter.z = sBullseyeOffset[type].z + this->dyna.actor.posRot.pos.z;
this->bullseyeCenter.x = sBullseyeOffset[type].x + this->dyna.actor.world.pos.x;
this->bullseyeCenter.y = sBullseyeOffset[type].y + this->dyna.actor.world.pos.y;
this->bullseyeCenter.z = sBullseyeOffset[type].z + this->dyna.actor.world.pos.z;
if (1) {}
bullseye = (EnWallTubo*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_WALL_TUBO,
this->bullseyeCenter.x, this->bullseyeCenter.y, this->bullseyeCenter.z,
@@ -100,10 +100,10 @@ void BgBowlWall_SpawnBullseyes(BgBowlWall* this, GlobalContext* globalCtx) {
if (bullseye != NULL) {
bullseye->explosionCenter = this->bullseyeCenter;
if (type != 0) {
bullseye->explosionCenter = this->bullseyeCenter = this->dyna.actor.posRot.pos;
bullseye->explosionCenter = this->bullseyeCenter = this->dyna.actor.world.pos;
}
if (this->chuGirl == NULL) {
lookForGirl = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first;
lookForGirl = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head;
while (lookForGirl != NULL) {
if (lookForGirl->id != ACTOR_EN_BOM_BOWL_MAN) {
lookForGirl = lookForGirl->next;
@@ -136,13 +136,13 @@ void BgBowlWall_FallDoEffects(BgBowlWall* this, GlobalContext* globalCtx) {
if (this->dyna.actor.params == 0) { // wall collapses backwards
Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, -0x3E80, 3, 500, 0);
this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x;
this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x;
if (this->dyna.actor.shape.rot.x < -0x3C1E) {
wallFallen = true;
}
} else { // wall slides downwards
Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f);
if (this->dyna.actor.posRot.pos.y < (this->initPos.y - 400.0f)) {
Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f);
if (this->dyna.actor.world.pos.y < (this->initPos.y - 400.0f)) {
wallFallen = true;
}
}
@@ -171,11 +171,11 @@ void BgBowlWall_FinishFall(BgBowlWall* this, GlobalContext* globalCtx) {
if (this->dyna.actor.params == 0) {
Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, -0x3E80, 1, 200, 0);
} else {
Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f);
Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f);
}
} else if (this->timer == 1) {
this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x = 0;
this->dyna.actor.posRot.pos.y = this->initPos.y - 450.0f;
this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0;
this->dyna.actor.world.pos.y = this->initPos.y - 450.0f;
this->chuGirl->wallStatus[this->dyna.actor.params] = 2;
this->actionFunc = BgBowlWall_Reset;
}
@@ -183,9 +183,9 @@ void BgBowlWall_FinishFall(BgBowlWall* this, GlobalContext* globalCtx) {
void BgBowlWall_Reset(BgBowlWall* this, GlobalContext* globalCtx) {
if (this->chuGirl->wallStatus[this->dyna.actor.params] != 2) {
Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y, 0.3f, 50.0f);
if (fabsf(this->dyna.actor.posRot.pos.y - this->initPos.y) <= 10.0f) {
this->dyna.actor.posRot.pos.y = this->initPos.y;
Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y, 0.3f, 50.0f);
if (fabsf(this->dyna.actor.world.pos.y - this->initPos.y) <= 10.0f) {
this->dyna.actor.world.pos.y = this->initPos.y;
this->isHit = false;
this->actionFunc = BgBowlWall_SpawnBullseyes;
}
@@ -24,7 +24,7 @@ extern UNK_TYPE D_02014F80;
/*
const ActorInit Bg_Breakwall_InitVars = {
ACTOR_BG_BREAKWALL,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgBreakwall),
@@ -23,7 +23,7 @@ extern CollisionHeader D_06003CE0;
const ActorInit Bg_Ddan_Jd_InitVars = {
ACTOR_BG_DDAN_JD,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_DDAN_OBJECTS,
sizeof(BgDdanJd),
@@ -94,35 +94,35 @@ void BgDdanJd_Idle(BgDdanJd* this, GlobalContext* globalCtx) {
this->ySpeed = SHORTCUT_Y_SPEED;
this->state = STATE_GO_MIDDLE_FROM_BOTTOM;
this->idleTimer = 0;
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE;
func_800800F8(globalCtx, 0xBF4, -0x63, &this->dyna.actor, 0);
}
if (this->idleTimer == 0) {
this->idleTimer = IDLE_FRAMES;
if (this->state == STATE_GO_BOTTOM) {
this->state = STATE_GO_MIDDLE_FROM_BOTTOM;
this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE;
this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE;
} else if (this->state == STATE_GO_MIDDLE_FROM_BOTTOM) {
// If the platform has been activated as a shortcut
if (this->ySpeed != DEFAULT_Y_SPEED) {
this->state = STATE_GO_TOP;
this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_TOP;
this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_TOP;
} else {
this->state = STATE_GO_BOTTOM;
this->targetY = this->dyna.actor.initPosRot.pos.y;
this->targetY = this->dyna.actor.home.pos.y;
}
} else if (this->state == STATE_GO_MIDDLE_FROM_TOP) {
// If the platform has been activated as a shortcut
if (this->ySpeed != DEFAULT_Y_SPEED) {
this->state = STATE_GO_TOP;
this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_TOP;
this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_TOP;
} else {
this->state = STATE_GO_BOTTOM;
this->targetY = this->dyna.actor.initPosRot.pos.y;
this->targetY = this->dyna.actor.home.pos.y;
}
} else if (this->state == STATE_GO_TOP) {
this->state = STATE_GO_MIDDLE_FROM_TOP;
this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE;
this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE;
}
this->actionFunc = BgDdanJd_Move;
}
@@ -133,20 +133,20 @@ void BgDdanJd_MoveEffects(BgDdanJd* this, GlobalContext* globalCtx) {
Vec3f dustPos;
// Generate random dust particles at the platform's base.
dustPos.y = this->dyna.actor.initPosRot.pos.y;
dustPos.y = this->dyna.actor.home.pos.y;
if (globalCtx->gameplayFrames & 1) {
dustPos.x = this->dyna.actor.posRot.pos.x + 65.0f;
dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.z;
dustPos.x = this->dyna.actor.world.pos.x + 65.0f;
dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.z;
func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1);
dustPos.x = this->dyna.actor.posRot.pos.x - 65.0f;
dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.z;
dustPos.x = this->dyna.actor.world.pos.x - 65.0f;
dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.z;
func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1);
} else {
dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.x;
dustPos.z = this->dyna.actor.posRot.pos.z + 65.0f;
dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.x;
dustPos.z = this->dyna.actor.world.pos.z + 65.0f;
func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1);
dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.x;
dustPos.z = this->dyna.actor.posRot.pos.z - 65.0f;
dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.x;
dustPos.z = this->dyna.actor.world.pos.z - 65.0f;
func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1);
}
if (this->ySpeed == SHORTCUT_Y_SPEED) {
@@ -161,11 +161,11 @@ void BgDdanJd_Move(BgDdanJd* this, GlobalContext* globalCtx) {
Flags_GetSwitch(globalCtx, this->dyna.actor.params)) {
this->ySpeed = SHORTCUT_Y_SPEED;
this->state = STATE_GO_MIDDLE_FROM_BOTTOM;
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE;
this->idleTimer = 0;
this->actionFunc = BgDdanJd_Idle;
func_800800F8(globalCtx, 0xBF4, -0x63, &this->dyna.actor, 0);
} else if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->targetY, this->ySpeed)) {
} else if (Math_StepToF(&this->dyna.actor.world.pos.y, this->targetY, this->ySpeed)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_PILLAR_MOVE_STOP);
this->actionFunc = BgDdanJd_Idle;
}
@@ -21,7 +21,7 @@ void func_80871838(BgDdanKd* this, GlobalContext* globalCtx);
const ActorInit Bg_Ddan_Kd_InitVars = {
ACTOR_BG_DDAN_KD,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_DDAN_OBJECTS,
sizeof(BgDdanKd),
@@ -87,7 +87,7 @@ void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params) == 0) {
BgDdanKd_SetupAction(this, BgDdanKd_CheckForExplosions);
} else {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 200.0f - 20.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 200.0f - 20.0f;
BgDdanKd_SetupAction(this, func_80871838);
}
}
@@ -108,7 +108,7 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) {
explosive->params = 2;
}
if ((explosive != NULL) && (this->prevExplosive != NULL) && (explosive != this->prevExplosive) &&
(Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->posRot.pos) > 80.0f)) {
(Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->world.pos) > 80.0f)) {
BgDdanKd_SetupAction(this, BgDdanKd_LowerStairs);
func_800800F8(globalCtx, 0xBEA, 0x3E7, this, 0);
} else {
@@ -118,7 +118,7 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) {
this->prevExplosive = explosive;
if (explosive != NULL) {
this->timer = 13;
this->prevExplosivePos = explosive->posRot.pos;
this->prevExplosivePos = explosive->world.pos;
}
}
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
@@ -134,15 +134,15 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f);
func_800AA000(500.0f, 0x78, 0x14, 0xA);
if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, (this->dyna.actor.initPosRot.pos.y - 200.0f) - 20.0f, 0.075f,
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, (this->dyna.actor.home.pos.y - 200.0f) - 20.0f, 0.075f,
this->dyna.actor.speedXZ, 0.0075f) == 0.0f) {
Flags_SetSwitch(globalCtx, this->dyna.actor.params);
BgDdanKd_SetupAction(this, func_80871838);
} else {
sp4C = (this->dyna.actor.pos4.y - this->dyna.actor.posRot.pos.y) + (this->dyna.actor.speedXZ * 0.25f);
sp4C = (this->dyna.actor.prevPos.y - this->dyna.actor.world.pos.y) + (this->dyna.actor.speedXZ * 0.25f);
if (globalCtx->state.frames & 1) {
sp5C = sp50 = this->dyna.actor.posRot.pos;
sp5C = sp50 = this->dyna.actor.world.pos;
if (globalCtx->state.frames & 2) {
sp5C.z += 210.0f + Rand_ZeroOne() * 230.0f;
@@ -153,8 +153,8 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) {
}
sp5C.x += 80.0f + Rand_ZeroOne() * 10.0f;
sp50.x -= 80.0f + Rand_ZeroOne() * 10.0f;
sp5C.y = this->dyna.actor.groundY + 20.0f + Rand_ZeroOne();
sp50.y = this->dyna.actor.groundY + 20.0f + Rand_ZeroOne();
sp5C.y = this->dyna.actor.floorHeight + 20.0f + Rand_ZeroOne();
sp50.y = this->dyna.actor.floorHeight + 20.0f + Rand_ZeroOne();
func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1);
func_80033480(globalCtx, &sp50, 20.0f, 1, sp4C * 135.0f, 60, 1);
@@ -165,10 +165,10 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) {
func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908);
func_8003555C(globalCtx, &sp50, &D_808718FC, &D_80871908);
sp5C = this->dyna.actor.posRot.pos;
sp5C = this->dyna.actor.world.pos;
sp5C.z += 560.0f + Rand_ZeroOne() * 5.0f;
sp5C.x += (Rand_ZeroOne() - 0.5f) * 160.0f;
sp5C.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.groundY + 20.0f);
sp5C.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.floorHeight + 20.0f);
func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1);
func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908);
@@ -23,7 +23,7 @@ void func_80872288(BgDodoago* this, GlobalContext* globalCtx);
const ActorInit Bg_Dodoago_InitVars = {
ACTOR_BG_DODOAGO,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_DDAN_OBJECTS,
sizeof(BgDodoago),
@@ -151,8 +151,8 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) {
if (explosive != NULL) {
this->unk_164 =
(Math_Vec3f_Yaw(&this->dyna.actor.posRot.pos, &explosive->posRot.pos) >= this->dyna.actor.shape.rot.y) ? 1
: 0;
(Math_Vec3f_Yaw(&this->dyna.actor.world.pos, &explosive->world.pos) >= this->dyna.actor.shape.rot.y) ? 1
: 0;
if (((globalCtx->unk_11D30[0] == 0xFF) && (this->unk_164 == 1)) ||
((globalCtx->unk_11D30[1] == 0xFF) && (this->unk_164 == 0))) {
@@ -220,22 +220,22 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) {
if (D_80872824 == 0x6C) {
for (i = 10; i >= 0; i--) {
currentPos.x = D_808725CC[i].x + this->dyna.actor.posRot.pos.x;
currentPos.y = D_808725CC[i].y + this->dyna.actor.posRot.pos.y;
currentPos.z = D_808725CC[i].z + this->dyna.actor.posRot.pos.z;
currentPos.x = D_808725CC[i].x + this->dyna.actor.world.pos.x;
currentPos.y = D_808725CC[i].y + this->dyna.actor.world.pos.y;
currentPos.z = D_808725CC[i].z + this->dyna.actor.world.pos.z;
func_80033480(globalCtx, &currentPos, 2.0f, 3, 0xC8, 0x4B, 1);
}
}
currentPos.x = this->dyna.actor.posRot.pos.x + 200.0f;
currentPos.y = this->dyna.actor.posRot.pos.y - 20.0f;
currentPos.z = this->dyna.actor.posRot.pos.z + 100.0f;
currentPos.x = this->dyna.actor.world.pos.x + 200.0f;
currentPos.y = this->dyna.actor.world.pos.y - 20.0f;
currentPos.z = this->dyna.actor.world.pos.z + 100.0f;
BgDodoago_SpawnSparkles(&currentPos, globalCtx);
currentPos.x = this->dyna.actor.posRot.pos.x - 200.0f;
currentPos.y = this->dyna.actor.posRot.pos.y - 20.0f;
currentPos.z = this->dyna.actor.posRot.pos.z + 100.0f;
currentPos.x = this->dyna.actor.world.pos.x - 200.0f;
currentPos.y = this->dyna.actor.world.pos.y - 20.0f;
currentPos.z = this->dyna.actor.world.pos.z + 100.0f;
BgDodoago_SpawnSparkles(&currentPos, globalCtx);
Math_StepToS(&this->unk_164, 0x64, 3);
@@ -276,7 +276,8 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->colliders[1].base.ocFlags1 &= ~OC1_HIT;
this->colliders[2].base.ocFlags1 &= ~OC1_HIT;
if (bomb->actor.type == ACTORTYPE_EXPLOSIVES && bomb->actor.id == ACTOR_EN_BOM && bomb->actor.params == 0) {
if (bomb->actor.category == ACTORCAT_EXPLOSIVE && bomb->actor.id == ACTOR_EN_BOM &&
bomb->actor.params == 0) {
this->dyna.actor.parent = &bomb->actor;
bomb->timer = 50;
bomb->actor.speedXZ = 0.0f;
@@ -62,7 +62,7 @@ extern UNK_TYPE D_0601D514;
/*
const ActorInit Bg_Dy_Yoseizo_InitVars = {
ACTOR_BG_DY_YOSEIZO,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_DY_OBJ,
sizeof(BgDyYoseizo),
@@ -29,7 +29,7 @@ void BgGanonOtyuka_DoNothing(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Ganon_Otyuka_InitVars = {
ACTOR_BG_GANON_OTYUKA,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GANON,
sizeof(BgGanonOtyuka),
@@ -135,11 +135,11 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) {
Vec3f center;
s16 i;
if (this->isFalling || ((globalCtx->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToLinkSq < 4900.0f))) {
if (this->isFalling || ((globalCtx->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToPlayerSq < 4900.0f))) {
osSyncPrintf("OTC O 1\n");
for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) {
prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head;
while (prop != NULL) {
if ((prop == thisx) || (prop->id != ACTOR_BG_GANON_OTYUKA)) {
prop = prop->next;
@@ -148,9 +148,9 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) {
platform = (BgGanonOtyuka*)prop;
dx = platform->dyna.actor.posRot.pos.x - this->dyna.actor.posRot.pos.x + D_80876A68[i].x;
dy = platform->dyna.actor.posRot.pos.y - this->dyna.actor.posRot.pos.y;
dz = platform->dyna.actor.posRot.pos.z - this->dyna.actor.posRot.pos.z + D_80876A68[i].z;
dx = platform->dyna.actor.world.pos.x - this->dyna.actor.world.pos.x + D_80876A68[i].x;
dy = platform->dyna.actor.world.pos.y - this->dyna.actor.world.pos.y;
dz = platform->dyna.actor.world.pos.z - this->dyna.actor.world.pos.z + D_80876A68[i].z;
if ((fabsf(dx) < 10.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 10.0f)) {
platform->visibleSides |= sSides[i];
@@ -164,9 +164,9 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) {
osSyncPrintf("OTC O 2\n");
for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) {
center.x = this->dyna.actor.posRot.pos.x + D_80876A68[i].x;
center.y = this->dyna.actor.posRot.pos.y;
center.z = this->dyna.actor.posRot.pos.z + D_80876A68[i].z;
center.x = this->dyna.actor.world.pos.x + D_80876A68[i].x;
center.y = this->dyna.actor.world.pos.y;
center.z = this->dyna.actor.world.pos.z + D_80876A68[i].z;
if (BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &center, 50.0f)) {
this->unwalledSides |= sSides[i];
}
@@ -214,7 +214,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) {
}
if (this->dropTimer == 0) {
this->flashYScale = 0.0f;
Math_ApproachF(&this->dyna.actor.posRot.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ);
Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ);
Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 2.0f);
if (!(this->unwalledSides & OTYUKA_SIDE_EAST)) {
this->dyna.actor.shape.rot.z -= (s16)(this->dyna.actor.speedXZ * 30.0f);
@@ -228,22 +228,22 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) {
if (!(this->unwalledSides & OTYUKA_SIDE_NORTH)) {
this->dyna.actor.shape.rot.x -= (s16)(this->dyna.actor.speedXZ * 30.0f);
}
if (this->dyna.actor.posRot.pos.y < -750.0f) {
if (player->actor.posRot.pos.y < -400.0f) {
if (this->dyna.actor.world.pos.y < -750.0f) {
if (player->actor.world.pos.y < -400.0f) {
accel.x = accel.z = 0.0f;
accel.y = 0.1f;
velocity.x = velocity.y = velocity.z = 0.0f;
for (i = 0; i < 30; i++) {
pos.x = Rand_CenteredFloat(150.0f) + this->dyna.actor.posRot.pos.x;
pos.x = Rand_CenteredFloat(150.0f) + this->dyna.actor.world.pos.x;
pos.y = Rand_ZeroFloat(60.0f) + -750.0f;
pos.z = Rand_CenteredFloat(150.0f) + this->dyna.actor.posRot.pos.z;
pos.z = Rand_CenteredFloat(150.0f) + this->dyna.actor.world.pos.z;
func_8002836C(globalCtx, &pos, &velocity, &accel, &sDustPrimColor, &sDustEnvColor,
(s16)Rand_ZeroFloat(100.0f) + 250, 5, (s16)Rand_ZeroFloat(5.0f) + 15);
}
func_80033DB8(globalCtx, 10, 15);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 0x28, NA_SE_EV_BOX_BREAK);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 0x28, NA_SE_EV_BOX_BREAK);
}
Actor_Kill(&this->dyna.actor);
}
@@ -255,7 +255,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) {
Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
}
Math_ApproachF(&this->dyna.actor.posRot.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ);
Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ);
Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 0.1f);
}
osSyncPrintf("MODE DOWN END\n");
@@ -287,7 +287,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 702);
actor = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first;
actor = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head;
while (actor != NULL) {
if (actor->id == ACTOR_BOSS_GANON) {
ganondorf = (BossGanon*)actor;
@@ -307,24 +307,24 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D18(globalCtx->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, sPlatformSetupDList);
actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head;
while (actor != NULL) {
if (actor->id == ACTOR_BG_GANON_OTYUKA) {
platform = (BgGanonOtyuka*)actor;
if (platform->dyna.actor.projectedPos.z > spBC) {
if (camera->eye.y > platform->dyna.actor.posRot.pos.y) {
if (camera->eye.y > platform->dyna.actor.world.pos.y) {
phi_s2 = sPlatformTopDList;
} else {
phi_s2 = sPlatformBottomDList;
}
Matrix_Translate(platform->dyna.actor.posRot.pos.x, platform->dyna.actor.posRot.pos.y,
platform->dyna.actor.posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(platform->dyna.actor.world.pos.x, platform->dyna.actor.world.pos.y,
platform->dyna.actor.world.pos.z, MTXMODE_NEW);
phi_s1 = NULL;
if (platform->isFalling) {
Matrix_RotateX((platform->dyna.actor.shape.rot.x / (f32)0x8000) * M_PI, MTXMODE_APPLY);
Matrix_RotateZ((platform->dyna.actor.shape.rot.z / (f32)0x8000) * M_PI, MTXMODE_APPLY);
if (camera->eye.y > platform->dyna.actor.posRot.pos.y) {
if (camera->eye.y > platform->dyna.actor.world.pos.y) {
phi_s1 = sPlatformBottomDList;
} else {
phi_s1 = sPlatformTopDList;
@@ -357,7 +357,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
func_80093D84(globalCtx->state.gfxCtx);
actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head;
while (actor != NULL) {
if (actor->id == ACTOR_BG_GANON_OTYUKA) {
platform = (BgGanonOtyuka*)actor;
@@ -371,8 +371,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
platform->flashPrimColorB, 0);
gDPSetEnvColor(POLY_XLU_DISP++, platform->flashEnvColorR, platform->flashEnvColorG,
platform->flashEnvColorB, 128);
Matrix_Translate(platform->dyna.actor.posRot.pos.x, 0.0f, platform->dyna.actor.posRot.pos.z,
MTXMODE_NEW);
Matrix_Translate(platform->dyna.actor.world.pos.x, 0.0f, platform->dyna.actor.world.pos.z, MTXMODE_NEW);
for (i = 0; i < ARRAY_COUNT(sSides); i++) {
if (platform->unwalledSides & sSides[i]) {
@@ -23,7 +23,7 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx);
const ActorInit Bg_Gate_Shutter_InitVars = {
ACTOR_BG_GATE_SHUTTER,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_SPOT01_MATOYAB,
sizeof(BgGateShutter),
@@ -44,13 +44,13 @@ void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_06001DA8, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
this->somePos.x = thisx->posRot.pos.x;
this->somePos.y = thisx->posRot.pos.y;
this->somePos.z = thisx->posRot.pos.z;
this->somePos.x = thisx->world.pos.x;
this->somePos.y = thisx->world.pos.y;
this->somePos.z = thisx->world.pos.z;
if (((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) &&
(globalCtx->sceneNum == SCENE_SPOT01)) {
thisx->posRot.pos.x = -89.0f;
thisx->posRot.pos.z = -1375.0f;
thisx->world.pos.x = -89.0f;
thisx->world.pos.z = -1375.0f;
}
thisx->scale.x = 1.0f;
thisx->scale.y = 1.0f;
@@ -84,9 +84,9 @@ void func_80878300(BgGateShutter* this, GlobalContext* globalCtx) {
if (this->unk_178 == 0) {
Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
thisx->posRot.pos.x -= 2.0f;
Math_ApproachF(&thisx->posRot.pos.z, -1375.0f, 0.8f, 0.3f);
if (thisx->posRot.pos.x < -89.0f) {
thisx->world.pos.x -= 2.0f;
Math_ApproachF(&thisx->world.pos.z, -1375.0f, 0.8f, 0.3f);
if (thisx->world.pos.x < -89.0f) {
Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP);
this->unk_178 = 0x1E;
this->actionFunc = func_808783AC;
@@ -106,10 +106,10 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx) {
if (this->unk_178 == 0) {
Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG);
thisx->posRot.pos.x += 2.0f;
Math_ApproachF(&thisx->posRot.pos.z, -1350.0f, 0.8f, 0.3f);
if (thisx->posRot.pos.x > 90.0f) {
thisx->posRot.pos.x = 91.0f;
thisx->world.pos.x += 2.0f;
Math_ApproachF(&thisx->world.pos.z, -1350.0f, 0.8f, 0.3f);
if (thisx->world.pos.x > 90.0f) {
thisx->world.pos.x = 91.0f;
Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP);
this->unk_178 = 30;
this->actionFunc = func_808783AC;
@@ -21,7 +21,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, GlobalContext* globalCtx);
const ActorInit Bg_Gjyo_Bridge_InitVars = {
ACTOR_BG_GJYO_BRIDGE,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GJYO_OBJECTS,
sizeof(BgGjyoBridge),
@@ -75,9 +75,9 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx)
Player* player = PLAYER;
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.posRot.pos.x > -70.0f) &&
(player->actor.posRot.pos.x < 300.0f) && (player->actor.posRot.pos.y > 1340.0f) &&
(player->actor.posRot.pos.z > 1340.0f) && (player->actor.posRot.pos.z < 1662.0f) &&
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.world.pos.x > -70.0f) &&
(player->actor.world.pos.x < 300.0f) && (player->actor.world.pos.y > 1340.0f) &&
(player->actor.world.pos.z > 1340.0f) && (player->actor.world.pos.z < 1662.0f) &&
!Gameplay_InCsMode(globalCtx)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_02002640);
gSaveContext.cutsceneTrigger = 1;
@@ -24,7 +24,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, GlobalContext* globa
const ActorInit Bg_Gnd_Darkmeiro_InitVars = {
ACTOR_BG_GND_DARKMEIRO,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_DEMO_KEKKAI,
sizeof(BgGndDarkmeiro),
@@ -25,7 +25,7 @@ extern UNK_TYPE D_0600ECD8;
/*
const ActorInit Bg_Gnd_Firemeiro_InitVars = {
ACTOR_BG_GND_FIREMEIRO,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_DEMO_KEKKAI,
sizeof(BgGndFiremeiro),
@@ -29,7 +29,7 @@ extern CollisionHeader D_06004618;
const ActorInit Bg_Gnd_Iceblock_InitVars = {
ACTOR_BG_GND_ICEBLOCK,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_DEMO_KEKKAI,
sizeof(BgGndIceblock),
@@ -56,17 +56,17 @@ void BgGndIceblock_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_06004618, &colHeader);
this->targetPos = this->dyna.actor.initPosRot.pos;
this->targetPos = this->dyna.actor.home.pos;
this->actionFunc = BgGndIceblock_Idle;
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.actor.posRot.pos.x == 2792.0f) {
if (this->dyna.actor.world.pos.x == 2792.0f) {
this->dyna.actor.params = 0;
sBlockPositions[0] = 7;
} else if (this->dyna.actor.posRot.pos.x == 3032.0f) {
} else if (this->dyna.actor.world.pos.x == 3032.0f) {
this->dyna.actor.params = 1;
sBlockPositions[1] = 14;
} else {
LOG_FLOAT("thisx->world.position.x", this->dyna.actor.posRot.pos.x, "../z_bg_gnd_iceblock.c", 138);
LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x, "../z_bg_gnd_iceblock.c", 138);
__assert("0", "../z_bg_gnd_iceblock.c", 139);
}
}
@@ -242,7 +242,7 @@ void BgGndIceblock_Idle(BgGndIceblock* this, GlobalContext* globalCtx) {
player->stateFlags2 &= ~0x10;
if (this->dyna.unk_150 > 0.0f) {
BgGndIceblock_SetNextPosition(this);
if (func_8002DBB0(&this->dyna.actor, &this->targetPos) > 1.0f) {
if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->targetPos) > 1.0f) {
func_8002DF54(globalCtx, &this->dyna.actor, 8);
this->actionFunc = BgGndIceblock_Slide;
}
@@ -259,8 +259,8 @@ void BgGndIceblock_Reset(BgGndIceblock* this, GlobalContext* globalCtx) {
player->stateFlags2 &= ~0x10;
this->dyna.unk_150 = 0.0f;
}
if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 1.0f)) {
this->targetPos = thisx->initPosRot.pos;
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) {
this->targetPos = thisx->home.pos;
thisx->speedXZ = 0.0f;
this->actionFunc = BgGndIceblock_Idle;
switch (thisx->params) {
@@ -278,11 +278,11 @@ void BgGndIceblock_Fall(BgGndIceblock* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
thisx->velocity.y += 1.0f;
if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 300.0f, thisx->velocity.y)) {
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 300.0f, thisx->velocity.y)) {
thisx->velocity.y = 0.0f;
thisx->posRot.pos.x = thisx->initPosRot.pos.x;
thisx->posRot.pos.y = thisx->initPosRot.pos.y - 100.0f;
thisx->posRot.pos.z = thisx->initPosRot.pos.z;
thisx->world.pos.x = thisx->home.pos.x;
thisx->world.pos.y = thisx->home.pos.y - 100.0f;
thisx->world.pos.z = thisx->home.pos.z;
if (Player_InCsMode(globalCtx)) {
func_8002DF54(globalCtx, thisx, 7);
}
@@ -294,7 +294,7 @@ void BgGndIceblock_Hole(BgGndIceblock* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
thisx->velocity.y += 1.0f;
if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 100.0f, thisx->velocity.y)) {
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 100.0f, thisx->velocity.y)) {
thisx->velocity.y = 0.0f;
if (Player_InCsMode(globalCtx)) {
func_8002DF54(globalCtx, thisx, 7);
@@ -311,12 +311,12 @@ void BgGndIceblock_Slide(BgGndIceblock* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f);
atTarget = Math_StepToF(&thisx->posRot.pos.x, this->targetPos.x, thisx->speedXZ);
atTarget &= Math_StepToF(&thisx->posRot.pos.z, this->targetPos.z, thisx->speedXZ);
atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ);
atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ);
if (atTarget) {
thisx->speedXZ = 0.0f;
this->targetPos.x = thisx->posRot.pos.x;
this->targetPos.z = thisx->posRot.pos.z;
this->targetPos.x = thisx->world.pos.x;
this->targetPos.z = thisx->world.pos.z;
Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND);
switch (BgGndIceblock_NextAction(this)) {
case GNDICE_IDLE:
@@ -335,17 +335,13 @@ void BgGndIceblock_Slide(BgGndIceblock* this, GlobalContext* globalCtx) {
velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158);
velocity.y = Rand_ZeroOne() + 1.0f;
velocity.z = -(1.5f + Rand_ZeroOne()) * Math_CosS(this->dyna.unk_158);
pos.x =
thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread);
pos.z =
thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread);
pos.y = thisx->posRot.pos.y;
pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread);
pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread);
pos.y = thisx->world.pos.y;
func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15));
spread = Rand_CenteredFloat(120.0f);
pos.x =
thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread);
pos.z =
thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread);
pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread);
pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread);
func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15));
func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG);
}
@@ -17,7 +17,7 @@ void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Gnd_Nisekabe_InitVars = {
ACTOR_BG_GND_NISEKABE,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_DEMO_KEKKAI,
sizeof(BgGndNisekabe),
@@ -22,7 +22,7 @@ void func_8087B350(BgGndSoulmeiro* this, GlobalContext* globalCtx);
const ActorInit Bg_Gnd_Soulmeiro_InitVars = {
ACTOR_BG_GND_SOULMEIRO,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_DEMO_KEKKAI,
sizeof(BgGndSoulmeiro),
@@ -77,8 +77,8 @@ void BgGndSoulmeiro_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = func_8087B284;
if (Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 9);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9);
this->actor.draw = NULL;
Actor_Kill(&this->actor);
return;
@@ -130,8 +130,8 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) {
if (!this->unk_198) {
Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F);
Actor_Kill(&this->actor);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, 9);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 9);
return;
}
@@ -140,29 +140,29 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) {
if ((this->unk_198 % 6) == 0) {
temp_2 = Rand_ZeroOne() * (10922.0f); // This should be: 0x10000 / 6.0f
vecA.y = 0.0f;
vecB.y = this->actor.posRot.pos.y;
vecB.y = this->actor.world.pos.y;
this2 = this;
for (i = 0; i < 6; i++) {
temp_1 = Rand_CenteredFloat(0x2800) + temp_2;
temp_3 = Math_SinS(temp_1);
temp_4 = Math_CosS(temp_1);
vecB.x = this2->actor.posRot.pos.x + (120.0f * temp_3);
vecB.z = this2->actor.posRot.pos.z + (120.0f * temp_4);
distXZ = Math_Vec3f_DistXZ(&this2->actor.initPosRot.pos, &vecB) * (1.0f / 120.0f);
vecB.x = this2->actor.world.pos.x + (120.0f * temp_3);
vecB.z = this2->actor.world.pos.z + (120.0f * temp_4);
distXZ = Math_Vec3f_DistXZ(&this2->actor.home.pos, &vecB) * (1.0f / 120.0f);
if (distXZ < 0.7f) {
temp_3 = Math_SinS(temp_1 + 0x8000);
temp_4 = Math_CosS(temp_1 + 0x8000);
vecB.x = this->actor.posRot.pos.x + (120.0f * temp_3);
vecB.z = this->actor.posRot.pos.z + (120.0f * temp_4);
distXZ = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &vecB) * (1.0f / 120.0f);
vecB.x = this->actor.world.pos.x + (120.0f * temp_3);
vecB.z = this->actor.world.pos.z + (120.0f * temp_4);
distXZ = Math_Vec3f_DistXZ(&this->actor.home.pos, &vecB) * (1.0f / 120.0f);
}
vecA.x = 4.0f * temp_3 * distXZ;
vecA.y = 0.0f;
vecA.z = 4.0f * temp_4 * distXZ;
EffectSsDeadDb_Spawn(globalCtx, &this->actor.initPosRot.pos, &vecA, &sZeroVec, 60, 6, 255, 255, 150, 170,
255, 0, 0, 1, 14, true);
EffectSsDeadDb_Spawn(globalCtx, &this->actor.home.pos, &vecA, &sZeroVec, 60, 6, 255, 255, 150, 170, 255, 0,
0, 1, 14, true);
temp_2 += 0x2AAA;
}
}
+10 -10
View File
@@ -23,7 +23,7 @@ void func_8087BAE4(BgHaka* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_InitVars = {
ACTOR_BG_HAKA,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HAKA,
sizeof(BgHaka),
@@ -63,7 +63,7 @@ void BgHaka_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_8087B758(BgHaka* this, Player* player) {
Vec3f sp1C;
func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.posRot.pos);
func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.world.pos);
if (fabsf(sp1C.x) < 34.6f && sp1C.z > -112.8f && sp1C.z < -36.0f) {
player->stateFlags2 |= 0x200;
}
@@ -86,7 +86,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) {
this->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~0x10;
} else {
this->dyna.actor.posRot.rot.y = this->dyna.actor.shape.rot.y + 0x8000;
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x8000;
this->actionFunc = func_8087B938;
}
}
@@ -100,19 +100,19 @@ void func_8087B938(BgHaka* this, GlobalContext* globalCtx) {
this->dyna.actor.speedXZ += 0.05f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 1.5f);
sp38 = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speedXZ);
this->dyna.actor.posRot.pos.x =
Math_SinS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot.pos.z =
Math_CosS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.initPosRot.pos.z;
this->dyna.actor.world.pos.x =
Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z =
Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.z;
if (sp38 != 0) {
this->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~0x10;
if (this->dyna.actor.params == 1) {
func_80078884(NA_SE_SY_CORRECT_CHIME);
} else if (gSaveContext.nightFlag && globalCtx->sceneNum == SCENE_SPOT02) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.initPosRot.pos.x,
this->dyna.actor.initPosRot.pos.y, this->dyna.actor.initPosRot.pos.z, 0,
this->dyna.actor.shape.rot.y, 0, 1);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.home.pos.x,
this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, this->dyna.actor.shape.rot.y, 0,
1);
}
this->actionFunc = func_8087BAAC;
}
@@ -56,13 +56,13 @@ extern CollisionHeader D_060131C4;
static s16 sSkullOfTruthRotY = 0x100;
static u8 sPuzzleState = 1;
static f32 sStatueDistToLink = 0;
static f32 sStatueDistToPlayer = 0;
static s16 sStatueRotY;
const ActorInit Bg_Haka_Gate_InitVars = {
ACTOR_BG_HAKA_GATE,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_HAKA_OBJECTS,
sizeof(BgHakaGate),
@@ -113,7 +113,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params == BGHAKAGATE_STATUE) {
CollisionHeader_GetVirtual(&D_060131C4, &colHeader);
this->vTimer = 0;
sStatueDistToLink = 0.0f;
sStatueDistToPlayer = 0.0f;
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
this->actionFunc = BgHakaGate_StatueInactive;
} else {
@@ -130,10 +130,10 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&D_0600A938, &colHeader);
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
this->actionFunc = BgHakaGate_DoNothing;
thisx->posRot.pos.y += 80.0f;
thisx->world.pos.y += 80.0f;
} else {
thisx->flags |= 0x10;
Actor_SetHeight(thisx, 30.0f);
Actor_SetFocus(thisx, 30.0f);
this->actionFunc = BgHakaGate_GateWait;
}
}
@@ -171,10 +171,10 @@ void BgHakaGate_StatueIdle(BgHakaGate* this, GlobalContext* globalCtx) {
if (this->dyna.unk_150 != 0.0f) {
if (this->vTimer == 0) {
this->vInitTurnAngle = this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsLink;
sStatueDistToLink = this->dyna.actor.xzDistToLink;
this->vInitTurnAngle = this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsPlayer;
sStatueDistToPlayer = this->dyna.actor.xzDistToPlayer;
forceDirection = (this->dyna.unk_150 >= 0.0f) ? 1.0f : -1.0f;
linkDirection = ((s16)(this->dyna.actor.yawTowardsLink - player->actor.shape.rot.y) > 0) ? -1 : 1;
linkDirection = ((s16)(this->dyna.actor.yawTowardsPlayer - player->actor.shape.rot.y) > 0) ? -1 : 1;
this->vTurnDirection = linkDirection * forceDirection;
this->actionFunc = BgHakaGate_StatueTurn;
} else {
@@ -203,15 +203,15 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) {
turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10);
turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection;
this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f);
if ((player->stateFlags2 & 0x10) && (sStatueDistToLink > 0.0f)) {
player->actor.posRot.pos.x =
this->dyna.actor.initPosRot.pos.x +
(Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToLink);
player->actor.posRot.pos.z =
this->dyna.actor.initPosRot.pos.z +
(Math_CosS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToLink);
if ((player->stateFlags2 & 0x10) && (sStatueDistToPlayer > 0.0f)) {
player->actor.world.pos.x =
this->dyna.actor.home.pos.x +
(Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer);
player->actor.world.pos.z =
this->dyna.actor.home.pos.z +
(Math_CosS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer);
} else {
sStatueDistToLink = 0.0f;
sStatueDistToPlayer = 0.0f;
}
sStatueRotY = this->dyna.actor.shape.rot.y;
if (turnFinished) {
@@ -227,14 +227,14 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) {
}
void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) {
if ((sStatueDistToLink > 1.0f) && (sStatueRotY != 0)) {
if ((sStatueDistToPlayer > 1.0f) && (sStatueRotY != 0)) {
Player* player = PLAYER;
f32 radialDist;
f32 angDist;
f32 cos = Math_CosS(sStatueRotY);
f32 sin = Math_SinS(sStatueRotY);
f32 dx = player->actor.posRot.pos.x - this->dyna.actor.posRot.pos.x;
f32 dz = player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z;
f32 dx = player->actor.world.pos.x - this->dyna.actor.world.pos.x;
f32 dz = player->actor.world.pos.z - this->dyna.actor.world.pos.z;
radialDist = dx * cos - dz * sin;
angDist = dx * sin + dz * cos;
@@ -242,7 +242,7 @@ void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) {
if ((radialDist > 110.0f) || (fabsf(angDist) > 40.0f)) {
s16 yawDiff = sSkullOfTruthRotY - sStatueRotY;
sStatueDistToLink = 0.0f;
sStatueDistToPlayer = 0.0f;
if (ABS(yawDiff) < 0x80) {
Flags_SetSwitch(globalCtx, this->switchFlag);
sPuzzleState = SKULL_OF_TRUTH_FOUND;
@@ -280,7 +280,7 @@ void BgHakaGate_GateWait(BgHakaGate* this, GlobalContext* globalCtx) {
}
void BgHakaGate_GateOpen(BgHakaGate* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 80.0f, 1.0f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 80.0f, 1.0f)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
this->dyna.actor.flags &= ~0x10;
this->actionFunc = BgHakaGate_DoNothing;
@@ -332,7 +332,7 @@ void BgHakaGate_DrawFlame(BgHakaGate* this, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
Matrix_Translate(thisx->posRot.pos.x, thisx->posRot.pos.y + 15.0f, thisx->posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y + 15.0f, thisx->world.pos.z, MTXMODE_NEW);
Matrix_RotateY(Camera_GetCamDirYaw(ACTIVE_CAM) * (M_PI / 0x8000), MTXMODE_APPLY);
scale = this->vFlameScale * 0.00001f;
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
@@ -22,7 +22,7 @@ extern UNK_TYPE D_06000870;
/*
const ActorInit Bg_Haka_Huta_InitVars = {
ACTOR_BG_HAKA_HUTA,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HAKACH_OBJECTS,
sizeof(BgHakaHuta),
@@ -21,7 +21,7 @@ void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_Megane_InitVars = {
ACTOR_BG_HAKA_MEGANE,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgHakaMegane),
@@ -26,7 +26,7 @@ void func_8087E34C(BgHakaMeganeBG* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_MeganeBG_InitVars = {
ACTOR_BG_HAKA_MEGANEBG,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HAKA_OBJECTS,
sizeof(BgHakaMeganeBG),
@@ -84,11 +84,11 @@ void BgHakaMeganeBG_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = func_8087DFF8;
} else if (thisx->params == 3) {
CollisionHeader_GetVirtual(&D_06000118, &colHeader);
thisx->initPosRot.pos.y += 100.0f;
thisx->home.pos.y += 100.0f;
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
this->actionFunc = func_8087E34C;
thisx->posRot.pos.y = thisx->initPosRot.pos.y;
thisx->world.pos.y = thisx->home.pos.y;
} else {
thisx->flags |= 0x10;
this->actionFunc = func_8087E288;
@@ -118,7 +118,7 @@ void func_8087DFF8(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
if (this->unk_16A == 0) {
this->unk_16A = 40;
this->dyna.actor.posRot.rot.y += 0x8000;
this->dyna.actor.world.rot.y += 0x8000;
this->actionFunc = func_8087E040;
}
}
@@ -132,11 +132,11 @@ void func_8087E040(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
xSub = (sinf(((this->unk_16A * 0.025f) + 0.5f) * M_PI) + 1.0f) * 160.0f;
if (this->dyna.actor.posRot.rot.y != this->dyna.actor.shape.rot.y) {
if (this->dyna.actor.world.rot.y != this->dyna.actor.shape.rot.y) {
xSub = 320.0f - xSub;
}
this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x - xSub;
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - xSub;
if (this->unk_16A == 0) {
this->unk_16A = 20;
@@ -157,7 +157,7 @@ void func_8087E10C(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
this->unk_16A--;
}
if (!Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 640.0f,
if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 640.0f,
this->dyna.actor.velocity.y)) {
func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG);
}
@@ -170,7 +170,7 @@ void func_8087E10C(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
}
void func_8087E1E0(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 16.0f / 3.0f);
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f);
func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG);
if (this->unk_16A != 0) {
@@ -198,8 +198,8 @@ void func_8087E288(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
void func_8087E2D8(BgHakaMeganeBG* this, GlobalContext* globalCtx) {
Math_StepToF(&this->dyna.actor.speedXZ, 30.0f, 2.0f);
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.speedXZ)) {
Actor_SetHeight(&this->dyna.actor, 50.0f);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.speedXZ)) {
Actor_SetFocus(&this->dyna.actor, 50.0f);
this->actionFunc = func_8087E34C;
} else {
func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN);
@@ -31,7 +31,7 @@ extern Gfx D_060021F0[];
const ActorInit Bg_Haka_Sgami_InitVars = {
ACTOR_BG_HAKA_SGAMI,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgHakaSgami),
@@ -125,7 +125,7 @@ static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, MASS_IMMOVABLE };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_U8(unk_1F, 4, ICHAIN_CONTINUE),
ICHAIN_U8(targetMode, 4, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
@@ -153,9 +153,9 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->colliderScytheCenter);
Collider_SetCylinder(globalCtx, &this->colliderScytheCenter, thisx, &sCylinderInit);
this->colliderScytheCenter.dim.pos.x = thisx->posRot.pos.x;
this->colliderScytheCenter.dim.pos.y = thisx->posRot.pos.y;
this->colliderScytheCenter.dim.pos.z = thisx->posRot.pos.z;
this->colliderScytheCenter.dim.pos.x = thisx->world.pos.x;
this->colliderScytheCenter.dim.pos.y = thisx->world.pos.y;
this->colliderScytheCenter.dim.pos.z = thisx->world.pos.z;
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
@@ -178,7 +178,7 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) {
this->requiredObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_ICE_OBJECTS);
this->colliderScytheCenter.dim.radius = 30;
this->colliderScytheCenter.dim.height = 70;
Actor_SetHeight(thisx, 40.0f);
Actor_SetFocus(thisx, 40.0f);
}
if (this->requiredObjBankIndex < 0) {
@@ -244,18 +244,18 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) {
elementInit = &sTrisInit.elements[i];
for (j = 0; j < 3; j++) {
scytheVertices[j].x = this->actor.posRot.pos.x + elementInit->dim.vtx[j].z * actorRotYSin +
scytheVertices[j].x = this->actor.world.pos.x + elementInit->dim.vtx[j].z * actorRotYSin +
elementInit->dim.vtx[j].x * actorRotYCos;
scytheVertices[j].y = this->actor.posRot.pos.y + elementInit->dim.vtx[j].y;
scytheVertices[j].z = this->actor.posRot.pos.z + elementInit->dim.vtx[j].z * actorRotYCos -
scytheVertices[j].y = this->actor.world.pos.y + elementInit->dim.vtx[j].y;
scytheVertices[j].z = this->actor.world.pos.z + elementInit->dim.vtx[j].z * actorRotYCos -
elementInit->dim.vtx[j].x * actorRotYSin;
}
Collider_SetTrisVertices(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]);
for (j = 0; j < 3; j++) {
scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x;
scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z;
scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x;
scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z;
}
Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1],
@@ -263,21 +263,21 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) {
}
if ((this->unk_151 == 0) || (globalCtx->actorCtx.unk_03 != 0)) {
scytheVertices[0].x = this->actor.posRot.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin +
scytheVertices[0].x = this->actor.world.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin +
blureEffectVertices1[this->actor.params].x * actorRotYCos;
scytheVertices[0].y = this->actor.posRot.pos.y + blureEffectVertices1[this->actor.params].y;
scytheVertices[0].z = this->actor.posRot.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos -
scytheVertices[0].y = this->actor.world.pos.y + blureEffectVertices1[this->actor.params].y;
scytheVertices[0].z = this->actor.world.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos -
blureEffectVertices1[this->actor.params].x * actorRotYSin;
scytheVertices[1].x = this->actor.posRot.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin +
scytheVertices[1].x = this->actor.world.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin +
blureEffectVertices2[this->actor.params].x * actorRotYCos;
scytheVertices[1].y = this->actor.posRot.pos.y + blureEffectVertices2[this->actor.params].y;
scytheVertices[1].z = this->actor.posRot.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos -
scytheVertices[1].y = this->actor.world.pos.y + blureEffectVertices2[this->actor.params].y;
scytheVertices[1].z = this->actor.world.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos -
blureEffectVertices2[this->actor.params].x * actorRotYSin;
EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[0]), &scytheVertices[0], &scytheVertices[1]);
for (j = 0; j < 2; j++) {
scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x;
scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z;
scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x;
scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z;
}
EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]);
@@ -32,7 +32,7 @@ extern UNK_TYPE D_0600ED7C;
/*
const ActorInit Bg_Haka_Ship_InitVars = {
ACTOR_BG_HAKA_SHIP,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HAKA_OBJECTS,
sizeof(BgHakaShip),
@@ -32,7 +32,7 @@ static UNK_TYPE D_80880F30 = 0;
const ActorInit Bg_Haka_Trap_InitVars = {
ACTOR_BG_HAKA_TRAP,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HAKA_OBJECTS,
sizeof(BgHakaTrap),
@@ -152,17 +152,17 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->velocity.y = 0.5f;
}
thisx->groundY = thisx->initPosRot.pos.y - 225.0f;
this->unk_16A = (thisx->groundY + 50.0f) - 25.0f;
thisx->floorHeight = thisx->home.pos.y - 225.0f;
this->unk_16A = (thisx->floorHeight + 50.0f) - 25.0f;
this->colliderCylinder.dim.radius = 10;
this->colliderCylinder.dim.height = 40;
} else {
if (thisx->params == HAKA_TRAP_SPIKED_WALL) {
CollisionHeader_GetVirtual(&D_060081D0, &colHeader);
thisx->initPosRot.pos.x -= 200.0f;
thisx->home.pos.x -= 200.0f;
} else {
thisx->initPosRot.pos.x += 200.0f;
thisx->home.pos.x += 200.0f;
CollisionHeader_GetVirtual(&D_06008D10, &colHeader);
}
@@ -213,7 +213,7 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) {
f32 zNonNegative;
Player* player = PLAYER;
func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.posRot.pos);
func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.world.pos);
sine = Math_SinS(this->dyna.actor.shape.rot.y);
cosine = Math_CosS(this->dyna.actor.shape.rot.y);
@@ -227,8 +227,8 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) {
sp28.z = zNonNegative * 15.0f;
}
this->colliderCylinder.dim.pos.x = this->dyna.actor.posRot.pos.x + sp28.x * cosine + sp28.z * sine;
this->colliderCylinder.dim.pos.z = this->dyna.actor.posRot.pos.z + sp28.x * sine + sp28.z * cosine;
this->colliderCylinder.dim.pos.x = this->dyna.actor.world.pos.x + sp28.x * cosine + sp28.z * sine;
this->colliderCylinder.dim.pos.z = this->dyna.actor.world.pos.z + sp28.x * sine + sp28.z * cosine;
}
void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
@@ -236,7 +236,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if ((D_80880F30 == 0) && (!Player_InCsMode(globalCtx))) {
if (!Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x, 0.5f)) {
if (!Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x, 0.5f)) {
func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG);
} else if (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) {
D_80881018 |= 1;
@@ -274,9 +274,9 @@ void func_808802D8(BgHakaTrap* this, GlobalContext* globalCtx) {
xScale = (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) ? -30.0f : 30.0f;
vector.x = xScale * rand + this->dyna.actor.posRot.pos.x;
vector.y = Rand_ZeroOne() * 10.0f + this->dyna.actor.posRot.pos.y + 30.0f;
vector.z = Rand_CenteredFloat(320.0f) + this->dyna.actor.posRot.pos.z;
vector.x = xScale * rand + this->dyna.actor.world.pos.x;
vector.y = Rand_ZeroOne() * 10.0f + this->dyna.actor.world.pos.y + 30.0f;
vector.z = Rand_CenteredFloat(320.0f) + this->dyna.actor.world.pos.z;
EffectSsDeadDb_Spawn(globalCtx, &vector, &zeroVec, &zeroVec, 130, 20, 255, 255, 150, 170, 255, 0, 0, 1, 9,
false);
@@ -302,8 +302,8 @@ void func_80880484(BgHakaTrap* this, GlobalContext* globalCtx) {
this->timer -= 1;
}
sp24 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 185.0f,
this->dyna.actor.velocity.y);
sp24 =
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 185.0f, this->dyna.actor.velocity.y);
timer = this->timer;
if ((timer == 10 && !this->unk_16A) || (timer == 13 && this->unk_16A)) {
@@ -330,12 +330,12 @@ void func_808805C0(BgHakaTrap* this, GlobalContext* globalCtx) {
}
if (this->unk_16A) {
Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 27.0f);
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 27.0f);
} else {
if (this->timer > 20) {
Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 90.0f, 9.0f);
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 90.0f, 9.0f);
} else {
Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 4.5f);
Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.5f);
}
if (this->timer == 20) {
@@ -345,7 +345,7 @@ void func_808805C0(BgHakaTrap* this, GlobalContext* globalCtx) {
if (this->timer == 0) {
this->timer = 20;
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
this->dyna.actor.velocity.y = 0.1f;
this->actionFunc = func_80880484;
}
@@ -366,11 +366,11 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) {
this->timer--;
}
vector.x = this->dyna.actor.posRot.pos.x + 90.0f;
vector.y = (this->dyna.actor.posRot.pos.y + 1.0f) + 25.0f;
vector.z = this->dyna.actor.posRot.pos.z;
vector.x = this->dyna.actor.world.pos.x + 90.0f;
vector.y = (this->dyna.actor.world.pos.y + 1.0f) + 25.0f;
vector.z = this->dyna.actor.world.pos.z;
tempf20 = this->dyna.actor.groundY;
tempf20 = this->dyna.actor.floorHeight;
for (i = 0; i < 3; i++) {
temp = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &sp64, &this->dyna.actor,
@@ -383,7 +383,7 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) {
vector.x -= 90.0f;
}
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, tempf20, this->dyna.actor.velocity.y)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, tempf20, this->dyna.actor.velocity.y)) {
if (this->dyna.actor.velocity.y > 0.01f) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND);
}
@@ -397,8 +397,8 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) {
if (this->timer == 0) {
this->dyna.actor.velocity.y = 0.0f;
this->timer = 30;
this->unk_16A = (s16)this->dyna.actor.posRot.pos.y + 50.0f;
this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.initPosRot.pos.y);
this->unk_16A = (s16)this->dyna.actor.world.pos.y + 50.0f;
this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.home.pos.y);
this->actionFunc = func_808808F4;
}
@@ -410,14 +410,14 @@ void func_808808F4(BgHakaTrap* this, GlobalContext* globalCtx) {
}
if (this->timer > 20) {
this->unk_169 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->unk_16A, 15.0f);
this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->unk_16A, 15.0f);
} else {
this->unk_169 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 20.0f);
this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 20.0f);
}
if (this->timer == 0) {
this->timer = 30;
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
this->dyna.actor.velocity.y = 0.5f;
this->actionFunc = func_808806BC;
}
@@ -437,7 +437,7 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) {
Player* player = PLAYER;
Vec3f sp18;
func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.posRot.pos);
func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.world.pos);
if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) &&
(PLAYER->currentBoots != PLAYER_BOOTS_IRON)) {
@@ -448,23 +448,23 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) {
void func_80880AE8(BgHakaTrap* this, GlobalContext* globalCtx) {
if (this->timer != 0) {
if (Math_ScaledStepToS(&this->dyna.actor.posRot.rot.z, 0, this->dyna.actor.posRot.rot.z * 0.03f + 5.0f)) {
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) {
this->timer = 40;
this->actionFunc = func_808809B0;
}
} else {
if (Math_ScaledStepToS(&this->dyna.actor.posRot.rot.z, 0x3A00, this->dyna.actor.posRot.rot.z * 0.03f + 5.0f)) {
if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0x3A00, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) {
this->timer = 100;
this->actionFunc = func_80880C0C;
}
}
this->dyna.actor.shape.rot.z += this->dyna.actor.posRot.rot.z;
if (this->dyna.actor.posRot.rot.z >= 0x1801) {
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z;
if (this->dyna.actor.world.rot.z >= 0x1801) {
func_8002F974(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG);
}
func_808809E4(this, globalCtx, this->dyna.actor.posRot.rot.z);
func_808809E4(this, globalCtx, this->dyna.actor.world.rot.z);
}
void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx) {
@@ -479,13 +479,13 @@ void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx) {
this->actionFunc = func_80880AE8;
}
this->dyna.actor.shape.rot.z += this->dyna.actor.posRot.rot.z;
func_808809E4(this, globalCtx, this->dyna.actor.posRot.rot.z);
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z;
func_808809E4(this, globalCtx, this->dyna.actor.world.rot.z);
}
void BgHakaTrap_Update(Actor* thisx, GlobalContext* globalCtx) {
BgHakaTrap* this = THIS;
Vec3f* actorPos = &thisx->posRot.pos;
Vec3f* actorPos = &thisx->world.pos;
this->actionFunc(this, globalCtx);
@@ -543,9 +543,9 @@ void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
if ((this->actionFunc == func_808808F4) && !this->unk_169) {
sp2C.x = thisx->posRot.pos.x;
sp2C.z = thisx->posRot.pos.z;
sp2C.y = thisx->posRot.pos.y + 110.0f;
sp2C.x = thisx->world.pos.x;
sp2C.z = thisx->world.pos.z;
sp2C.y = thisx->world.pos.y + 110.0f;
SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &sp2C, &this->unk_16C);
func_80078914(&this->unk_16C, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG);
@@ -20,7 +20,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_Tubo_InitVars = {
ACTOR_BG_HAKA_TUBO,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HAKA_OBJECTS,
sizeof(BgHakaTubo),
@@ -113,26 +113,26 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) {
if (this->dyna.actor.room == 12) { // 3 spinning pots room in Shadow Temple
this->dyna.actor.shape.rot.y += 0x180;
this->dyna.actor.posRot.pos.x = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -5559.0f;
this->dyna.actor.posRot.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f;
this->dyna.actor.world.pos.x = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -5559.0f;
this->dyna.actor.world.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f;
}
// Colliding with flame circle
if (this->flamesCollider.base.atFlags & AT_HIT) {
this->flamesCollider.base.atFlags &= ~AT_HIT;
func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsLink, 5.0f);
func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f);
}
// Colliding with hitbox inside the pot
if (this->potCollider.base.acFlags & AC_HIT) {
this->potCollider.base.acFlags &= ~AC_HIT;
// If the colliding actor is within a 50 unit radius and 50 unit height cylinder centered
// on the actor's position, break the pot
if (func_8002DBB0(&this->dyna.actor, &this->potCollider.base.ac->posRot.pos) < 50.0f &&
(this->potCollider.base.ac->posRot.pos.y - this->dyna.actor.posRot.pos.y) < 50.0f) {
pos.x = this->dyna.actor.posRot.pos.x;
pos.z = this->dyna.actor.posRot.pos.z;
pos.y = this->dyna.actor.posRot.pos.y + 80.0f;
if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->potCollider.base.ac->world.pos) < 50.0f &&
(this->potCollider.base.ac->world.pos.y - this->dyna.actor.world.pos.y) < 50.0f) {
pos.x = this->dyna.actor.world.pos.x;
pos.z = this->dyna.actor.world.pos.z;
pos.y = this->dyna.actor.world.pos.y + 80.0f;
EffectSsBomb2_SpawnLayered(globalCtx, &pos, &sZeroVector, &sZeroVector, 100, 45);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 50, NA_SE_EV_BOX_BREAK);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK);
EffectSsHahen_SpawnBurst(globalCtx, &pos, 20.0f, 0, 350, 100, 50, OBJECT_HAKA_OBJECTS, 40, D_0400CD80);
this->dropTimer = 5;
this->dyna.actor.draw = NULL;
@@ -157,9 +157,9 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) {
this->dropTimer--;
if (this->dropTimer == 0) { // Creates a delay between destroying the pot and dropping the collectible
spawnPos.x = this->dyna.actor.posRot.pos.x;
spawnPos.y = this->dyna.actor.posRot.pos.y + 200.0f;
spawnPos.z = this->dyna.actor.posRot.pos.z;
spawnPos.x = this->dyna.actor.world.pos.x;
spawnPos.y = this->dyna.actor.world.pos.y + 200.0f;
spawnPos.z = this->dyna.actor.world.pos.z;
if (this->dyna.actor.room == 12) { // 3 spinning pots room in Shadow Temple
rnd = Rand_ZeroOne();
sPotsDestroyed++;
@@ -172,14 +172,14 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) {
collectible = Item_DropCollectible(globalCtx, &spawnPos, i % 3);
if (collectible != NULL) {
collectible->actor.velocity.y = 15.0f;
collectible->actor.posRot.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71);
collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71);
}
}
} else if (rnd < 0.2f) {
// Unlucky, no reward and spawn keese
collectibleParams = -1;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FIREFLY, this->dyna.actor.posRot.pos.x,
this->dyna.actor.posRot.pos.y + 80.0f, this->dyna.actor.posRot.pos.z, 0,
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FIREFLY, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y + 80.0f, this->dyna.actor.world.pos.z, 0,
this->dyna.actor.shape.rot.y, 0, 2);
func_80078884(NA_SE_SY_ERROR);
} else {
@@ -208,7 +208,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) {
collectible = Item_DropCollectible(globalCtx, &spawnPos, collectibleParams);
if (collectible != NULL) {
collectible->actor.velocity.y = 15.0f;
collectible->actor.posRot.rot.y = this->dyna.actor.shape.rot.y;
collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y;
}
}
Actor_Kill(&this->dyna.actor);
@@ -228,8 +228,8 @@ void BgHakaTubo_DrawFlameCircle(BgHakaTubo* this, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_haka_tubo.c", 476);
func_80093D84(globalCtx->state.gfxCtx);
Matrix_Translate(this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 235.0f,
this->dyna.actor.posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 235.0f, this->dyna.actor.world.pos.z,
MTXMODE_NEW);
Matrix_RotateY(this->dyna.actor.shape.rot.y * 0.0000958738f, MTXMODE_APPLY);
Matrix_Scale(0.07f, 0.04f, 0.07f, MTXMODE_APPLY);
if (1) {}
@@ -21,7 +21,7 @@ void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx);
const ActorInit Bg_Haka_Water_InitVars = {
ACTOR_BG_HAKA_WATER,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_HAKACH_OBJECTS,
sizeof(BgHakaWater),
@@ -44,8 +44,8 @@ void BgHakaWater_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
if (Flags_GetSwitch(globalCtx, this->actor.params)) {
this->isLowered = true;
this->actor.initPosRot.pos.y -= 200.0f;
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y;
this->actor.home.pos.y -= 200.0f;
this->actor.world.pos.y = this->actor.home.pos.y;
} else {
this->isLowered = false;
}
@@ -60,7 +60,7 @@ void func_80881D94(BgHakaWater* this, GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 9; i++) {
globalCtx->colCtx.colHeader->waterBoxes[i].ySurface = (s16)this->actor.posRot.pos.y - 8;
globalCtx->colCtx.colHeader->waterBoxes[i].ySurface = (s16)this->actor.world.pos.y - 8;
}
}
@@ -70,10 +70,10 @@ void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx) {
if (this->isLowered) {
this->isLowered = false;
this->actor.draw = BgHakaWater_Draw;
this->actor.initPosRot.pos.y += 200.0f;
this->actor.home.pos.y += 200.0f;
} else {
this->isLowered = true;
this->actor.initPosRot.pos.y -= 200.0f;
this->actor.home.pos.y -= 200.0f;
}
this->actionFunc = BgHakaWater_ChangeWaterLevel;
}
@@ -82,19 +82,19 @@ void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx) {
void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx) {
if (!this->isLowered && Flags_GetSwitch(globalCtx, this->actor.params)) {
this->isLowered = true;
this->actor.initPosRot.pos.y -= 200.0f;
this->actor.home.pos.y -= 200.0f;
} else if (this->isLowered && !Flags_GetSwitch(globalCtx, this->actor.params)) {
this->isLowered = false;
this->actor.initPosRot.pos.y += 200.0f;
this->actor.home.pos.y += 200.0f;
}
if (this->actor.initPosRot.pos.y < this->actor.posRot.pos.y) {
if (this->actor.home.pos.y < this->actor.world.pos.y) {
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
} else {
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
}
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f) != 0) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f) != 0) {
this->actionFunc = BgHakaWater_Wait;
if (this->isLowered) {
this->actor.draw = NULL;
@@ -119,9 +119,9 @@ void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
if (this->isLowered) {
temp = this->actor.posRot.pos.y - this->actor.initPosRot.pos.y;
temp = this->actor.world.pos.y - this->actor.home.pos.y;
} else {
temp = this->actor.posRot.pos.y - (this->actor.initPosRot.pos.y - 200.0f);
temp = this->actor.world.pos.y - (this->actor.home.pos.y - 200.0f);
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(0.765f * temp));
@@ -21,7 +21,7 @@ extern UNK_TYPE D_06006F70;
/*
const ActorInit Bg_Haka_Zou_InitVars = {
ACTOR_BG_HAKA_ZOU,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgHakaZou),
@@ -29,7 +29,7 @@ void BgHeavyBlock_DoNothing(BgHeavyBlock* this, GlobalContext* globalCtx);
const ActorInit Bg_Heavy_Block_InitVars = {
ACTOR_BG_HEAVY_BLOCK,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HEAVY_OBJECT,
sizeof(BgHeavyBlock),
@@ -52,9 +52,9 @@ extern Gfx D_06001A30[];
extern Gfx D_060018A0[];
void BgHeavyBlock_SetPieceRandRot(BgHeavyBlock* this, f32 scale) {
this->dyna.actor.posRot.rot.x = Rand_CenteredFloat(1024.0f) * scale;
this->dyna.actor.posRot.rot.y = Rand_CenteredFloat(1024.0f) * scale;
this->dyna.actor.posRot.rot.z = Rand_CenteredFloat(1024.0f) * scale;
this->dyna.actor.world.rot.x = Rand_CenteredFloat(1024.0f) * scale;
this->dyna.actor.world.rot.y = Rand_CenteredFloat(1024.0f) * scale;
this->dyna.actor.world.rot.z = Rand_CenteredFloat(1024.0f) * scale;
}
void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) {
@@ -68,12 +68,12 @@ void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) {
rand = (randChoice < 0.0f) ? randChoice - 2.0f : randChoice + 2.0f;
this->dyna.actor.velocity.y = (Rand_ZeroFloat(8.0f) + 4.0f) * scale;
this->dyna.actor.velocity.z = Rand_ZeroFloat(-8.0f * scale);
yawSinCos = Math_CosS(this->dyna.actor.posRot.rot.y);
yawSinCos = Math_CosS(this->dyna.actor.world.rot.y);
this->dyna.actor.velocity.x =
(Math_SinS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.velocity.z + (yawSinCos * rand));
yawSinCos = Math_SinS(this->dyna.actor.posRot.rot.y);
(Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.velocity.z + (yawSinCos * rand));
yawSinCos = Math_SinS(this->dyna.actor.world.rot.y);
this->dyna.actor.velocity.z =
(Math_CosS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.velocity.z) + (-yawSinCos * rand);
(Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.velocity.z) + (-yawSinCos * rand);
BgHeavyBlock_SetPieceRandRot(this, scale);
Actor_SetScale(&this->dyna.actor, Rand_CenteredFloat(0.2f) + 1.0f);
}
@@ -131,12 +131,12 @@ void BgHeavyBlock_Init(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) {
this->actionFunc = BgHeavyBlock_DoNothing;
thisx->shape.rot.x = thisx->posRot.rot.x = 0x8AD0;
thisx->shape.rot.y = thisx->posRot.rot.y = 0xC000;
thisx->shape.rot.z = thisx->posRot.rot.z = 0x0;
thisx->posRot.pos.x = 1704.0f;
thisx->posRot.pos.y = 1504.0f;
thisx->posRot.pos.z = 516.0f;
thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0;
thisx->shape.rot.y = thisx->world.rot.y = 0xC000;
thisx->shape.rot.z = thisx->world.rot.z = 0x0;
thisx->world.pos.x = 1704.0f;
thisx->world.pos.y = 1504.0f;
thisx->world.pos.z = 516.0f;
}
this->actionFunc = BgHeavyBlock_Wait;
@@ -178,16 +178,16 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) {
thisx->velocity.x *= 0.98f;
thisx->velocity.z *= 0.98f;
func_8002D7EC(thisx);
thisx->shape.rot.x += thisx->posRot.rot.x;
thisx->shape.rot.y += thisx->posRot.rot.y;
thisx->shape.rot.z += thisx->posRot.rot.z;
thisx->shape.rot.x += thisx->world.rot.x;
thisx->shape.rot.y += thisx->world.rot.y;
thisx->shape.rot.z += thisx->world.rot.z;
if (!(this->pieceFlags & PIECE_FLAG_HIT_FLOOR)) {
thisx->posRot.pos.y += this->unk_164.y;
thisx->pos4.y += this->unk_164.y;
func_8002E4B4(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5);
thisx->posRot.pos.y -= this->unk_164.y;
thisx->pos4.y -= this->unk_164.y;
thisx->world.pos.y += this->unk_164.y;
thisx->prevPos.y += this->unk_164.y;
Actor_UpdateBgCheckInfo(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5);
thisx->world.pos.y -= this->unk_164.y;
thisx->prevPos.y -= this->unk_164.y;
if (thisx->bgCheckFlags & 1) {
this->pieceFlags |= PIECE_FLAG_HIT_FLOOR;
thisx->velocity.y = Rand_ZeroFloat(4.0f) + 2.0f;
@@ -195,7 +195,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) {
thisx->velocity.z = Rand_CenteredFloat(8.0f);
BgHeavyBlock_SetPieceRandRot(this, 1.0f);
Audio_PlayActorSound2(thisx, NA_SE_EV_ROCK_BROKEN);
func_800AA000(thisx->xzDistToLink, 0x96, 0xA, 8);
func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8);
}
}
@@ -297,17 +297,17 @@ void BgHeavyBlock_SpawnPieces(BgHeavyBlock* this, GlobalContext* globalCtx) {
f32 sinYaw;
f32 cosYaw;
sinPitch = Math_SinS(this->dyna.actor.posRot.rot.x);
cosPitch = Math_CosS(this->dyna.actor.posRot.rot.x);
sinYaw = Math_SinS(this->dyna.actor.posRot.rot.y);
cosYaw = Math_CosS(this->dyna.actor.posRot.rot.y);
sinPitch = Math_SinS(this->dyna.actor.world.rot.x);
cosPitch = Math_CosS(this->dyna.actor.world.rot.x);
sinYaw = Math_SinS(this->dyna.actor.world.rot.y);
cosYaw = Math_CosS(this->dyna.actor.world.rot.y);
for (i = 0; i < ARRAY_COUNT(spA4); i++) {
pos.z = (spA4[i].y * sinPitch) + (spA4[i].z * cosPitch);
pos.x = this->dyna.actor.posRot.pos.x + (spA4[i].x * cosYaw) + (sinYaw * pos.z);
pos.y = this->dyna.actor.posRot.pos.y + (spA4[i].y * cosPitch) + (-spA4[i].z * sinPitch);
pos.z = this->dyna.actor.posRot.pos.z + (spA4[i].x * -sinYaw) + (cosYaw * pos.z);
pos.x = this->dyna.actor.world.pos.x + (spA4[i].x * cosYaw) + (sinYaw * pos.z);
pos.y = this->dyna.actor.world.pos.y + (spA4[i].y * cosPitch) + (-spA4[i].z * sinPitch);
pos.z = this->dyna.actor.world.pos.z + (spA4[i].x * -sinYaw) + (cosYaw * pos.z);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_HEAVY_BLOCK, pos.x, pos.y, pos.z,
this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, 0, 2);
@@ -365,9 +365,9 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, GlobalContext* globalCtx) {
zOffset = Rand_CenteredFloat(110.0f);
cosYaw = Math_CosS(this->dyna.actor.shape.rot.y);
BgHeavyBlock_SpawnDust(globalCtx, (sinYaw * -70.0f) + (this->dyna.actor.posRot.pos.x + xOffset),
this->dyna.actor.posRot.pos.y + 10.0f,
(cosYaw * -70.0f) + (this->dyna.actor.posRot.pos.z + zOffset), 0.0f, -1.0f, 0.0f, 0xC);
BgHeavyBlock_SpawnDust(globalCtx, (sinYaw * -70.0f) + (this->dyna.actor.world.pos.x + xOffset),
this->dyna.actor.world.pos.y + 10.0f,
(cosYaw * -70.0f) + (this->dyna.actor.world.pos.z + zOffset), 0.0f, -1.0f, 0.0f, 0xC);
}
this->timer++;
@@ -388,14 +388,14 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) {
f32 raycastResult;
Actor_MoveForward(&this->dyna.actor);
pos.x = this->dyna.actor.initPosRot.pos.x;
pos.y = this->dyna.actor.initPosRot.pos.y + 1000.0f;
pos.z = this->dyna.actor.initPosRot.pos.z;
pos.x = this->dyna.actor.home.pos.x;
pos.y = this->dyna.actor.home.pos.y + 1000.0f;
pos.z = this->dyna.actor.home.pos.z;
raycastResult =
BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &pos);
this->dyna.actor.groundY = raycastResult;
this->dyna.actor.floorHeight = raycastResult;
if (this->dyna.actor.initPosRot.pos.y <= raycastResult) {
if (this->dyna.actor.home.pos.y <= raycastResult) {
func_800AA000(0.0f, 0xFF, 0x3C, 4);
switch (this->dyna.actor.params & 0xFF) {
@@ -414,7 +414,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) {
Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 999);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION);
return;
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
@@ -459,9 +459,9 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, GlobalContext* globalCtx) {
Math_StepToF(&this->dyna.actor.speedXZ, 0.0f, 20.0f);
Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f);
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos;
this->dyna.actor.world.pos = this->dyna.actor.home.pos;
Actor_MoveForward(&this->dyna.actor);
this->dyna.actor.initPosRot.pos = this->dyna.actor.posRot.pos;
this->dyna.actor.home.pos = this->dyna.actor.world.pos;
switch (this->dyna.actor.params & 0xFF) {
case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE:
BgHeavyBlock_SpawnDust(globalCtx, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f,
@@ -499,12 +499,12 @@ void BgHeavyBlock_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800D1694(player->leftHandPos.x, player->leftHandPos.y, player->leftHandPos.z, &thisx->shape.rot);
Matrix_Translate(-this->unk_164.x, -this->unk_164.y, -this->unk_164.z, MTXMODE_APPLY);
} else if ((thisx->gravity == 0.0f) && (BgHeavyBlock_Land == this->actionFunc)) {
func_800D1694(thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, &thisx->shape.rot);
func_800D1694(thisx->home.pos.x, thisx->home.pos.y, thisx->home.pos.z, &thisx->shape.rot);
Matrix_Translate(-D_80884ED4.x, -D_80884ED4.y, -D_80884ED4.z, MTXMODE_APPLY);
}
Matrix_MultVec3f(&D_80884EC8, &thisx->posRot.pos);
Matrix_MultVec3f(&D_80884ED4, &thisx->initPosRot.pos);
Matrix_MultVec3f(&D_80884EC8, &thisx->world.pos);
Matrix_MultVec3f(&D_80884ED4, &thisx->home.pos);
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_heavy_block.c", 931),
@@ -58,7 +58,7 @@ static BgHidanCurtainParams sHCParams[] = { { 81, 144, 0.090f, 144.0f, 5.0f }, {
const ActorInit Bg_Hidan_Curtain_InitVars = {
ACTOR_BG_HIDAN_CURTAIN,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgHidanCurtain),
@@ -74,7 +74,7 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHidanCurtainParams* hcParams;
osSyncPrintf("Curtain (arg_data 0x%04x)\n", this->actor.params);
Actor_SetHeight(&this->actor, 20.0f);
Actor_SetFocus(&this->actor, 20.0f);
this->type = (thisx->params >> 0xC) & 0xF;
if (this->type > 6) {
// Type is not set
@@ -97,9 +97,9 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, hcParams->scale);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->collider.dim.pos.x = this->actor.posRot.pos.x;
this->collider.dim.pos.y = this->actor.posRot.pos.y;
this->collider.dim.pos.z = this->actor.posRot.pos.z;
this->collider.dim.pos.x = this->actor.world.pos.x;
this->collider.dim.pos.y = this->actor.world.pos.y;
this->collider.dim.pos.z = this->actor.world.pos.z;
this->collider.dim.radius = hcParams->radius;
this->collider.dim.height = hcParams->height;
Collider_UpdateCylinder(&this->actor, &this->collider);
@@ -109,7 +109,7 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
this->actionFunc = BgHidanCurtain_WaitForSwitchOn;
if ((this->type == 4) || (this->type == 5)) {
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - hcParams->riseDist;
this->actor.world.pos.y = this->actor.home.pos.y - hcParams->riseDist;
}
}
if (((this->type == 1) && Flags_GetTreasure(globalCtx, this->treasureFlag)) ||
@@ -163,7 +163,7 @@ void BgHidanCurtain_WaitForSwitchOff(BgHidanCurtain* this, GlobalContext* global
void BgHidanCurtain_TurnOn(BgHidanCurtain* this, GlobalContext* globalCtx) {
f32 riseSpeed = sHCParams[this->size].riseSpeed;
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, riseSpeed)) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, riseSpeed)) {
Flags_UnsetSwitch(globalCtx, this->actor.params);
this->actionFunc = BgHidanCurtain_WaitForSwitchOn;
}
@@ -172,8 +172,7 @@ void BgHidanCurtain_TurnOn(BgHidanCurtain* this, GlobalContext* globalCtx) {
void BgHidanCurtain_TurnOff(BgHidanCurtain* this, GlobalContext* globalCtx) {
BgHidanCurtainParams* hcParams = &sHCParams[this->size];
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - hcParams->riseDist,
hcParams->riseSpeed)) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - hcParams->riseDist, hcParams->riseSpeed)) {
if ((this->type == 0) || (this->type == 6)) {
Actor_Kill(&this->actor);
} else if (this->type == 5) {
@@ -214,21 +213,18 @@ void BgHidanCurtain_Update(Actor* thisx, GlobalContext* globalCtx2) {
} else {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 1.0f);
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f);
}
if ((this->type == 4) || (this->type == 5)) {
this->actor.posRot.pos.y =
(2.0f * this->actor.initPosRot.pos.y) - hcParams->riseDist - this->actor.posRot.pos.y;
this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y;
}
this->actionFunc(this, globalCtx);
if ((this->type == 4) || (this->type == 5)) {
this->actor.posRot.pos.y =
(2.0f * this->actor.initPosRot.pos.y) - hcParams->riseDist - this->actor.posRot.pos.y;
this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y;
}
riseProgress =
(hcParams->riseDist - (this->actor.initPosRot.pos.y - this->actor.posRot.pos.y)) / hcParams->riseDist;
riseProgress = (hcParams->riseDist - (this->actor.home.pos.y - this->actor.world.pos.y)) / hcParams->riseDist;
this->alpha = 255.0f * riseProgress;
if (this->alpha > 50) {
this->collider.dim.height = hcParams->height * riseProgress;
@@ -20,7 +20,7 @@ void BgHidanDalm_Shrink(BgHidanDalm* this, GlobalContext* globalCtx);
const ActorInit Bg_Hidan_Dalm_InitVars = {
ACTOR_BG_HIDAN_DALM,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanDalm),
@@ -135,12 +135,12 @@ void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) ||
(this->collider.elements[1].info.bumperFlags & BUMP_HIT)) {
this->dyna.actor.posRot.rot.y -= 0x4000;
this->dyna.actor.world.rot.y -= 0x4000;
} else {
this->dyna.actor.posRot.rot.y += 0x4000;
this->dyna.actor.world.rot.y += 0x4000;
}
this->dyna.actor.posRot.pos.x += 32.5f * Math_SinS(this->dyna.actor.posRot.rot.y);
this->dyna.actor.posRot.pos.z += 32.5f * Math_CosS(this->dyna.actor.posRot.rot.y);
this->dyna.actor.world.pos.x += 32.5f * Math_SinS(this->dyna.actor.world.rot.y);
this->dyna.actor.world.pos.z += 32.5f * Math_CosS(this->dyna.actor.world.rot.y);
func_8002DF54(globalCtx, &this->dyna.actor, 8);
this->dyna.actor.flags |= 0x10;
@@ -169,13 +169,13 @@ void BgHidanDalm_Shrink(BgHidanDalm* this, GlobalContext* globalCtx) {
this->dyna.actor.scale.y = this->dyna.actor.scale.z = this->dyna.actor.scale.x;
pos.x = this->dyna.actor.posRot.pos.x;
pos.y = this->dyna.actor.posRot.pos.y + this->dyna.actor.scale.x * 160.0f;
pos.z = this->dyna.actor.posRot.pos.z;
pos.x = this->dyna.actor.world.pos.x;
pos.y = this->dyna.actor.world.pos.y + this->dyna.actor.scale.x * 160.0f;
pos.z = this->dyna.actor.world.pos.z;
for (i = 0; i < 4; i++) {
velocity.x = 5.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f;
velocity.z = 5.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f;
velocity.x = 5.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f;
velocity.z = 5.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f;
velocity.y = (Rand_ZeroOne() - 0.5f) * 1.5f;
EffectSsKiraKira_SpawnSmallYellow(globalCtx, &pos, &velocity, &accel);
}
@@ -186,7 +186,7 @@ void BgHidanDalm_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
Actor_MoveForward(&this->dyna.actor);
func_8002E4B4(globalCtx, &this->dyna.actor, 10.0f, 15.0f, 32.0f, 5);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 10.0f, 15.0f, 32.0f, 5);
}
/**
@@ -26,7 +26,7 @@ extern Gfx D_0600DA80[];
const ActorInit Bg_Hidan_Firewall_InitVars = {
ACTOR_BG_HIDAN_FIREWALL,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanFirewall),
@@ -74,7 +74,7 @@ void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->collider.dim.pos.y = this->actor.posRot.pos.y;
this->collider.dim.pos.y = this->actor.world.pos.y;
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
@@ -92,7 +92,7 @@ s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalC
Vec3f distance;
player = PLAYER;
func_8002DBD0(&this->actor, &distance, &player->actor.posRot.pos);
func_8002DBD0(&this->actor, &distance, &player->actor.world.pos);
if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) {
return 1;
@@ -151,7 +151,7 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext*
player = PLAYER;
func_8002DBD0(&this->actor, &sp30, &player->actor.posRot.pos);
func_8002DBD0(&this->actor, &sp30, &player->actor.world.pos);
if (sp30.x < -70.0f) {
sp30.x = -70.0f;
} else {
@@ -175,8 +175,8 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext*
}
sp28 = Math_SinS(this->actor.shape.rot.y);
temp_ret = Math_CosS(this->actor.shape.rot.y);
this->collider.dim.pos.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28;
this->collider.dim.pos.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret;
this->collider.dim.pos.x = this->actor.world.pos.x + sp30.x * temp_ret + sp30.z * sp28;
this->collider.dim.pos.z = this->actor.world.pos.z - sp30.x * sp28 + sp30.z * temp_ret;
}
void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -24,7 +24,7 @@ extern CollisionHeader D_0600E1E8;
const ActorInit Bg_Hidan_Fslift_InitVars = {
ACTOR_BG_HIDAN_FSLIFT,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanFslift),
@@ -51,8 +51,8 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(thisx, DPM_PLAYER);
CollisionHeader_GetVirtual(&D_0600E1E8, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x,
thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) {
if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->world.pos.x,
thisx->world.pos.y + 40.0f, thisx->world.pos.z + -28.0f, 0, 0, 0, 2) == NULL) {
Actor_Kill(thisx);
return;
}
@@ -63,9 +63,9 @@ void func_80886F24(BgHidanFslift* this) {
Actor* thisx = &this->dyna.actor;
if (thisx->child != NULL && thisx->child->update != NULL) {
thisx->child->posRot.pos.x = thisx->posRot.pos.x;
thisx->child->posRot.pos.y = thisx->posRot.pos.y + 40.0f;
thisx->child->posRot.pos.z = thisx->posRot.pos.z + -28.0f;
thisx->child->world.pos.x = thisx->world.pos.x;
thisx->child->world.pos.y = thisx->world.pos.y + 40.0f;
thisx->child->world.pos.z = thisx->world.pos.z + -28.0f;
return;
}
thisx->child = NULL;
@@ -90,7 +90,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) {
if (this->unk_168 == 0) {
heightBool = false;
if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) {
if ((thisx->world.pos.y - thisx->home.pos.y) < 0.5f) {
heightBool = true;
}
if (func_80043590(thisx)) {
@@ -108,7 +108,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) {
void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 4.0f)) {
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 4.0f)) {
Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this);
} else {
@@ -121,7 +121,7 @@ void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
if (func_80043590(thisx)) {
if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 790.0f, 4.0f)) {
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y + 790.0f, 4.0f)) {
Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND);
func_80886FB4(this);
} else {
@@ -30,7 +30,7 @@ extern Gfx D_04017BD0[];
const ActorInit Bg_Hidan_Fwbig_InitVars = {
ACTOR_BG_HIDAN_FWBIG,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanFwbig),
@@ -76,14 +76,14 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->direction = (u16)(thisx->params >> 8);
thisx->params &= 0xFF;
if (this->direction != 0) {
this->actor.initPosRot.pos.x = 1560.0f;
this->actor.initPosRot.pos.z = 0.0f;
if (player->actor.posRot.pos.z > 300.0f) {
this->actor.home.pos.x = 1560.0f;
this->actor.home.pos.z = 0.0f;
if (player->actor.world.pos.z > 300.0f) {
this->direction = -1;
this->actor.initPosRot.rot.y = this->actor.shape.rot.y = -0x4E38;
} else if (player->actor.posRot.pos.z < -300.0f) {
this->actor.home.rot.y = this->actor.shape.rot.y = -0x4E38;
} else if (player->actor.world.pos.z < -300.0f) {
this->direction = 1;
this->actor.initPosRot.rot.y = this->actor.shape.rot.y = -0x31C8;
this->actor.home.rot.y = this->actor.shape.rot.y = -0x31C8;
} else {
Actor_Kill(&this->actor);
return;
@@ -94,7 +94,7 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->actor.flags |= 0x10;
this->moveState = FWBIG_MOVE;
this->actionFunc = BgHidanFwbig_WaitForPlayer;
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - (2400.0f * this->actor.scale.y);
this->actor.world.pos.y = this->actor.home.pos.y - (2400.0f * this->actor.scale.y);
} else {
Actor_SetScale(&this->actor, 0.1f);
this->actionFunc = BgHidanFwbig_WaitForSwitch;
@@ -111,8 +111,8 @@ void BgHidanFwbig_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgHidanFwbig_UpdatePosition(BgHidanFwbig* this) {
s16 startAngle = this->actor.shape.rot.y + this->direction * -0x4000;
this->actor.posRot.pos.x = (Math_SinS(startAngle) * 885.4f) + this->actor.initPosRot.pos.x;
this->actor.posRot.pos.z = (Math_CosS(startAngle) * 885.4f) + this->actor.initPosRot.pos.z;
this->actor.world.pos.x = (Math_SinS(startAngle) * 885.4f) + this->actor.home.pos.x;
this->actor.world.pos.z = (Math_CosS(startAngle) * 885.4f) + this->actor.home.pos.z;
}
void BgHidanFwbig_WaitForSwitch(BgHidanFwbig* this, GlobalContext* globalCtx) {
@@ -130,7 +130,7 @@ void BgHidanFwbig_WaitForCs(BgHidanFwbig* this, GlobalContext* globalCtx) {
}
void BgHidanFwbig_Rise(BgHidanFwbig* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 10.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 10.0f)) {
if (this->direction == 0) {
Flags_UnsetSwitch(globalCtx, this->actor.params);
this->actionFunc = BgHidanFwbig_WaitForSwitch;
@@ -141,8 +141,7 @@ void BgHidanFwbig_Rise(BgHidanFwbig* this, GlobalContext* globalCtx) {
}
void BgHidanFwbig_Lower(BgHidanFwbig* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - (2400.0f * this->actor.scale.y),
10.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - (2400.0f * this->actor.scale.y), 10.0f)) {
if (this->direction == 0) {
this->actionFunc = BgHidanFwbig_WaitForTimer;
this->timer = 150;
@@ -153,7 +152,7 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y -= (this->direction * 0x1800);
} else {
this->moveState = FWBIG_MOVE;
this->actor.shape.rot.y = this->actor.initPosRot.rot.y;
this->actor.shape.rot.y = this->actor.home.rot.y;
}
BgHidanFwbig_UpdatePosition(this);
this->actionFunc = BgHidanFwbig_Rise;
@@ -174,7 +173,7 @@ void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, GlobalContext* globalCtx) {
void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (player->actor.posRot.pos.x < 1150.0f) {
if (player->actor.world.pos.x < 1150.0f) {
this->actionFunc = BgHidanFwbig_Rise;
func_800800F8(globalCtx, 0xCDA, -0x63, &this->actor, 0);
}
@@ -182,8 +181,7 @@ void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, GlobalContext* globalCtx) {
void BgHidanFwbig_Move(BgHidanFwbig* this, GlobalContext* globalCtx) {
if (!Player_InCsMode(globalCtx)) {
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y + (this->direction * 0x6390),
0x20)) {
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->direction * 0x6390), 0x20)) {
this->moveState = FWBIG_RESET;
this->actionFunc = BgHidanFwbig_Lower;
} else {
@@ -198,7 +196,7 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, GlobalContext* globalCtx) {
f32 cs;
f32 sn;
func_8002DBD0(&this->actor, &projPos, &player->actor.posRot.pos);
func_8002DBD0(&this->actor, &projPos, &player->actor.world.pos);
projPos.z = ((projPos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f;
if (this->direction == 0) {
projPos.x = CLAMP(projPos.x, -360.0f, 360.0f);
@@ -208,11 +206,11 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, GlobalContext* globalCtx) {
sn = Math_SinS(this->actor.shape.rot.y);
cs = Math_CosS(this->actor.shape.rot.y);
this->collider.dim.pos.x = this->actor.posRot.pos.x + (projPos.x * cs) + (projPos.z * sn);
this->collider.dim.pos.z = this->actor.posRot.pos.z - (projPos.x * sn) + (projPos.z * cs);
this->collider.dim.pos.y = this->actor.posRot.pos.y;
this->collider.dim.pos.x = this->actor.world.pos.x + (projPos.x * cs) + (projPos.z * sn);
this->collider.dim.pos.z = this->actor.world.pos.z - (projPos.x * sn) + (projPos.z * cs);
this->collider.dim.pos.y = this->actor.world.pos.y;
this->actor.posRot.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000;
this->actor.world.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000;
}
void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -221,7 +219,7 @@ void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.posRot.rot.y, 1.0f);
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f);
if (this->direction != 0) {
this->actionFunc = BgHidanFwbig_Lower;
}
@@ -233,10 +231,10 @@ void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if ((this->actor.initPosRot.pos.y - 200.0f) < this->actor.posRot.pos.y) {
if ((this->actor.home.pos.y - 200.0f) < this->actor.world.pos.y) {
if (gSaveContext.sceneSetupIndex < 4) {
func_8002F974(&this->actor, NA_SE_EV_BURNING - SFX_FLAG);
} else if ((s16)this->actor.posRot.pos.x == -513) {
} else if ((s16)this->actor.world.pos.x == -513) {
func_8002F974(&this->actor, NA_SE_EV_FLAME_OF_FIRE - SFX_FLAG);
}
BgHidanFwbig_MoveCollider(this, globalCtx);
@@ -258,7 +256,7 @@ void BgHidanFwbig_Draw(Actor* thisx, GlobalContext* globalCtx) {
height = thisx->scale.y * 2400.0f;
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 220, 0,
((height - (thisx->initPosRot.pos.y - thisx->posRot.pos.y)) * 255.0f) / height);
((height - (thisx->home.pos.y - thisx->world.pos.y)) * 255.0f) / height);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
@@ -70,7 +70,7 @@ static ColliderTrisInit sTrisInit = {
const ActorInit Bg_Hidan_Hamstep_InitVars = {
ACTOR_BG_HIDAN_HAMSTEP,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanHamstep),
@@ -109,20 +109,20 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx)
GlobalContext* globalCtx2 = globalCtx;
pos = pos; // Required to match
pos.y = this->dyna.actor.initPosRot.pos.y - 100.0f;
pos.y = this->dyna.actor.home.pos.y - 100.0f;
sin = Math_SinS(this->dyna.actor.shape.rot.y + 0x8000);
cos = Math_CosS(this->dyna.actor.shape.rot.y + 0x8000);
for (i = 0; i < 5; i++) {
pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.initPosRot.pos.x;
pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.initPosRot.pos.z;
pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.home.pos.x;
pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z;
params = ((i + 1) & 0xFF);
params |= (this->dyna.actor.params & 0xFF00);
step = (BgHidanHamstep*)Actor_SpawnAsChild(
&globalCtx2->actorCtx, &step->dyna.actor, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z,
this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, params);
this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, params);
if (step == NULL) {
return 0;
@@ -149,9 +149,9 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i < 2; i++) {
for (i2 = 0; i2 < 3; i2++) {
sp48[i2].x = sTrisInit.elements[i].dim.vtx[i2].x + this->dyna.actor.initPosRot.pos.x;
sp48[i2].y = sTrisInit.elements[i].dim.vtx[i2].y + this->dyna.actor.initPosRot.pos.y;
sp48[i2].z = sTrisInit.elements[i].dim.vtx[i2].z + this->dyna.actor.initPosRot.pos.z;
sp48[i2].x = sTrisInit.elements[i].dim.vtx[i2].x + this->dyna.actor.home.pos.x;
sp48[i2].y = sTrisInit.elements[i].dim.vtx[i2].y + this->dyna.actor.home.pos.y;
sp48[i2].z = sTrisInit.elements[i].dim.vtx[i2].z + this->dyna.actor.home.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]);
}
@@ -167,11 +167,11 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0xFF)) {
if ((this->dyna.actor.params & 0xFF) == 0) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + (-20.0f);
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f);
BgHidanHamstep_SetupAction(this, 4);
} else {
this->dyna.actor.posRot.pos.y =
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y =
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y;
BgHidanHamstep_SetupAction(this, 4);
}
} else if ((this->dyna.actor.params & 0xFF) == 0) {
@@ -212,7 +212,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) {
Vec3f pos = step->dyna.actor.posRot.pos;
Vec3f pos = step->dyna.actor.world.pos;
s32 i;
f32 sin;
f32 cos;
@@ -224,11 +224,11 @@ void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) {
sin = Math_SinS(step->dyna.actor.shape.rot.y + 0x8000);
cos = Math_CosS(step->dyna.actor.shape.rot.y + 0x8000);
pos.y = step->dyna.actor.posRot.pos.y;
pos.y = step->dyna.actor.world.pos.y;
for (i = 0; i < ARRAY_COUNT(sEffectPositions); i++) {
pos.x = (sEffectPositions[i][1] * sin) + (sEffectPositions[i][0] * cos) + step->dyna.actor.posRot.pos.x;
pos.z = ((sEffectPositions[i][1] * cos) - (sEffectPositions[i][0] * sin)) + step->dyna.actor.posRot.pos.z;
pos.x = (sEffectPositions[i][1] * sin) + (sEffectPositions[i][0] * cos) + step->dyna.actor.world.pos.x;
pos.z = ((sEffectPositions[i][1] * cos) - (sEffectPositions[i][0] * sin)) + step->dyna.actor.world.pos.z;
func_80033480(globalCtx, &pos, 0.0f, 0, 150, 150, 0);
}
}
@@ -248,18 +248,18 @@ void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) {
BgHidanHamstep* child;
if ((this->dyna.actor.params & 0xFF) >= 2) {
if (parent->dyna.actor.posRot.pos.y < this->dyna.actor.posRot.pos.y) {
this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y;
} else if ((this->dyna.actor.posRot.pos.y - parent->dyna.actor.posRot.pos.y) < -100.0f) {
this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y - 100.0f;
if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) {
this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y;
} else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) {
this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f;
}
}
child = (BgHidanHamstep*)this->dyna.actor.child;
while (child != NULL) {
if (this->dyna.actor.posRot.pos.y < child->dyna.actor.posRot.pos.y) {
child->dyna.actor.posRot.pos.y = this->dyna.actor.posRot.pos.y;
if (this->dyna.actor.world.pos.y < child->dyna.actor.world.pos.y) {
child->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y;
}
child = (BgHidanHamstep*)child->dyna.actor.child;
}
@@ -273,9 +273,9 @@ void func_80888734(BgHidanHamstep* this) {
this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y;
if ((this->dyna.actor.params & 0xFF) == 1) {
this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y - 100.0f;
this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f;
} else {
this->dyna.actor.posRot.pos.y += (this->dyna.actor.velocity.y * factor);
this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * factor);
}
func_80888694(this, parent);
@@ -301,13 +301,12 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) {
Actor_MoveForward(&this->dyna.actor);
if (((this->dyna.actor.posRot.pos.y - this->dyna.actor.initPosRot.pos.y) <
(-20.0f - this->dyna.actor.minVelocityY)) &&
if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) < (-20.0f - this->dyna.actor.minVelocityY)) &&
(this->dyna.actor.velocity.y <= 0.0f)) {
this->unk_244++;
if (this->unk_244 >= 7) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -20.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -20.0f;
BgHidanHamstep_SetupAction(this, 4);
} else {
this->dyna.actor.velocity.y *= -0.24f;
@@ -320,7 +319,7 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) {
Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0);
Quake_SetCountdown(quakeIndex, 20);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
func_800AA000(this->dyna.actor.xyzDistToLinkSq, 255, 20, 150);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
func_80888638(this, globalCtx);
osSyncPrintf("A(%d)\n", this->dyna.actor.params);
}
@@ -336,8 +335,8 @@ void func_808889B8(BgHidanHamstep* this, GlobalContext* globalCtx) {
if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) {
if ((this->dyna.actor.params & 0xFF) == 1) {
this->dyna.actor.posRot.pos.y =
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y =
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y;
BgHidanHamstep_SetupAction(this, 4);
} else {
BgHidanHamstep_SetupAction(this, 3);
@@ -359,14 +358,14 @@ void func_80888A58(BgHidanHamstep* this, GlobalContext* globalCtx) {
osSyncPrintf("%s %d\n", "../z_bg_hidan_hamstep.c", 696);
}
if (((this->dyna.actor.posRot.pos.y - this->dyna.actor.initPosRot.pos.y) <=
if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <=
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) &&
(this->dyna.actor.velocity.y <= 0.0f)) {
this->unk_244++;
if (this->unk_244 >= 7) {
this->dyna.actor.posRot.pos.y =
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y =
sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y;
BgHidanHamstep_SetupAction(this, 3);
} else {
this->dyna.actor.velocity.y *= -0.24f;
@@ -20,7 +20,7 @@ extern UNK_TYPE D_0600D054;
/*
const ActorInit Bg_Hidan_Hrock_InitVars = {
ACTOR_BG_HIDAN_HROCK,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanHrock),
@@ -26,7 +26,7 @@ static f32 D_80889E40[] = { 120.0f, 150.0f, 150.0f };
const ActorInit Bg_Hidan_Kousi_InitVars = {
ACTOR_BG_HIDAN_KOUSI,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanKousi),
@@ -71,7 +71,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, DPM_UNK);
Actor_SetHeight(thisx, 50.0f);
Actor_SetFocus(thisx, 50.0f);
osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF,
((s32)thisx->params >> 8) & 0xFF);
@@ -82,7 +82,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(D_80889E70[thisx->params & 0xFF], &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
thisx->posRot.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y;
thisx->world.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y;
if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0xFF)) {
func_80889ACC(this);
BgHidanKousi_SetupAction(this, func_80889D28);
@@ -98,13 +98,13 @@ void BgHidanKousi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80889ACC(BgHidanKousi* this) {
s32 pad[2];
Vec3s* rot = &this->dyna.actor.posRot.rot;
Vec3s* rot = &this->dyna.actor.world.rot;
f32 temp1 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_SinS(rot->y);
f32 temp2 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_CosS(rot->y);
Vec3f* initPos = &this->dyna.actor.initPosRot.pos;
Vec3f* initPos = &this->dyna.actor.home.pos;
this->dyna.actor.posRot.pos.x = initPos->x + temp1;
this->dyna.actor.posRot.pos.z = initPos->z + temp2;
this->dyna.actor.world.pos.x = initPos->x + temp1;
this->dyna.actor.world.pos.z = initPos->z + temp2;
}
void func_80889B5C(BgHidanKousi* this, GlobalContext* globalCtx) {
@@ -117,7 +117,7 @@ void func_80889B5C(BgHidanKousi* this, GlobalContext* globalCtx) {
void func_80889BC0(BgHidanKousi* this, GlobalContext* globalCtx) {
this->unk_168 -= 1;
if (this->dyna.actor.type == func_8005B198() || (this->unk_168 <= 0)) {
if (this->dyna.actor.category == func_8005B198() || (this->unk_168 <= 0)) {
BgHidanKousi_SetupAction(this, func_80889C18);
}
}
@@ -135,7 +135,7 @@ void func_80889C18(BgHidanKousi* this, GlobalContext* globalCtx) {
void func_80889C90(BgHidanKousi* this, GlobalContext* globalCtx) {
func_8002D7EC(&this->dyna.actor);
if (D_80889E40[this->dyna.actor.params & 0xFF] <
Math_Vec3f_DistXYZ(&this->dyna.actor.initPosRot.pos, &this->dyna.actor.posRot.pos)) {
Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) {
func_80889ACC(this);
BgHidanKousi_SetupAction(this, func_80889D28);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP);
@@ -26,7 +26,7 @@ extern Gfx D_05000530[];
const ActorInit Bg_Hidan_Kowarerukabe_InitVars = {
ACTOR_BG_HIDAN_KOWARERUKABE,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanKowarerukabe),
@@ -95,8 +95,7 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, GlobalCon
void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) {
static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f };
this->dyna.actor.posRot.pos.y =
actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y = actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.home.pos.y;
}
static InitChainEntry sInitChain[] = {
@@ -144,14 +143,14 @@ void BgHidanKowarerukabe_SpawnDust(BgHidanKowarerukabe* this, GlobalContext* glo
s32 pad;
Vec3f pos;
pos = this->dyna.actor.posRot.pos;
pos = this->dyna.actor.world.pos;
pos.y += 10.0f;
func_80033480(globalCtx, &pos, 0.0f, 0, 600, 300, 1);
pos.x = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.posRot.pos.x;
pos.y = (Rand_ZeroOne() * 100.0f) + this->dyna.actor.posRot.pos.y;
pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.posRot.pos.z;
pos.x = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.world.pos.x;
pos.y = (Rand_ZeroOne() * 100.0f) + this->dyna.actor.world.pos.y;
pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.world.pos.z;
func_80033480(globalCtx, &pos, 100.0f, 4, 200, 250, 1);
}
@@ -169,15 +168,15 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl
f32 tmp2;
s16 arg9;
pos.y = thisx->posRot.pos.y + 10.0f;
pos.y = thisx->world.pos.y + 10.0f;
for (i = 0; i < 5; i++) {
for (j = 0; j < 5; j++) {
tmp1 = 24 * (i - 2);
tmp2 = 24 * (j - 2);
pos.x = (tmp2 * sin) + (tmp1 * cos) + thisx->posRot.pos.x;
pos.z = (tmp2 * cos) - (tmp1 * sin) + thisx->posRot.pos.z;
pos.x = (tmp2 * sin) + (tmp1 * cos) + thisx->world.pos.x;
pos.z = (tmp2 * cos) - (tmp1 * sin) + thisx->world.pos.z;
tmp1 = 8.0f * Rand_ZeroOne() * (i - 2);
tmp2 = 8.0f * Rand_ZeroOne() * (j - 2);
@@ -190,8 +189,8 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl
arg5 = (((i == 0) || (i == 4)) && ((j == 0) || (j == 4))) ? 65 : 64;
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot.pos, -550, arg5, 15, 15, 0, arg9, 2, 16,
100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530);
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -550, arg5, 15, 15, 0, arg9, 2, 16, 100,
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530);
}
}
}
@@ -210,12 +209,12 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) {
s16 arg9;
for (i = 0; i < 5; i++) {
pos.y = (20 * i) + thisx->posRot.pos.y;
pos.y = (20 * i) + thisx->world.pos.y;
for (j = 0; j < 5; j++) {
tmp1 = 16 * (j - 2);
pos.x = (tmp1 * cos) + thisx->posRot.pos.x;
pos.z = -(tmp1 * sin) + thisx->posRot.pos.z;
pos.x = (tmp1 * cos) + thisx->world.pos.x;
pos.z = -(tmp1 * sin) + thisx->world.pos.z;
tmp1 = 3.0f * Rand_ZeroOne() * (j - 2);
tmp2 = 6.0f * Rand_ZeroOne();
@@ -231,8 +230,8 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) {
arg5 |= 1;
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot.pos, -540, arg5, 20, 20, 0, arg9, 2, 32,
100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530);
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -540, arg5, 20, 20, 0, arg9, 2, 32, 100,
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530);
}
}
}
@@ -251,12 +250,12 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext
s16 arg9;
for (i = 0; i < 5; i++) {
pos.y = (24 * i) + thisx->posRot.pos.y;
pos.y = (24 * i) + thisx->world.pos.y;
for (j = 0; j < 5; j++) {
tmp1 = 28 * (j - 2);
pos.x = (tmp1 * cos) + thisx->posRot.pos.x;
pos.z = -(tmp1 * sin) + thisx->posRot.pos.z;
pos.x = (tmp1 * cos) + thisx->world.pos.x;
pos.z = -(tmp1 * sin) + thisx->world.pos.z;
tmp1 = 6.0f * Rand_ZeroOne() * (j - 2);
tmp2 = 6.0f * Rand_ZeroOne();
@@ -272,7 +271,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext
arg5 |= 1;
}
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot, -650, arg5, 20, 20, 0, arg9, 2, 32, 100,
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world, -650, arg5, 20, 20, 0, arg9, 2, 32, 100,
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530);
}
}
@@ -303,9 +302,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, GlobalContext* globalCtx) {
Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F);
if ((this->dyna.actor.params & 0xFF) == 0) {
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_EXPLOSION);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION);
} else {
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
}
func_80078884(NA_SE_SY_CORRECT_CHIME);
@@ -18,7 +18,7 @@ extern UNK_TYPE D_0600DF78;
/*
const ActorInit Bg_Hidan_Rock_InitVars = {
ACTOR_BG_HIDAN_ROCK,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanRock),
@@ -11,7 +11,7 @@ void BgHidanRsekizou_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Hidan_Rsekizou_InitVars = {
ACTOR_BG_HIDAN_RSEKIZOU,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanRsekizou),
@@ -167,13 +167,11 @@ void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) {
sphere = &this->collider.elements[i];
sphere->dim.worldSphere.center.x = this->dyna.actor.initPosRot.pos.x +
yawCosine * sphere->dim.modelSphere.center.x +
sphere->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + yawCosine * sphere->dim.modelSphere.center.x +
yawSine * sphere->dim.modelSphere.center.z;
sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.initPosRot.pos.y + sphere->dim.modelSphere.center.y;
sphere->dim.worldSphere.center.z =
(this->dyna.actor.initPosRot.pos.z - yawSine * sphere->dim.modelSphere.center.x) +
yawCosine * sphere->dim.modelSphere.center.z;
sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + sphere->dim.modelSphere.center.y;
sphere->dim.worldSphere.center.z = (this->dyna.actor.home.pos.z - yawSine * sphere->dim.modelSphere.center.x) +
yawCosine * sphere->dim.modelSphere.center.z;
}
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
@@ -208,9 +206,9 @@ Gfx* BgHidanRsekizou_DrawFireball(GlobalContext* globalCtx, BgHidanRsekizou* thi
mf->xx = mf->yy = mf->zz = (0.7f * fVar6) + 0.5f;
tmpf7 = (((((0.7f * fVar6) + 0.5f) * 10.0f) * fVar6) + 20.0f);
mf->wx = (tmpf7 * sins) + this->dyna.actor.posRot.pos.x;
mf->wy = (this->dyna.actor.posRot.pos.y + 30.0f) + (0.699999988079f * fVar6);
mf->wz = (tmpf7 * coss) + this->dyna.actor.posRot.pos.z;
mf->wx = (tmpf7 * sins) + this->dyna.actor.world.pos.x;
mf->wy = (this->dyna.actor.world.pos.y + 30.0f) + (0.699999988079f * fVar6);
mf->wz = (tmpf7 * coss) + this->dyna.actor.world.pos.z;
gSPMatrix(displayList++,
Matrix_MtxFToMtx(Matrix_CheckFloats(mf, "../z_bg_hidan_rsekizou.c", 543),
@@ -17,7 +17,7 @@ extern UNK_TYPE D_0600DC30;
/*
const ActorInit Bg_Hidan_Sekizou_InitVars = {
ACTOR_BG_HIDAN_SEKIZOU,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanSekizou),
@@ -18,7 +18,7 @@ extern UNK_TYPE D_060120E8;
/*
const ActorInit Bg_Hidan_Sima_InitVars = {
ACTOR_BG_HIDAN_SIMA,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanSima),
@@ -21,7 +21,7 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx);
const ActorInit Bg_Hidan_Syoku_InitVars = {
ACTOR_BG_HIDAN_SYOKU,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanSyoku),
@@ -48,7 +48,7 @@ void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&D_0600E568, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->actionFunc = func_8088F4B8;
this->dyna.actor.initPosRot.pos.y += 540.0f;
this->dyna.actor.home.pos.y += 540.0f;
}
void BgHidanSyoku_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -74,7 +74,7 @@ void func_8088F514(BgHidanSyoku* this, GlobalContext* globalCtx) {
if (this->unk_16A != 0) {
this->unk_16A -= 1;
}
this->dyna.actor.posRot.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->dyna.actor.home.pos.y;
if (this->unk_16A == 0) {
func_8088F47C(this);
} else {
@@ -86,7 +86,7 @@ void func_8088F5A0(BgHidanSyoku* this, GlobalContext* globalCtx) {
if (this->unk_16A != 0) {
this->unk_16A -= 1;
}
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f);
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f);
if (this->unk_16A == 0) {
func_8088F47C(this);
} else {
@@ -100,7 +100,7 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx) {
}
if (this->unk_16A == 0) {
this->unk_16A = 0x8c;
if (this->dyna.actor.posRot.pos.y < this->dyna.actor.initPosRot.pos.y) {
if (this->dyna.actor.world.pos.y < this->dyna.actor.home.pos.y) {
this->actionFunc = func_8088F514;
} else {
this->actionFunc = func_8088F5A0;
@@ -29,7 +29,7 @@ static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
const ActorInit Bg_Ice_Objects_InitVars = {
ACTOR_BG_ICE_OBJECTS,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_ICE_OBJECTS,
sizeof(BgIceObjects),
@@ -51,7 +51,7 @@ void BgIceObjects_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_060003F0, &colHeader);
Math_Vec3f_Copy(&this->targetPos, &this->dyna.actor.initPosRot.pos);
Math_Vec3f_Copy(&this->targetPos, &this->dyna.actor.home.pos);
this->actionFunc = BgIceObjects_Idle;
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->dyna.actor.params = 0;
@@ -89,7 +89,7 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) {
s32 i;
if ((this->dyna.unk_158 == 0) || (this->dyna.unk_158 == -0x8000)) {
x16 = this->dyna.actor.posRot.pos.x;
x16 = this->dyna.actor.world.pos.x;
for (i = 0; i < 7; i++) {
if (x16 == sXStarts[i]) {
z16 = (this->dyna.unk_158 == 0) ? sZStops[i][0] : sZStops[i][1];
@@ -99,7 +99,7 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) {
}
this->targetPos.z = (this->dyna.unk_158 == 0) ? -340 : -1260;
} else {
z16 = this->dyna.actor.posRot.pos.z;
z16 = this->dyna.actor.world.pos.z;
for (i = 0; i < 7; i++) {
if (z16 == sZStarts[i]) {
x16 = (this->dyna.unk_158 == 0x4000) ? sXStops[i][0] : sXStops[i][1];
@@ -117,17 +117,17 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) {
void BgIceObjects_CheckPits(BgIceObjects* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
if ((thisx->velocity.y > 0.0f) || ((thisx->posRot.pos.x <= -1660.0f) && (thisx->posRot.pos.z <= -1060.0f)) ||
((thisx->posRot.pos.x <= -1580.0f) && (thisx->posRot.pos.z >= -420.0f)) ||
((thisx->posRot.pos.x >= -980.0f) && (thisx->posRot.pos.z <= -1180.0f)) ||
((thisx->posRot.pos.x >= -860.0f) && (thisx->posRot.pos.z >= -700.0f))) {
if ((thisx->velocity.y > 0.0f) || ((thisx->world.pos.x <= -1660.0f) && (thisx->world.pos.z <= -1060.0f)) ||
((thisx->world.pos.x <= -1580.0f) && (thisx->world.pos.z >= -420.0f)) ||
((thisx->world.pos.x >= -980.0f) && (thisx->world.pos.z <= -1180.0f)) ||
((thisx->world.pos.x >= -860.0f) && (thisx->world.pos.z >= -700.0f))) {
thisx->velocity.y += 1.0f;
if (Math_StepToF(&thisx->posRot.pos.y, -300.0f, thisx->velocity.y)) {
if (Math_StepToF(&thisx->world.pos.y, -300.0f, thisx->velocity.y)) {
thisx->velocity.y = 0.0f;
thisx->posRot.pos.x = thisx->initPosRot.pos.x;
thisx->posRot.pos.y = thisx->initPosRot.pos.y - 60.0f;
thisx->posRot.pos.z = thisx->initPosRot.pos.z;
thisx->world.pos.x = thisx->home.pos.x;
thisx->world.pos.y = thisx->home.pos.y - 60.0f;
thisx->world.pos.z = thisx->home.pos.z;
if (thisx->params != 0) {
func_8002DF54(globalCtx, thisx, 7);
}
@@ -144,7 +144,7 @@ void BgIceObjects_Idle(BgIceObjects* this, GlobalContext* globalCtx) {
player->stateFlags2 &= ~0x10;
if ((this->dyna.unk_150 > 0.0f) && !Player_InCsMode(globalCtx)) {
BgIceObjects_SetNextTarget(this, globalCtx);
if (func_8002DBB0(thisx, &this->targetPos) > 1.0f) {
if (Actor_WorldDistXZToPoint(thisx, &this->targetPos) > 1.0f) {
thisx->flags |= 0x10;
func_8002DF54(globalCtx, thisx, 8);
thisx->params = 1;
@@ -166,39 +166,35 @@ void BgIceObjects_Slide(BgIceObjects* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor;
Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f);
atTarget = Math_StepToF(&thisx->posRot.pos.x, this->targetPos.x, thisx->speedXZ);
atTarget &= Math_StepToF(&thisx->posRot.pos.z, this->targetPos.z, thisx->speedXZ);
atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ);
atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ);
if (atTarget) {
thisx->speedXZ = 0.0f;
this->targetPos.x = thisx->posRot.pos.x;
this->targetPos.z = thisx->posRot.pos.z;
this->targetPos.x = thisx->world.pos.x;
this->targetPos.z = thisx->world.pos.z;
if (thisx->velocity.y <= 0.0f) {
thisx->flags &= ~0x10;
}
thisx->params = 0;
func_8002DF54(globalCtx, thisx, 7);
Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND);
if ((fabsf(thisx->posRot.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->posRot.pos.z + 260.0f) < 1.0f)) {
if ((fabsf(thisx->world.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->world.pos.z + 260.0f) < 1.0f)) {
this->actionFunc = BgIceObjects_Stuck;
} else {
this->actionFunc = BgIceObjects_Idle;
}
} else if ((thisx->speedXZ > 6.0f) && (thisx->posRot.pos.y >= 0.0f)) {
} else if ((thisx->speedXZ > 6.0f) && (thisx->world.pos.y >= 0.0f)) {
spread = Rand_CenteredFloat(120.0f);
velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158);
velocity.y = Rand_ZeroOne() + 1.0f;
velocity.z = -(1.5f + Rand_ZeroOne()) * Math_CosS(this->dyna.unk_158);
pos.x =
thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread);
pos.z =
thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread);
pos.y = thisx->posRot.pos.y;
pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread);
pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread);
pos.y = thisx->world.pos.y;
func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15));
spread = Rand_CenteredFloat(120.0f);
pos.x =
thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread);
pos.z =
thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread);
pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread);
pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread);
func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15));
func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG);
}
@@ -213,9 +209,9 @@ void BgIceObjects_Reset(BgIceObjects* this, GlobalContext* globalCtx) {
player->stateFlags2 &= ~0x10;
this->dyna.unk_150 = 0.0f;
}
if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 1.0f)) {
if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) {
thisx->flags &= ~0x10;
Math_Vec3f_Copy(&this->targetPos, &thisx->initPosRot.pos);
Math_Vec3f_Copy(&this->targetPos, &thisx->home.pos);
this->actionFunc = BgIceObjects_Idle;
thisx->speedXZ = 0.0f;
}
@@ -18,7 +18,7 @@ extern UNK_TYPE D_06002920;
/*
const ActorInit Bg_Ice_Shelter_InitVars = {
ACTOR_BG_ICE_SHELTER,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_ICE_OBJECTS,
sizeof(BgIceShelter),
@@ -21,7 +21,7 @@ void func_80891DD4(BgIceShutter* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Ice_Shutter_InitVars = {
ACTOR_BG_ICE_SHUTTER,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_ICE_OBJECTS,
sizeof(BgIceShutter),
@@ -42,12 +42,10 @@ void func_80891AC0(BgIceShutter* this) {
f32 sp24;
sp24 = Math_SinS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y;
this->dyna.actor.posRot.pos.y =
(Math_CosS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.posRot.pos.x =
(Math_SinS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot.pos.z =
(Math_CosS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.z;
this->dyna.actor.world.pos.y =
(Math_CosS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.home.pos.y;
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.home.pos.z;
}
void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -85,13 +83,13 @@ void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
if (sp28 == 2) {
temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f;
this->dyna.actor.posRot2.pos.x =
(Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot2.pos.y = this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.posRot2.pos.z =
this->dyna.actor.initPosRot.pos.z + (Math_CosS(this->dyna.actor.shape.rot.y) * temp_f6);
this->dyna.actor.focus.pos.x =
(Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.home.pos.x;
this->dyna.actor.focus.pos.y = this->dyna.actor.home.pos.y;
this->dyna.actor.focus.pos.z =
this->dyna.actor.home.pos.z + (Math_CosS(this->dyna.actor.shape.rot.y) * temp_f6);
} else {
Actor_SetHeight(&this->dyna.actor, 50.0f);
Actor_SetFocus(&this->dyna.actor, 50.0f);
}
}
@@ -103,7 +101,7 @@ void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) {
if (Flags_GetTempClear(globalCtx, this->dyna.actor.room)) {
Flags_SetClear(globalCtx, this->dyna.actor.room);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80891DD4;
if (this->dyna.actor.shape.rot.x == 0) {
func_80080480(globalCtx, &this->dyna.actor);
@@ -113,7 +111,7 @@ void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) {
void func_80891D6C(BgIceShutter* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) {
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80891DD4;
func_80080480(globalCtx, &this->dyna.actor);
}
@@ -46,7 +46,7 @@ extern CollisionHeader D_06002594;
const ActorInit Bg_Ice_Turara_InitVars = {
ACTOR_BG_ICE_TURARA,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_ICE_OBJECTS,
sizeof(BgIceTurara),
@@ -79,7 +79,7 @@ void BgIceTurara_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = BgIceTurara_Stalagmite;
} else {
this->dyna.actor.shape.rot.x = -0x8000;
this->dyna.actor.shape.unk_08 = 1200.0f;
this->dyna.actor.shape.yOffset = 1200.0f;
this->actionFunc = BgIceTurara_Wait;
}
}
@@ -100,12 +100,12 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) {
s32 j;
s32 i;
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_ICE_BROKEN);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < 2; i++) {
for (j = 0; j < 10; j++) {
pos.x = this->dyna.actor.posRot.pos.x + Rand_CenteredFloat(8.0f);
pos.y = this->dyna.actor.posRot.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2);
pos.z = this->dyna.actor.posRot.pos.z + Rand_CenteredFloat(8.0f);
pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f);
pos.y = this->dyna.actor.world.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2);
pos.z = this->dyna.actor.world.pos.z + Rand_CenteredFloat(8.0f);
vel.x = Rand_CenteredFloat(7.0f);
vel.z = Rand_CenteredFloat(7.0f);
@@ -127,7 +127,7 @@ void BgIceTurara_Stalagmite(BgIceTurara* this, GlobalContext* globalCtx) {
}
void BgIceTurara_Wait(BgIceTurara* this, GlobalContext* globalCtx) {
if (this->dyna.actor.xzDistToLink < 60.0f) {
if (this->dyna.actor.xzDistToPlayer < 60.0f) {
this->shiverTimer = 10;
this->actionFunc = BgIceTurara_Shiver;
}
@@ -145,8 +145,8 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ICE_SWING);
}
if (this->shiverTimer == 0) {
this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot.pos.z = this->dyna.actor.initPosRot.pos.z;
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z;
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
@@ -154,10 +154,10 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) {
} else {
sp28 = Rand_ZeroOne();
phi_v0_2 = (Rand_ZeroOne() < 0.5f ? -1 : 1);
this->dyna.actor.posRot.pos.x = (phi_v0_2 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.world.pos.x = (phi_v0_2 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.home.pos.x;
sp28 = Rand_ZeroOne();
phi_v0_3 = (Rand_ZeroOne() < 0.5f ? -1 : 1);
this->dyna.actor.posRot.pos.z = (phi_v0_3 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.initPosRot.pos.z;
this->dyna.actor.world.pos.z = (phi_v0_3 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.home.pos.z;
}
}
@@ -165,12 +165,12 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) {
if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & 1)) {
this->collider.base.atFlags &= ~AT_HIT;
this->dyna.actor.bgCheckFlags &= ~1;
if (this->dyna.actor.posRot.pos.y < this->dyna.actor.groundY) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY;
if (this->dyna.actor.world.pos.y < this->dyna.actor.floorHeight) {
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
}
BgIceTurara_Break(this, globalCtx, 40.0f);
if (this->dyna.actor.params == TURARA_STALACTITE_REGROW) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 120.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 120.0f;
func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->actionFunc = BgIceTurara_Regrow;
} else {
@@ -179,16 +179,16 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) {
}
} else {
Actor_MoveForward(&this->dyna.actor);
this->dyna.actor.posRot.pos.y += 40.0f;
func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
this->dyna.actor.posRot.pos.y -= 40.0f;
this->dyna.actor.world.pos.y += 40.0f;
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4);
this->dyna.actor.world.pos.y -= 40.0f;
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
void BgIceTurara_Regrow(BgIceTurara* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 1.0f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f)) {
this->actionFunc = BgIceTurara_Wait;
this->dyna.actor.velocity.y = 0.0f;
}
@@ -20,7 +20,7 @@ void BgIngate_DoNothing(BgIngate* this, GlobalContext* globalCtx);
const ActorInit Bg_Ingate_InitVars = {
ACTOR_BG_INGATE,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_INGATE,
sizeof(BgIngate),
@@ -79,7 +79,7 @@ void func_80892890(BgIngate* this, GlobalContext* globalCtx) {
if ((this->dyna.actor.params & 2) == 0) {
phi0 = -0x4000;
}
this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y + phi0;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0;
BgIngate_SetupAction(this, &BgIngate_DoNothing);
} else if (globalCtx->csCtx.frames >= 10) {
csFrames = globalCtx->csCtx.frames - 10;
@@ -93,7 +93,7 @@ void func_80892890(BgIngate* this, GlobalContext* globalCtx) {
if ((this->dyna.actor.params & 2) == 0) {
phi1 = -phi1;
}
this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y + phi1;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi1;
}
}
@@ -28,7 +28,7 @@ static u8 sIsSpawned = false;
const ActorInit Bg_Jya_1flift_InitVars = {
ACTOR_BG_JYA_1FLIFT,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJya1flift),
@@ -128,7 +128,7 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80892DB0(BgJya1flift* this) {
this->actionFunc = func_80892DCC;
this->dyna.actor.posRot.pos.y = sFinalPositions[0];
this->dyna.actor.world.pos.y = sFinalPositions[0];
}
void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) {
@@ -139,7 +139,7 @@ void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) {
void func_80892E0C(BgJya1flift* this) {
this->actionFunc = BgJya1flift_DoNothing;
this->dyna.actor.posRot.pos.y = sFinalPositions[0];
this->dyna.actor.world.pos.y = sFinalPositions[0];
}
void BgJya1flift_DoNothing(BgJya1flift* this, GlobalContext* globalCtx) {
@@ -160,9 +160,9 @@ void BgJya1flift_Move(BgJya1flift* this, GlobalContext* globalCtx) {
} else {
tempVelocity = this->dyna.actor.velocity.y;
}
if (fabsf(Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, (sFinalPositions[this->isMovingDown]), 0.5f,
if (fabsf(Math_SmoothStepToF(&this->dyna.actor.world.pos.y, (sFinalPositions[this->isMovingDown]), 0.5f,
tempVelocity, 1.0f)) < 0.001f) {
this->dyna.actor.posRot.pos.y = sFinalPositions[this->isMovingDown];
this->dyna.actor.world.pos.y = sFinalPositions[this->isMovingDown];
BgJya1flift_ResetMoveDelay(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
} else {
@@ -26,7 +26,7 @@ void func_8089350C(BgJyaAmishutter* this);
const ActorInit Bg_Jya_Amishutter_InitVars = {
ACTOR_BG_JYA_AMISHUTTER,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaAmishutter),
@@ -79,8 +79,8 @@ void func_808933BC(BgJyaAmishutter* this) {
}
void func_808933CC(BgJyaAmishutter* this) {
if (this->actor.xzDistToLink < 60.0f) {
if (fabsf(this->actor.yDistToLink) < 30.0f) {
if (this->actor.xzDistToPlayer < 60.0f) {
if (fabsf(this->actor.yDistToPlayer) < 30.0f) {
func_80893428(this);
}
}
@@ -91,7 +91,7 @@ void func_80893428(BgJyaAmishutter* this) {
}
void func_80893438(BgJyaAmishutter* this) {
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 100.0f, 3.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 100.0f, 3.0f)) {
func_808934B0(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP);
} else {
@@ -104,7 +104,7 @@ void func_808934B0(BgJyaAmishutter* this) {
}
void func_808934C0(BgJyaAmishutter* this) {
if (this->actor.xzDistToLink > 300.0f) {
if (this->actor.xzDistToPlayer > 300.0f) {
func_808934FC(this);
}
}
@@ -114,7 +114,7 @@ void func_808934FC(BgJyaAmishutter* this) {
}
void func_8089350C(BgJyaAmishutter* this) {
if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 3.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 3.0f)) {
func_808933BC(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP);
} else {
@@ -26,7 +26,7 @@ static u8 sIsSpawned = false;
const ActorInit Bg_Jya_Bigmirror_InitVars = {
ACTOR_BG_JYA_BIGMIRROR,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaBigmirror),
@@ -229,11 +229,11 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 435);
func_80093D84(globalCtx->state.gfxCtx);
lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORTYPE_BG);
lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORCAT_BG);
if (lift != NULL) {
this->liftHeight = lift->posRot.pos.y;
this->liftHeight = lift->world.pos.y;
}
func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z,
func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z,
&this->actor.shape.rot);
// Second float seems to be either this or 1613/1280 + 0.13: both numerators relate to the lift height
Matrix_Scale(0.1f, (this->liftHeight * -(1.0f / 1280.0f)) + (973.0f / 1280.0f + 0.63f) /* 1.3901563f */, 0.1f,
@@ -244,7 +244,7 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) {
if (lift != NULL) {
if (1) {}
func_800D1694(lift->posRot.pos.x, lift->posRot.pos.y, lift->posRot.pos.z, &D_80893F4C);
func_800D1694(lift->world.pos.x, lift->world.pos.y, lift->world.pos.z, &D_80893F4C);
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -17,7 +17,7 @@ void BgJyaBlock_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Jya_Block_InitVars = {
ACTOR_BG_JYA_BLOCK,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_DANGEON_KEEP,
sizeof(BgJyaBlock),
@@ -18,7 +18,7 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, GlobalContext* globalC
const ActorInit Bg_Jya_Bombchuiwa_InitVars = {
ACTOR_BG_JYA_BOMBCHUIWA,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaBombchuiwa),
@@ -56,7 +56,7 @@ static ColliderJntSphInit sJntSphInit = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_U8(unk_1F, 3, ICHAIN_CONTINUE),
ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
@@ -91,7 +91,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
BgJyaBombchuiwa_SetupWaitForExplosion(this, globalCtx);
}
Actor_SetHeight(thisx, 0.0f);
Actor_SetFocus(thisx, 0.0f);
}
void BgJyaBombchuiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
@@ -111,9 +111,9 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < 20; i++) {
pos.x = Rand_ZeroOne() * 10.0f + this->actor.posRot.pos.x - 10.0f;
pos.y = Rand_ZeroOne() * 40.0f + this->actor.posRot.pos.y - 20.0f;
pos.z = Rand_ZeroOne() * 50.0f + this->actor.posRot.pos.z - 25.0f;
pos.x = Rand_ZeroOne() * 10.0f + this->actor.world.pos.x - 10.0f;
pos.y = Rand_ZeroOne() * 40.0f + this->actor.world.pos.y - 20.0f;
pos.z = Rand_ZeroOne() * 50.0f + this->actor.world.pos.z - 25.0f;
velocity.x = Rand_ZeroOne() * 3.0f - 0.3f;
velocity.y = Rand_ZeroOne() * 18.0f;
velocity.z = (Rand_ZeroOne() - 0.5f) * 15.0f;
@@ -139,7 +139,7 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -300, arg5, arg6, arg7, 0, scale, 1, 15, 80,
KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0);
}
func_80033480(globalCtx, &this->actor.posRot.pos, 100.0f, 8, 100, 160, 0);
func_80033480(globalCtx, &this->actor.world.pos, 100.0f, 8, 100, 160, 0);
}
void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
@@ -157,7 +157,7 @@ void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* glob
if (this->timer > 10) {
BgJyaBombchuiwa_Break(this, globalCtx);
BgJyaBombchuiwa_CleanUpAfterExplosion(this, globalCtx);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN);
}
} else {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
@@ -176,7 +176,7 @@ void BgJyaBombchuiwa_CleanUpAfterExplosion(BgJyaBombchuiwa* this, GlobalContext*
void func_808949B8(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
this->timer++;
if (this->timer & 4) {
func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 3, 100, 100, 0);
func_80033480(globalCtx, &this->actor.world.pos, 60.0f, 3, 100, 100, 0);
}
if (Math_StepToF(&this->lightRayIntensity, 1.0f, 0.028)) {
BgJyaBombchuiwa_SpawnLightRay(this, globalCtx);
@@ -187,8 +187,8 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, GlobalContext* globalC
this->actionFunc = NULL;
this->lightRayIntensity = 153.0f;
BgJyaBombchuiwa_SetDrawFlags(this, 4);
if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, 0) == NULL) {
if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 0) == NULL) {
// Occurrence failure
osSyncPrintf("Error : Mir_Ray 発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombchuiwa.c", 410,
this->actor.params);
@@ -13,7 +13,7 @@ void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Jya_Bombiwa_InitVars = {
ACTOR_BG_JYA_BOMBIWA,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaBombiwa),
@@ -120,9 +120,9 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) {
s16 scale;
for (i = 0; i < 16; i++) {
pos.x = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.posRot.pos.x) - 40.0f;
pos.y = (Rand_ZeroOne() * 140.0f) + this->dyna.actor.posRot.pos.y;
pos.z = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.posRot.pos.z) - 40.0f;
pos.x = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.x) - 40.0f;
pos.y = (Rand_ZeroOne() * 140.0f) + this->dyna.actor.world.pos.y;
pos.z = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.z) - 40.0f;
velocity.x = (Rand_ZeroOne() - 0.5f) * 10.0f;
velocity.y = Rand_ZeroOne() * 12.0f;
velocity.z = (Rand_ZeroOne() - 0.5f) * 10.0f;
@@ -148,9 +148,9 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) {
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -400, arg5, arg6, arg7, 0, scale, 1, 20, 80,
KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0);
}
pos.x = this->dyna.actor.posRot.pos.x;
pos.y = this->dyna.actor.posRot.pos.y + 70.0f;
pos.z = this->dyna.actor.posRot.pos.z;
pos.x = this->dyna.actor.world.pos.x;
pos.y = this->dyna.actor.world.pos.y + 70.0f;
pos.z = this->dyna.actor.world.pos.z;
func_80033480(globalCtx, &pos, 100.0f, 0xA, 0x64, 0xA0, 1);
}
@@ -160,7 +160,7 @@ void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & AC_HIT) {
BgJyaBombiwa_Break(this, globalCtx);
Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot, 40, NA_SE_EV_WALL_BROKEN);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world, 40, NA_SE_EV_WALL_BROKEN);
Actor_Kill(&this->dyna.actor);
} else {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
@@ -17,7 +17,7 @@ extern UNK_TYPE D_060117D0;
/*
const ActorInit Bg_Jya_Cobra_InitVars = {
ACTOR_BG_JYA_COBRA,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaCobra),
@@ -26,7 +26,7 @@ void func_80897970(BgJyaGoroiwa* this);
const ActorInit Bg_Jya_Goroiwa_InitVars = {
ACTOR_BG_JYA_GOROIWA,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GOROIWA,
sizeof(BgJyaGoroiwa),
@@ -76,9 +76,9 @@ static InitChainEntry sInitChain[] = {
void func_80897970(BgJyaGoroiwa* this) {
Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere;
worldSphere->center.x = this->actor.posRot.pos.x;
worldSphere->center.y = (s32)(this->actor.posRot.pos.y + 59.5f);
worldSphere->center.z = this->actor.posRot.pos.z;
worldSphere->center.x = this->actor.world.pos.x;
worldSphere->center.y = (s32)(this->actor.world.pos.y + 59.5f);
worldSphere->center.z = this->actor.world.pos.z;
}
void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) {
@@ -91,7 +91,7 @@ void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) {
}
void func_80897A2C(BgJyaGoroiwa* this) {
f32 posDiff = this->actor.posRot.pos.x - this->actor.pos4.x;
f32 posDiff = this->actor.world.pos.x - this->actor.prevPos.x;
this->actor.shape.rot.z -= 0x10000 / (119 * M_PI) * posDiff;
}
@@ -103,8 +103,8 @@ void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
func_808979C0(this, globalCtx);
this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0;
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
ActorShape_Init(&this->actor.shape, 595.0f, &ActorShadow_DrawFunc_Circle, 9.0f);
this->actor.shape.unk_14 = 0x80;
ActorShape_Init(&this->actor.shape, 595.0f, ActorShadow_DrawCircle, 9.0f);
this->actor.shape.shadowAlpha = 128;
func_80897B1C(this);
}
@@ -125,37 +125,37 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor;
f32 tmpf2;
s16 tmp16;
f32 tmpf1 = (-100.0f - thisx->posRot.pos.y) * 2.5f;
f32 tmpf1 = (-100.0f - thisx->world.pos.y) * 2.5f;
if (tmpf1 < 0.01f) {
tmpf1 = 0.01f;
}
thisx->speedXZ = (sqrtf(tmpf1) * this->unk_1B0);
thisx->velocity.x = (Math_SinS(thisx->posRot.rot.y) * thisx->speedXZ);
thisx->velocity.x = (Math_SinS(thisx->world.rot.y) * thisx->speedXZ);
tmpf2 = Math_CosS(thisx->posRot.rot.y) * thisx->speedXZ;
tmpf2 = Math_CosS(thisx->world.rot.y) * thisx->speedXZ;
thisx->velocity.z = tmpf2;
thisx->posRot.pos.x = thisx->posRot.pos.x + thisx->velocity.x;
thisx->posRot.pos.z = thisx->posRot.pos.z + tmpf2;
thisx->world.pos.x = thisx->world.pos.x + thisx->velocity.x;
thisx->world.pos.z = thisx->world.pos.z + tmpf2;
if ((1466.0f < thisx->posRot.pos.x) && (thisx->posRot.pos.x < 1673.0f)) {
thisx->posRot.pos.y = -129.5f;
if ((1466.0f < thisx->world.pos.x) && (thisx->world.pos.x < 1673.0f)) {
thisx->world.pos.y = -129.5f;
} else {
tmpf2 = 1569.0f - thisx->posRot.pos.x;
tmpf2 = 1569.0f - thisx->world.pos.x;
tmpf1 = fabsf(tmpf2) - 103.0f;
thisx->posRot.pos.y = (0.38043478f * tmpf1) - 129.5f;
thisx->world.pos.y = (0.38043478f * tmpf1) - 129.5f;
}
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT & ~AT_ON;
tmp16 = thisx->yawTowardsLink - thisx->posRot.rot.y;
tmp16 = thisx->yawTowardsPlayer - thisx->world.rot.y;
if ((tmp16 >= -0x3FFF) && (tmp16 < 0x4000)) {
thisx->posRot.rot.y += 0x8000;
thisx->world.rot.y += 0x8000;
}
func_8002F6D4(globalCtx, thisx, 2.0f, thisx->yawTowardsLink, 0.0f, 0);
func_8002F6D4(globalCtx, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0);
func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT);
this->unk_1B8 = 10.0f;
@@ -165,19 +165,19 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) {
if (this->unk_1B4) {
this->unk_1B8 -= 1.5f;
thisx->shape.unk_08 += this->unk_1B8 * 10.0f;
if (thisx->shape.unk_08 < 595.0f) {
thisx->shape.unk_08 = 595.0f;
thisx->shape.yOffset += this->unk_1B8 * 10.0f;
if (thisx->shape.yOffset < 595.0f) {
thisx->shape.yOffset = 595.0f;
func_80897DDC(this);
}
} else {
Math_StepToF(&this->unk_1B0, 1.0f, 0.04f);
}
if (thisx->posRot.pos.x > 1745.0f) {
thisx->posRot.rot.y = -0x4000;
} else if (thisx->posRot.pos.x < 1393.0f) {
thisx->posRot.rot.y = 0x4000;
if (thisx->world.pos.x > 1745.0f) {
thisx->world.rot.y = -0x4000;
} else if (thisx->world.pos.x < 1393.0f) {
thisx->world.rot.y = 0x4000;
}
Audio_PlayActorSound2(thisx, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG);
@@ -206,10 +206,10 @@ void BgJyaGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
if (!(player->stateFlags1 & 0x300000C0)) {
this->actionFunc(this, globalCtx);
func_80897A2C(this);
pos.x = this->actor.posRot.pos.x;
pos.y = this->actor.posRot.pos.y + 59.5f;
pos.z = this->actor.posRot.pos.z;
this->actor.groundY =
pos.x = this->actor.world.pos.x;
pos.y = this->actor.world.pos.y + 59.5f;
pos.z = this->actor.world.pos.z;
this->actor.floorHeight =
BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &pos);
func_80897970(this);
if (this->collider.base.atFlags & AT_ON) {
@@ -25,7 +25,7 @@ void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx
const ActorInit Bg_Jya_Haheniron_InitVars = {
ACTOR_BG_JYA_HAHENIRON,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_JYA_IRON,
sizeof(BgJyaHaheniron),
@@ -152,13 +152,13 @@ void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx)
Vec3f vec;
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85);
if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) &&
(this->collider.base.at->type == ACTORTYPE_PLAYER))) {
(this->collider.base.at->category == ACTORCAT_PLAYER))) {
vec.x = -Rand_ZeroOne() * this->actor.velocity.x;
vec.y = -Rand_ZeroOne() * this->actor.velocity.y;
vec.z = -Rand_ZeroOne() * this->actor.velocity.z;
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, &vec);
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, &vec);
Actor_Kill(&this->actor);
} else if (this->timer > 60) {
Actor_Kill(&this->actor);
@@ -177,7 +177,7 @@ void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx
if (this->timer >= 8) {
Actor_MoveForward(&this->actor);
} else if (this->timer >= 17) {
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, D_808987A0);
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987A0);
Actor_Kill(&this->actor);
}
this->actor.shape.rot.y += 0x258;
@@ -190,8 +190,8 @@ void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this) {
void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx) {
if (this->timer >= 17) {
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, D_808987AC);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2);
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987AC);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2);
Actor_Kill(&this->actor);
}
}
@@ -14,7 +14,7 @@ extern UNK_TYPE D_06000880;
/*
const ActorInit Bg_Jya_Ironobj_InitVars = {
ACTOR_BG_JYA_IRONOBJ,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_JYA_IRON,
sizeof(BgJyaIronobj),
@@ -23,7 +23,7 @@ void func_80899A08(BgJyaKanaami* this);
const ActorInit Bg_Jya_Kanaami_InitVars = {
ACTOR_BG_JYA_KANAAMI,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaKanaami),
@@ -83,7 +83,7 @@ void func_80899880(BgJyaKanaami* this) {
void func_80899894(BgJyaKanaami* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) || this->unk_16A > 0) {
if (this->actor.posRot.pos.x > -1000.0f && this->unk_16A == 0) {
if (this->actor.world.pos.x > -1000.0f && this->unk_16A == 0) {
func_800800F8(globalCtx, 0xD7A, -0x63, &this->actor, 0);
}
this->unk_16A += 1;
@@ -102,7 +102,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) {
s32 pad[2];
s32 var;
this->unk_168 += 0x20;
if (Math_ScaledStepToS(&this->actor.posRot.rot.x, 0x4000, this->unk_168)) {
if (Math_ScaledStepToS(&this->actor.world.rot.x, 0x4000, this->unk_168)) {
func_80899A08(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRAP_BOUND);
var = Quake_Add(ACTIVE_CAM, 3);
@@ -114,7 +114,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) {
void func_80899A08(BgJyaKanaami* this) {
this->actionFunc = 0;
this->actor.posRot.rot.x = 0x4000;
this->actor.world.rot.x = 0x4000;
}
void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -123,7 +123,7 @@ void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->actionFunc != NULL) {
this->actionFunc(this, globalCtx);
}
this->actor.shape.rot.x = this->actor.posRot.rot.x;
this->actor.shape.rot.x = this->actor.world.rot.x;
}
void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -27,7 +27,7 @@ static s16 sIsSpawned = false;
const ActorInit Bg_Jya_Lift_InitVars = {
ACTOR_BG_JYA_LIFT,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaLift),
@@ -94,7 +94,7 @@ void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgJyaLift_SetInitPosY(BgJyaLift* this) {
this->actionFunc = BgJyaLift_DelayMove;
this->dyna.actor.posRot.pos.y = 1613.0f;
this->dyna.actor.world.pos.y = 1613.0f;
this->moveDelay = 0;
}
@@ -118,8 +118,8 @@ void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->dyna.actor.velocity.y, 4.0f, 0.1f, 1.0f, 0.0f);
tempVelocity = (this->dyna.actor.velocity.y < 0.2f) ? 0.2f : this->dyna.actor.velocity.y;
distFromBottom = Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f);
if ((this->dyna.actor.posRot.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.pos4.y)) {
distFromBottom = Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f);
if ((this->dyna.actor.world.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.prevPos.y)) {
func_8005B1A4(ACTIVE_CAM);
}
if (fabsf(distFromBottom) < 0.001f) {
@@ -132,7 +132,7 @@ void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx) {
void BgJyaLift_SetFinalPosY(BgJyaLift* this) {
this->actionFunc = NULL;
this->dyna.actor.posRot.pos.y = 973.0f;
this->dyna.actor.world.pos.y = 973.0f;
}
void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -29,7 +29,7 @@ typedef struct {
const ActorInit Bg_Jya_Megami_InitVars = {
ACTOR_BG_JYA_MEGAMI,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaMegami),
@@ -164,7 +164,7 @@ void func_8089A41C(BgJyaMegami* this, GlobalContext* globalCtx, f32 arg2) {
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {
if (Rand_ZeroOne() < arg2) {
Math_Vec3f_Sum(&this->dyna.actor.posRot.pos, &sPiecesInit[i].unk_00, &sp50);
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &sPiecesInit[i].unk_00, &sp50);
sp50.z += 15.0f;
func_8089A1DC(globalCtx, &sp50, &D_8089B184, 1, 0);
}
@@ -180,7 +180,7 @@ void BgJyaMegami_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(&this->dyna.actor);
} else {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Actor_SetHeight(&this->dyna.actor, -50.0f);
Actor_SetFocus(&this->dyna.actor, -50.0f);
BgJyaMegami_SetupDetectLight(this);
}
}
@@ -212,7 +212,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) {
if (this->lightTimer > 40) {
Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F);
BgJyaMegami_SetupExplode(this);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 100, NA_SE_EV_FACE_EXPLOSION);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION);
func_800800F8(globalCtx, 0xD70, -0x63, &this->dyna.actor, 0);
} else {
if (this->lightTimer < 8) {
@@ -235,7 +235,7 @@ void BgJyaMegami_SetupExplode(BgJyaMegami* this) {
this->actionFunc = BgJyaMegami_Explode;
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {
Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.posRot.pos);
Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.world.pos);
this->pieces[i].vel.x = sPiecesInit[i].velX;
}
this->explosionTimer = 0;
@@ -250,7 +250,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) {
this->explosionTimer++;
if (this->explosionTimer == 30) {
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 100, NA_SE_EV_FACE_BREAKDOWN);
Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN);
}
for (i = 0; i < ARRAY_COUNT(this->pieces); i++) {
@@ -280,15 +280,15 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) {
if ((this->explosionTimer % 4 == 0) && (this->explosionTimer > 30) && (this->explosionTimer < 80) &&
(this->explosionTimer > 40)) {
sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.posRot.pos.x;
sp8C.y = (this->dyna.actor.posRot.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f;
sp8C.z = this->dyna.actor.posRot.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f);
sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.world.pos.x;
sp8C.y = (this->dyna.actor.world.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f;
sp8C.z = this->dyna.actor.world.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f);
func_8089A1DC(globalCtx, &sp8C, &sVec, 1, 0);
}
if (this->explosionTimer < ARRAY_COUNT(this->pieces)) {
sp8C.x = this->dyna.actor.posRot.pos.x;
sp8C.y = this->dyna.actor.posRot.pos.y - 60.0f;
sp8C.z = this->dyna.actor.posRot.pos.z;
sp8C.x = this->dyna.actor.world.pos.x;
sp8C.y = this->dyna.actor.world.pos.y - 60.0f;
sp8C.z = this->dyna.actor.world.pos.z;
func_80033480(globalCtx, &sp8C, 100.0f, 1, 150, 100, 1);
}
if (this->explosionTimer == 60) {
@@ -26,7 +26,7 @@ static f32 D_8089B9C0[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
const ActorInit Bg_Jya_Zurerukabe_InitVars = {
ACTOR_BG_JYA_ZURERUKABE,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaZurerukabe),
@@ -85,7 +85,7 @@ void func_8089B4C8(BgJyaZurerukabe* this, GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_8089BA18); i++) {
f32 posY = player->actor.posRot.pos.y;
f32 posY = player->actor.world.pos.y;
if ((posY >= D_8089BA18[i][0]) && (posY <= D_8089BA18[i][1])) {
break;
}
@@ -118,7 +118,7 @@ void BgJyaZurerukabe_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
for (i = 0; i < ARRAY_COUNT(D_8089B9F0); i++) {
if (fabsf(D_8089B9F0[i] - this->dyna.actor.initPosRot.pos.y) < 1.0f) {
if (fabsf(D_8089B9F0[i] - this->dyna.actor.home.pos.y) < 1.0f) {
this->unk_168 = i;
break;
}
@@ -166,7 +166,7 @@ void func_8089B80C(BgJyaZurerukabe* this) {
}
void func_8089B870(BgJyaZurerukabe* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x + (this->unk_16C * 75),
if (Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + (this->unk_16C * 75),
D_8089BA08[this->unk_168])) {
func_8089B7B4(this);
}
@@ -17,7 +17,7 @@ void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Menkuri_Eye_InitVars = {
ACTOR_BG_MENKURI_EYE,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MENKURI_OBJECTS,
sizeof(BgMenkuriEye),
@@ -68,9 +68,9 @@ void BgMenkuriEye_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y;
this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z;
this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
colliderList = this->collider.elements;
colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius;
if (!Flags_GetSwitch(globalCtx, this->actor.params)) {
@@ -100,7 +100,7 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
if ((this->collider.base.acFlags & AC_HIT) &&
(ABS((s16)(this->collider.base.ac->posRot.rot.y - this->actor.shape.rot.y)) > 0x5000)) {
(ABS((s16)(this->collider.base.ac->world.rot.y - this->actor.shape.rot.y)) > 0x5000)) {
this->collider.base.acFlags &= ~AC_HIT;
if (this->framesUntilDisable == -1) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AMOS_DAMAGE);
@@ -116,7 +116,7 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->framesUntilDisable == -1) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
Actor_SetHeight(&this->actor, 0.0f);
Actor_SetFocus(&this->actor, 0.0f);
}
void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -132,8 +132,8 @@ void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx) {
} else {
gDPSetEnvColor(POLY_XLU_DISP++, 200, 0, 0, 255);
}
Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0);
Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0);
Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_menkuri_eye.c", 331),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -17,7 +17,7 @@ void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Menkuri_Kaiten_InitVars = {
ACTOR_BG_MENKURI_KAITEN,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MENKURI_OBJECTS,
sizeof(BgMenkuriKaiten),
@@ -17,7 +17,7 @@ void BgMenkuriNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Menkuri_Nisekabe_InitVars = {
ACTOR_BG_MENKURI_NISEKABE,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_MENKURI_OBJECTS,
sizeof(BgMenkuriNisekabe),
@@ -21,7 +21,7 @@ void BgMizuBwall_DoNothing(BgMizuBwall* this, GlobalContext* globalCtx);
const ActorInit Bg_Mizu_Bwall_InitVars = {
ACTOR_BG_MIZU_BWALL,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MIZU_OBJECTS,
sizeof(BgMizuBwall),
@@ -173,7 +173,7 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader* colHeader = NULL;
Actor_ProcessInitChain(&this->dyna.actor, D_8089D854);
this->yRot = this->dyna.actor.posRot.pos.y;
this->yRot = this->dyna.actor.world.pos.y;
this->dList = sDLists[(u16)this->dyna.actor.params & 0xF];
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
CollisionHeader_GetVirtual(sColHeaders[(u16)this->dyna.actor.params & 0xF], &colHeader);
@@ -205,9 +205,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) {
offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y;
offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f;
BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos);
vtx[j].x += this->dyna.actor.posRot.pos.x;
vtx[j].y += this->dyna.actor.posRot.pos.y;
vtx[j].z += this->dyna.actor.posRot.pos.z;
vtx[j].x += this->dyna.actor.world.pos.x;
vtx[j].y += this->dyna.actor.world.pos.y;
vtx[j].z += this->dyna.actor.world.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]);
}
@@ -241,9 +241,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) {
offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y;
offset.z = sTrisInitRutoWall.elements[i].dim.vtx[j].z + 2.0f;
BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos);
vtx[j].x += this->dyna.actor.posRot.pos.x;
vtx[j].y += this->dyna.actor.posRot.pos.y;
vtx[j].z += this->dyna.actor.posRot.pos.z;
vtx[j].x += this->dyna.actor.world.pos.x;
vtx[j].y += this->dyna.actor.world.pos.y;
vtx[j].z += this->dyna.actor.world.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]);
}
@@ -279,9 +279,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) {
offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y;
offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z;
BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos);
vtx[j].x += this->dyna.actor.posRot.pos.x;
vtx[j].y += this->dyna.actor.posRot.pos.y;
vtx[j].z += this->dyna.actor.posRot.pos.z;
vtx[j].x += this->dyna.actor.world.pos.x;
vtx[j].y += this->dyna.actor.world.pos.y;
vtx[j].z += this->dyna.actor.world.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]);
}
@@ -317,9 +317,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) {
offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y;
offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f;
BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos);
vtx[j].x += this->dyna.actor.posRot.pos.x;
vtx[j].y += this->dyna.actor.posRot.pos.y;
vtx[j].z += this->dyna.actor.posRot.pos.z;
vtx[j].x += this->dyna.actor.world.pos.x;
vtx[j].y += this->dyna.actor.world.pos.y;
vtx[j].z += this->dyna.actor.world.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]);
}
@@ -355,9 +355,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) {
offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y;
offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f;
BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos);
vtx[j].x += this->dyna.actor.posRot.pos.x;
vtx[j].y += this->dyna.actor.posRot.pos.y;
vtx[j].z += this->dyna.actor.posRot.pos.z;
vtx[j].x += this->dyna.actor.world.pos.x;
vtx[j].y += this->dyna.actor.world.pos.y;
vtx[j].z += this->dyna.actor.world.pos.z;
}
Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]);
}
@@ -414,7 +414,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, GlobalContext* globalCtx) {
s32 pad;
s16 rand1;
s16 rand2;
Vec3f* thisPos = &this->dyna.actor.posRot.pos;
Vec3f* thisPos = &this->dyna.actor.world.pos;
Vec3f debrisPos;
f32 tempx;
f32 tempz;
@@ -472,7 +472,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->actionFunc = BgMizuBwall_Break;
} else if (this->dyna.actor.xzDistToLink < 600.0f) {
} else if (this->dyna.actor.xzDistToPlayer < 600.0f) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -12,7 +12,7 @@ void BgMizuMovebg_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
const ActorInit Bg_Mizu_Movebg_InitVars = {
ACTOR_BG_MIZU_MOVEBG,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MIZU_OBJECTS,
sizeof(BgMizuMovebg),
@@ -19,7 +19,7 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, GlobalContext* globalCtx
const ActorInit Bg_Mizu_Shutter_InitVars = {
ACTOR_BG_MIZU_SHUTTER,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_MIZU_OBJECTS,
sizeof(BgMizuShutter),
@@ -55,22 +55,22 @@ void BgMizuShutter_Init(BgMizuShutter* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(sCollisionHeaders[SIZE_PARAM], &sp30);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp30);
if ((SIZE_PARAM == BGMIZUSHUTTER_SMALL) || (SIZE_PARAM == BGMIZUSHUTTER_LARGE)) {
this->closedPos = this->dyna.actor.posRot.pos;
this->closedPos = this->dyna.actor.world.pos;
this->timer = 0;
this->timerMax = TIMER_PARAM * 20;
Matrix_RotateY(this->dyna.actor.posRot.rot.y * (M_PI / 0x8000), 0);
Matrix_RotateX(this->dyna.actor.posRot.rot.x * (M_PI / 0x8000), 1);
Matrix_RotateZ(this->dyna.actor.posRot.rot.z * (M_PI / 0x8000), 1);
Matrix_RotateY(this->dyna.actor.world.rot.y * (M_PI / 0x8000), 0);
Matrix_RotateX(this->dyna.actor.world.rot.x * (M_PI / 0x8000), 1);
Matrix_RotateZ(this->dyna.actor.world.rot.z * (M_PI / 0x8000), 1);
Matrix_MultVec3f(&sDisplacements[SIZE_PARAM], &this->openPos);
this->openPos.x += this->dyna.actor.posRot.pos.x;
this->openPos.y += this->dyna.actor.posRot.pos.y;
this->openPos.z += this->dyna.actor.posRot.pos.z;
this->openPos.x += this->dyna.actor.world.pos.x;
this->openPos.y += this->dyna.actor.world.pos.y;
this->openPos.z += this->dyna.actor.world.pos.z;
if (this->timerMax != 0x3F * 20) {
Flags_UnsetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F);
this->dyna.actor.posRot.pos = this->closedPos;
this->dyna.actor.world.pos = this->closedPos;
}
if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) {
this->dyna.actor.posRot.pos = this->openPos;
this->dyna.actor.world.pos = this->openPos;
this->actionFunc = BgMizuShutter_WaitForTimer;
} else {
this->actionFunc = BgMizuShutter_WaitForSwitch;
@@ -87,7 +87,7 @@ void BgMizuShutter_Destroy(BgMizuShutter* thisx, GlobalContext* globalCtx) {
void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) {
if (ABS(this->dyna.actor.posRot.rot.x) > 0x2C60) {
if (ABS(this->dyna.actor.world.rot.x) > 0x2C60) {
func_800800F8(globalCtx, 0x119E, -0x63, &this->dyna.actor, 0);
} else {
func_80080480(globalCtx, &this->dyna.actor);
@@ -106,23 +106,23 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, GlobalContext* globalCtx
void BgMizuShutter_Move(BgMizuShutter* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) {
Math_SmoothStepToF(&this->dyna.actor.posRot.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.posRot.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f);
if ((this->dyna.actor.posRot.pos.x == this->openPos.x) && (this->dyna.actor.posRot.pos.y == this->openPos.y) &&
(this->dyna.actor.posRot.pos.z == this->openPos.z)) {
Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f);
if ((this->dyna.actor.world.pos.x == this->openPos.x) && (this->dyna.actor.world.pos.y == this->openPos.y) &&
(this->dyna.actor.world.pos.z == this->openPos.z)) {
this->timer = this->timerMax;
this->actionFunc = BgMizuShutter_WaitForTimer;
}
} else {
Math_SmoothStepToF(&this->maxSpeed, 20.0f, 1.0f, 3.0f, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.posRot.pos.x, this->closedPos.x, 1.0f, this->maxSpeed, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->closedPos.y, 1.0f, this->maxSpeed, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.posRot.pos.z, this->closedPos.z, 1.0f, this->maxSpeed, 0.1f);
if ((this->dyna.actor.posRot.pos.x == this->closedPos.x) &&
(this->dyna.actor.posRot.pos.y == this->closedPos.y) &&
(this->dyna.actor.posRot.pos.z == this->closedPos.z)) {
func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA);
Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->closedPos.x, 1.0f, this->maxSpeed, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->closedPos.y, 1.0f, this->maxSpeed, 0.1f);
Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->closedPos.z, 1.0f, this->maxSpeed, 0.1f);
if ((this->dyna.actor.world.pos.x == this->closedPos.x) &&
(this->dyna.actor.world.pos.y == this->closedPos.y) &&
(this->dyna.actor.world.pos.z == this->closedPos.z)) {
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
this->actionFunc = BgMizuShutter_WaitForSwitch;
}
@@ -17,7 +17,7 @@ void BgMizuUzu_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Bg_Mizu_Uzu_InitVars = {
ACTOR_BG_MIZU_UZU,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_MIZU_OBJECTS,
sizeof(BgMizuUzu),
@@ -34,7 +34,7 @@ static WaterLevel sWaterLevels[] = {
const ActorInit Bg_Mizu_Water_InitVars = {
ACTOR_BG_MIZU_WATER,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MIZU_OBJECTS,
sizeof(BgMizuWater),
@@ -101,7 +101,7 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) {
this->type = this->actor.params & 0xFF;
this->switchFlag = (this->actor.params >> 8) & 0xFF;
Actor_ProcessInitChain(&this->actor, sInitChain);
initialActorY = this->actor.posRot.pos.y;
initialActorY = this->actor.world.pos.y;
this->baseY = initialActorY;
this->targetY = initialActorY;
@@ -112,8 +112,8 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) {
Flags_GetSwitch(globalCtx, 0x1D), Flags_GetSwitch(globalCtx, 0x1E));
}
waterLevelActionIndex = BgMizuWater_GetWaterLevelActionIndex(-1, globalCtx);
this->actor.posRot.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY;
BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.posRot.pos.y);
this->actor.world.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY;
BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.world.pos.y);
this->actor.params = sWaterLevels[waterLevelActionIndex].switchFlag;
Flags_UnsetSwitch(globalCtx, 0x1C);
Flags_UnsetSwitch(globalCtx, 0x1D);
@@ -131,31 +131,31 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) {
Flags_SetSwitch(globalCtx, 0x1C);
break;
}
this->targetY = this->actor.posRot.pos.y;
this->targetY = this->actor.world.pos.y;
break;
case 1:
break;
case 2:
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
this->actor.posRot.pos.y = this->baseY + 85.0f;
this->actor.world.pos.y = this->baseY + 85.0f;
}
waterBoxes[6].ySurface = this->actor.posRot.pos.y;
waterBoxes[6].ySurface = this->actor.world.pos.y;
break;
case 3:
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
this->actor.posRot.pos.y = this->baseY + 110.0f;
this->actor.world.pos.y = this->baseY + 110.0f;
if (1) {}
this->targetY = this->actor.posRot.pos.y;
this->targetY = this->actor.world.pos.y;
}
waterBoxes[8].ySurface = this->actor.posRot.pos.y;
waterBoxes[8].ySurface = this->actor.world.pos.y;
break;
case 4:
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
this->actor.posRot.pos.y = this->baseY + 160.0f;
this->actor.world.pos.y = this->baseY + 160.0f;
if (1) {}
this->targetY = this->actor.posRot.pos.y;
this->targetY = this->actor.world.pos.y;
}
waterBoxes[16].ySurface = this->actor.posRot.pos.y;
waterBoxes[16].ySurface = this->actor.world.pos.y;
break;
}
@@ -209,7 +209,7 @@ void BgMizuWater_WaitForAction(BgMizuWater* this, GlobalContext* globalCtx) {
}
}
if (this->targetY != this->actor.posRot.pos.y) {
if (this->targetY != this->actor.world.pos.y) {
this->actionFunc = BgMizuWater_ChangeWaterLevel;
}
}
@@ -236,12 +236,12 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) {
Flags_UnsetSwitch(globalCtx, prevSwitchFlag);
}
if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 5.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 5.0f)) {
globalCtx->unk_11D30[0] = 0;
this->actionFunc = BgMizuWater_WaitForAction;
func_80106CCC(globalCtx);
}
BgMizuWater_SetWaterBoxesHeight(globalCtx->colCtx.colHeader->waterBoxes, this->actor.posRot.pos.y);
BgMizuWater_SetWaterBoxesHeight(globalCtx->colCtx.colHeader->waterBoxes, this->actor.world.pos.y);
break;
case 1:
break;
@@ -251,11 +251,11 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) {
} else {
this->targetY = this->baseY;
}
if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) {
globalCtx->unk_11D30[0] = 0;
this->actionFunc = BgMizuWater_WaitForAction;
}
waterBoxes[6].ySurface = this->actor.posRot.pos.y;
waterBoxes[6].ySurface = this->actor.world.pos.y;
break;
case 3:
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
@@ -263,11 +263,11 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) {
} else {
this->targetY = this->baseY;
}
if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) {
globalCtx->unk_11D30[0] = 0;
this->actionFunc = BgMizuWater_WaitForAction;
}
waterBoxes[8].ySurface = this->actor.posRot.pos.y;
waterBoxes[8].ySurface = this->actor.world.pos.y;
break;
case 4:
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
@@ -275,18 +275,18 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) {
} else {
this->targetY = this->baseY;
}
if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) {
if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) {
globalCtx->unk_11D30[0] = 0;
this->actionFunc = BgMizuWater_WaitForAction;
}
waterBoxes[16].ySurface = this->actor.posRot.pos.y;
waterBoxes[16].ySurface = this->actor.world.pos.y;
break;
}
if (this->targetY < this->actor.posRot.pos.y) {
if (this->targetY < this->actor.world.pos.y) {
func_800AA000(0.0f, 0x78, 0x14, 0xA);
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
} else if (this->targetY > this->actor.posRot.pos.y) {
} else if (this->targetY > this->actor.world.pos.y) {
func_800AA000(0.0f, 0x78, 0x14, 0xA);
func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
}
@@ -305,7 +305,7 @@ void BgMizuWater_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->type == 0) {
posY = this->actor.posRot.pos.y;
posY = this->actor.world.pos.y;
unk0 = 0;
unk1 = 0;
if (posY < -15.0f) {
+1 -1
View File
@@ -20,7 +20,7 @@ void func_808A0920(BgMjin* this, GlobalContext* globalCtx);
const ActorInit Bg_Mjin_InitVars = {
ACTOR_BG_MJIN,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgMjin),
@@ -33,7 +33,7 @@ extern Gfx D_06001E50[];
const ActorInit Bg_Mori_Bigst_InitVars = {
ACTOR_BG_MORI_BIGST,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriBigst),
@@ -77,7 +77,7 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params,
Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F),
Flags_GetTempClear(globalCtx, this->dyna.actor.room), Flags_GetClear(globalCtx, this->dyna.actor.room),
PLAYER->actor.posRot.pos.y);
PLAYER->actor.world.pos.y);
BgMoriBigst_InitDynapoly(this, globalCtx, &D_0600221C, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX);
@@ -89,11 +89,11 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
} else {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 270.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f;
}
Actor_SetHeight(&this->dyna.actor, 50.0f);
Actor_SetFocus(&this->dyna.actor, 50.0f);
BgMoriBigst_SetupWaitForMoriTex(this, globalCtx);
}
@@ -113,7 +113,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, GlobalContext* globalCtx) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) {
thisx->draw = BgMoriBigst_Draw;
if (Flags_GetClear(globalCtx, thisx->room) && (PLAYER->actor.posRot.pos.y > 700.0f)) {
if (Flags_GetClear(globalCtx, thisx->room) && (PLAYER->actor.world.pos.y > 700.0f)) {
if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) {
BgMoriBigst_SetupDone(this, globalCtx);
} else {
@@ -138,7 +138,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, GlobalContext* globalCtx)
-3320.0f, 0, 0, 0, 1);
if (stalfos != NULL) {
this->dyna.actor.child = NULL;
this->dyna.actor.initPosRot.rot.z++;
this->dyna.actor.home.rot.z++;
} else {
// Second Stalfos failure
osSyncPrintf("Warning : 第2スタルフォス発生失敗\n");
@@ -149,8 +149,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, GlobalContext* globalCtx)
void BgMoriBigst_StalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if ((this->dyna.actor.initPosRot.rot.z == 0) &&
((this->dyna.actor.initPosRot.pos.y - 5.0f) <= PLAYER->actor.posRot.pos.y)) {
if ((this->dyna.actor.home.rot.z == 0) && ((this->dyna.actor.home.pos.y - 5.0f) <= PLAYER->actor.world.pos.y)) {
BgMoriBigst_SetupFall(this, globalCtx);
func_800800F8(globalCtx, 0xC94, 0x48, &this->dyna.actor, 0);
}
@@ -162,8 +161,8 @@ void BgMoriBigst_SetupFall(BgMoriBigst* this, GlobalContext* globalCtx) {
void BgMoriBigst_Fall(BgMoriBigst* this, GlobalContext* globalCtx) {
Actor_MoveForward(&this->dyna.actor);
if (this->dyna.actor.posRot.pos.y <= this->dyna.actor.initPosRot.pos.y) {
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y;
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
BgMoriBigst_SetupLanding(this, globalCtx);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
func_800800F8(globalCtx, 0x3FC, 8, &this->dyna.actor, 0);
@@ -199,7 +198,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC
-3383.0f, 0, 0, 0, 5);
if (stalfos1 != NULL) {
this->dyna.actor.child = NULL;
this->dyna.actor.initPosRot.rot.z++;
this->dyna.actor.home.rot.z++;
} else {
// Warning: 3-1 Stalfos failure
osSyncPrintf("Warning : 第3-1スタルフォス発生失敗\n");
@@ -208,7 +207,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC
-3260.0f, 0, 0, 0, 5);
if (stalfos2 != NULL) {
this->dyna.actor.child = NULL;
this->dyna.actor.initPosRot.rot.z++;
this->dyna.actor.home.rot.z++;
} else {
// Warning: 3-2 Stalfos failure
osSyncPrintf("Warning : 第3-2スタルフォス発生失敗\n");
@@ -217,7 +216,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC
}
void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, GlobalContext* globalCtx) {
if ((this->dyna.actor.initPosRot.rot.z == 0) && !Player_InCsMode(globalCtx)) {
if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(globalCtx)) {
Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F);
BgMoriBigst_SetupDone(this, globalCtx);
}
@@ -231,7 +230,7 @@ void BgMoriBigst_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgMoriBigst* this = THIS;
Actor_SetHeight(&this->dyna.actor, 50.0f);
Actor_SetFocus(&this->dyna.actor, 50.0f);
if (this->waitTimer > 0) {
this->waitTimer--;
}
@@ -22,7 +22,7 @@ static s16 sIsSpawned = false;
const ActorInit Bg_Mori_Elevator_InitVars = {
ACTOR_BG_MORI_ELEVATOR,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriElevator),
@@ -129,7 +129,7 @@ void BgMoriElevator_Destroy(Actor* thisx, GlobalContext* globalCtx) {
s32 BgMoriElevator_IsPlayerRiding(BgMoriElevator* this, GlobalContext* globalCtx) {
return ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2) &&
((PLAYER->actor.posRot.pos.y - this->dyna.actor.posRot.pos.y) < 80.0f));
((PLAYER->actor.world.pos.y - this->dyna.actor.world.pos.y) < 80.0f));
}
void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) {
@@ -140,7 +140,7 @@ void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, GlobalContext* globalCtx
if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) {
if (globalCtx->roomCtx.curRoom.num == 2) {
this->dyna.actor.posRot.pos.y = 73.0f;
this->dyna.actor.world.pos.y = 73.0f;
BgMoriElevator_SetupSetPosition(this);
} else {
// Error: Forest Temple obj elevator Room setting is dangerous
@@ -161,7 +161,7 @@ void BgMoriElevator_MoveIntoGround(BgMoriElevator* this, GlobalContext* globalCt
f32 distToTarget;
func_808A1800(&this->dyna.actor.velocity.y, 2.0f, 0.05f, 1.0f, 0.0f);
distToTarget = func_808A1800(&this->dyna.actor.posRot.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f);
distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f);
if (fabsf(distToTarget) < 0.001f) {
BgMoriElevator_SetupSetPosition(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
@@ -180,7 +180,7 @@ void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, GlobalContext* globalC
f32 distToTarget;
func_808A1800(&this->dyna.actor.velocity.y, 2.0f, 0.05f, 1.0f, 0.0f);
distToTarget = func_808A1800(&this->dyna.actor.posRot.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f);
distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f);
if (fabsf(distToTarget) < 0.001f) {
BgMoriElevator_SetupSetPosition(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
@@ -207,10 +207,10 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, GlobalContext* globalCtx)
// Error:Forest Temple obj elevator Room setting is dangerous(% s % d)
osSyncPrintf("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n", "../z_bg_mori_elevator.c", 479);
}
} else if ((globalCtx->roomCtx.curRoom.num == 2) && (this->dyna.actor.posRot.pos.y < -275.0f)) {
} else if ((globalCtx->roomCtx.curRoom.num == 2) && (this->dyna.actor.world.pos.y < -275.0f)) {
this->targetY = 233.0f;
BgMoriElevator_StopMovement(this);
} else if ((globalCtx->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.posRot.pos.y)) {
} else if ((globalCtx->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) {
this->targetY = -779.0f;
BgMoriElevator_StopMovement(this);
} else if ((globalCtx->roomCtx.curRoom.num == 2) && Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F) &&
@@ -233,7 +233,7 @@ void func_808A2008(BgMoriElevator* this, GlobalContext* globalCtx) {
f32 distTo;
func_808A1800(&this->dyna.actor.velocity.y, 12.0f, 0.1f, 1.0f, 0.0f);
distTo = func_808A1800(&this->dyna.actor.posRot.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f);
distTo = func_808A1800(&this->dyna.actor.world.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f);
if (fabsf(distTo) < 0.001f) {
BgMoriElevator_SetupSetPosition(this);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP);
@@ -31,7 +31,7 @@ extern Gfx D_06004770[];
const ActorInit Bg_Mori_Hashigo_InitVars = {
ACTOR_BG_MORI_HASHIGO,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriHashigo),
@@ -69,12 +69,9 @@ static ColliderJntSphInit sJntSphInit = {
};
static InitChainEntry sInitChainClasp[] = {
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE),
ICHAIN_U8(unk_1F, 3, ICHAIN_CONTINUE),
ICHAIN_F32(unk_4C, 40, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 40, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
};
static InitChainEntry sInitChainLadder[] = {
@@ -108,9 +105,9 @@ void BgMoriHashigo_InitCollider(BgMoriHashigo* this, GlobalContext* globalCtx) {
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.posRot.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.posRot.pos.y + 21;
this->collider.elements[0].dim.worldSphere.center.z = (s16)this->dyna.actor.posRot.pos.z;
this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.world.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.world.pos.y + 21;
this->collider.elements[0].dim.worldSphere.center.z = (s16)this->dyna.actor.world.pos.z;
this->collider.elements[0].dim.worldSphere.radius = 19;
}
@@ -123,13 +120,13 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) {
cs = Math_CosS(this->dyna.actor.shape.rot.y);
sn = Math_SinS(this->dyna.actor.shape.rot.y);
pos.x = 6.0f * sn + this->dyna.actor.posRot.pos.x;
pos.y = -210.0f + this->dyna.actor.posRot.pos.y;
pos.z = 6.0f * cs + this->dyna.actor.posRot.pos.z;
pos.x = 6.0f * sn + this->dyna.actor.world.pos.x;
pos.y = -210.0f + this->dyna.actor.world.pos.y;
pos.z = 6.0f * cs + this->dyna.actor.world.pos.z;
ladder = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_MORI_HASHIGO, pos.x, pos.y,
pos.z, this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y,
this->dyna.actor.posRot.rot.z, 0);
pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y,
this->dyna.actor.world.rot.z, 0);
if (ladder != NULL) {
return true;
} else {
@@ -143,7 +140,7 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) {
s32 BgMoriHashigo_InitClasp(BgMoriHashigo* this, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChainClasp);
this->dyna.actor.flags |= 1;
Actor_SetHeight(&this->dyna.actor, 55.0f);
Actor_SetFocus(&this->dyna.actor, 55.0f);
BgMoriHashigo_InitCollider(this, globalCtx);
if ((this->dyna.actor.params == -1) && !BgMoriHashigo_SpawnLadder(this, globalCtx)) {
return false;
@@ -257,12 +254,12 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, GlobalContext* globalCtx) {
if (this->bounceCounter >= ARRAY_COUNT(bounceSpeed)) {
BgMoriHashigo_SetupLadderRest(this);
} else {
func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C);
Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C);
thisx->velocity.y = bounceSpeed[this->bounceCounter];
this->bounceCounter++;
}
} else {
func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C);
Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C);
}
}
@@ -270,7 +267,7 @@ void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this) {
this->actionFunc = NULL;
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY;
this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
}
void BgMoriHashigo_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -27,7 +27,7 @@ extern CollisionHeader D_060089E0;
const ActorInit Bg_Mori_Hashira4_InitVars = {
ACTOR_BG_MORI_HASHIRA4,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriHashira4),
@@ -95,7 +95,7 @@ void BgMoriHashira4_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(&this->dyna.actor);
return;
}
Actor_SetHeight(&this->dyna.actor, 50.0f);
Actor_SetFocus(&this->dyna.actor, 50.0f);
BgMoriHashira4_SetupWaitForMoriTex(this);
// (4 pillars of the Forest Temple) Bank danger
osSyncPrintf("(森の神殿 4本柱)(arg_data 0x%04x)\n", this->dyna.actor.params);
@@ -130,7 +130,7 @@ void BgMoriHashira4_SetupPillarsRotate(BgMoriHashira4* this) {
}
void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, GlobalContext* globalCtx) {
this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y += 0x96;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y += 0x96;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG);
}
@@ -147,7 +147,7 @@ void BgMoriHashira4_GateWait(BgMoriHashira4* this, GlobalContext* globalCtx) {
}
void BgMoriHashira4_GateOpen(BgMoriHashira4* this, GlobalContext* globalCtx) {
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 10.0f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 10.0f)) {
Actor_Kill(&this->dyna.actor);
}
}
@@ -26,7 +26,7 @@ static s16 D_808A43E0 = -1;
const ActorInit Bg_Mori_Hineri_InitVars = {
ACTOR_BG_MORI_HINERI,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgMoriHineri),
@@ -162,8 +162,8 @@ void BgMoriHineri_DoNothing(BgMoriHineri* this, GlobalContext* globalCtx) {
}
void BgMoriHineri_SpawnBossKeyChest(BgMoriHineri* this, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->dyna.actor.posRot.pos.x + 147.0f,
this->dyna.actor.posRot.pos.y + -245.0f, this->dyna.actor.posRot.pos.z + -453.0f, 0, 0x4000, 0, 0x27EE);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->dyna.actor.world.pos.x + 147.0f,
this->dyna.actor.world.pos.y + -245.0f, this->dyna.actor.world.pos.z + -453.0f, 0, 0x4000, 0, 0x27EE);
this->actionFunc = BgMoriHineri_DoNothing;
}
@@ -171,7 +171,7 @@ void func_808A3C8C(BgMoriHineri* this, GlobalContext* globalCtx) {
f32 f0;
Player* player = PLAYER;
f0 = 1100.0f - (player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z);
f0 = 1100.0f - (player->actor.world.pos.z - this->dyna.actor.world.pos.z);
this->dyna.actor.shape.rot.z = CLAMP(f0, 0.0f, 1000.0f) * 16.384f;
Camera_ChangeSetting(globalCtx->cameraPtrs[0], CAM_SET_DUNGEON1);
if (this->dyna.actor.params != 0) {
@@ -215,7 +215,7 @@ void func_808A3E54(BgMoriHineri* this, GlobalContext* globalCtx) {
D_808A43E0 = -1;
}
}
if ((D_808A43E0 > 0) && ((ACTIVE_CAM->eye.z - this->dyna.actor.posRot.pos.z) < 1100.0f)) {
if ((D_808A43E0 > 0) && ((ACTIVE_CAM->eye.z - this->dyna.actor.world.pos.z) < 1100.0f)) {
func_8002F948(&this->dyna.actor, NA_SE_EV_FLOOR_ROLLING - SFX_FLAG);
}
}
@@ -26,7 +26,7 @@ static s16 sIsSpawned = false;
const ActorInit Bg_Mori_Idomizu_InitVars = {
ACTOR_BG_MORI_IDOMIZU,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriIdomizu),
@@ -59,14 +59,14 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.scale.x = 1.1f;
this->actor.scale.y = 1.0f;
this->actor.scale.z = 1.0f;
this->actor.posRot.pos.x = 119.0f;
this->actor.posRot.pos.z = -1820.0f;
this->actor.world.pos.x = 119.0f;
this->actor.world.pos.z = -1820.0f;
this->prevSwitchFlagSet = Flags_GetSwitch(globalCtx, this->actor.params & 0x3F);
if (this->prevSwitchFlagSet != 0) {
this->actor.posRot.pos.y = -282.0f;
this->actor.world.pos.y = -282.0f;
BgMoriIdomizu_SetWaterLevel(globalCtx, -282);
} else {
this->actor.posRot.pos.y = 184.0f;
this->actor.world.pos.y = 184.0f;
BgMoriIdomizu_SetWaterLevel(globalCtx, 184);
}
this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX);
@@ -127,13 +127,13 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx) {
} else if (!switchFlagSet && this->prevSwitchFlagSet) {
func_800800F8(globalCtx, 0xCA8, 0x46, thisx, 0);
this->drainTimer = 90;
thisx->posRot.pos.y = 0.0f;
thisx->world.pos.y = 0.0f;
}
this->drainTimer--;
if ((roomNum == 7) || (roomNum == 8) || (roomNum == 9)) {
if (this->drainTimer < 70) {
Math_StepToF(&thisx->posRot.pos.y, this->targetWaterLevel, 3.5f);
BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->posRot.pos.y);
Math_StepToF(&thisx->world.pos.y, this->targetWaterLevel, 3.5f);
BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->world.pos.y);
if (this->drainTimer > 0) {
if (switchFlagSet) {
func_800788CC(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG);
@@ -143,8 +143,8 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx) {
}
}
} else {
thisx->posRot.pos.y = this->targetWaterLevel;
BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->posRot.pos.y);
thisx->world.pos.y = this->targetWaterLevel;
BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->world.pos.y);
Actor_Kill(thisx);
return;
}
@@ -26,7 +26,7 @@ extern Gfx D_060056B0[];
const ActorInit Bg_Mori_Kaitenkabe_InitVars = {
ACTOR_BG_MORI_KAITENKABE,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriKaitenkabe),
@@ -100,13 +100,13 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) {
if ((this->timer > 28) && !Player_InCsMode(globalCtx)) {
BgMoriKaitenkabe_SetupRotate(this);
func_8002DF54(globalCtx, &this->dyna.actor, 8);
Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.posRot.pos);
Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos);
push.x = Math_SinS(this->dyna.unk_158);
push.y = 0.0f;
push.z = Math_CosS(this->dyna.unk_158);
leverArm.x = this->dyna.actor.posRot.pos.x - player->actor.posRot.pos.x;
leverArm.x = this->dyna.actor.world.pos.x - player->actor.world.pos.x;
leverArm.y = 0.0f;
leverArm.z = this->dyna.actor.posRot.pos.z - player->actor.posRot.pos.z;
leverArm.z = this->dyna.actor.world.pos.z - player->actor.world.pos.z;
BgMoriKaitenkabe_CrossProduct(&torque, &push, &leverArm);
this->rotDirection = (torque.y > 0.0f) ? 1.0f : -1.0f;
}
@@ -135,22 +135,22 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, GlobalContext* globalCtx) {
BgMoriKaitenkabe_SetupWait(this);
func_8002DF54(globalCtx, thisx, 7);
if (this->rotDirection > 0.0f) {
thisx->initPosRot.rot.y += 0x2000;
thisx->home.rot.y += 0x2000;
} else {
thisx->initPosRot.rot.y -= 0x2000;
thisx->home.rot.y -= 0x2000;
}
thisx->posRot.rot.y = thisx->shape.rot.y = thisx->initPosRot.rot.y;
thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y;
func_800788CC(NA_SE_EV_STONEDOOR_STOP);
} else {
rotY = this->rotYdeg * (0x10000 / 360.0f);
thisx->posRot.rot.y = thisx->shape.rot.y = thisx->initPosRot.rot.y + rotY;
thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y + rotY;
func_800788CC(NA_SE_EV_WALL_SLIDE - SFX_FLAG);
}
if (fabsf(this->dyna.unk_150) > 0.001f) {
this->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~0x10;
}
Math_Vec3f_Copy(&player->actor.posRot.pos, &this->lockedPlayerPos);
Math_Vec3f_Copy(&player->actor.world.pos, &this->lockedPlayerPos);
}
void BgMoriKaitenkabe_Update(Actor* thisx, GlobalContext* globalCtx) {
@@ -33,7 +33,7 @@ static s16 sCamSetting = 0;
const ActorInit Bg_Mori_Rakkatenjo_InitVars = {
ACTOR_BG_MORI_RAKKATENJO,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_MORI_OBJECTS,
sizeof(BgMoriRakkatenjo),
@@ -56,14 +56,14 @@ void BgMoriRakkatenjo_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
// Forest Temple obj. Falling Ceiling
osSyncPrintf("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.initPosRot.pos.y);
if ((fabsf(1991.0f - this->dyna.actor.initPosRot.pos.x) > 0.001f) ||
(fabsf(683.0f - this->dyna.actor.initPosRot.pos.y) > 0.001f) ||
(fabsf(-2520.0f - this->dyna.actor.initPosRot.pos.z) > 0.001f)) {
osSyncPrintf("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y);
if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) ||
(fabsf(683.0f - this->dyna.actor.home.pos.y) > 0.001f) ||
(fabsf(-2520.0f - this->dyna.actor.home.pos.z) > 0.001f)) {
// The set position has been changed. Let's fix the program.
osSyncPrintf("Warning : セット位置が変更されています。プログラムを修正しましょう。\n");
}
if (this->dyna.actor.initPosRot.rot.y != 0x8000) {
if (this->dyna.actor.home.rot.y != 0x8000) {
// The set Angle has changed. Let's fix the program.
osSyncPrintf("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n");
}
@@ -89,13 +89,13 @@ void BgMoriRakkatenjo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
s32 BgMoriRakkatenjo_IsLinkUnder(BgMoriRakkatenjo* this, GlobalContext* globalCtx) {
Vec3f* pos = &PLAYER->actor.posRot.pos;
Vec3f* pos = &PLAYER->actor.world.pos;
return (-3300.0f < pos->z) && (pos->z < -1840.0f) && (1791.0f < pos->x) && (pos->x < 2191.0f);
}
s32 BgMoriRakkatenjo_IsLinkClose(BgMoriRakkatenjo* this, GlobalContext* globalCtx) {
Vec3f* pos = &PLAYER->actor.posRot.pos;
Vec3f* pos = &PLAYER->actor.world.pos;
return (-3360.0f < pos->z) && (pos->z < -1840.0f) && (1791.0f < pos->x) && (pos->x < 2191.0f);
}
@@ -113,7 +113,7 @@ void BgMoriRakkatenjo_WaitForMoriTex(BgMoriRakkatenjo* this, GlobalContext* glob
void BgMoriRakkatenjo_SetupWait(BgMoriRakkatenjo* this) {
this->timer = (this->fallCount > 0) ? 100 : 21;
this->dyna.actor.posRot.pos.y = 683.0f;
this->dyna.actor.world.pos.y = 683.0f;
this->actionFunc = BgMoriRakkatenjo_Wait;
}
@@ -153,17 +153,17 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, GlobalContext* globalCtx) {
s32 quake;
Actor_MoveForward(thisx);
if ((thisx->velocity.y < 0.0f) && (thisx->posRot.pos.y <= 403.0f)) {
if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) {
if (this->bounceCount >= ARRAY_COUNT(bounceVel)) {
BgMoriRakkatenjo_SetupRest(this);
} else {
if (this->bounceCount == 0) {
this->fallCount++;
func_800788CC(NA_SE_EV_STONE_BOUND);
func_800AA000(SQ(thisx->yDistToLink), 0xFF, 0x14, 0x96);
func_800AA000(SQ(thisx->yDistToPlayer), 0xFF, 0x14, 0x96);
}
thisx->posRot.pos.y =
403.0f - (thisx->posRot.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y);
thisx->world.pos.y =
403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y);
thisx->velocity.y = bounceVel[this->bounceCount];
this->bounceCount++;
quake = Quake_Add(ACTIVE_CAM, 3);
@@ -176,7 +176,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, GlobalContext* globalCtx) {
void BgMoriRakkatenjo_SetupRest(BgMoriRakkatenjo* this) {
this->actionFunc = BgMoriRakkatenjo_Rest;
this->dyna.actor.posRot.pos.y = 403.0f;
this->dyna.actor.world.pos.y = 403.0f;
this->timer = 20;
}
@@ -193,8 +193,8 @@ void BgMoriRakkatenjo_SetupRise(BgMoriRakkatenjo* this) {
void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->dyna.actor.velocity.y, 5.0f, 0.06f, 0.1f, 0.0f);
this->dyna.actor.posRot.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.posRot.pos.y >= 683.0f) {
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.world.pos.y >= 683.0f) {
BgMoriRakkatenjo_SetupWait(this);
}
}
@@ -38,7 +38,7 @@ extern CollisionHeader D_06007860;
const ActorInit Bg_Po_Event_InitVars = {
ACTOR_BG_PO_EVENT,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_PO_SISTERS,
sizeof(BgPoEvent),
@@ -121,9 +121,9 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) {
if (1) {} // This section looks like a macro of some sort.
for (i2 = 0; i2 < 3; i2++) {
vtxVec = &item->dim.vtx[i2];
sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.initPosRot.pos.x + (sins * vtxVec->z));
sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.initPosRot.pos.y;
sp9C[i2].z = this->dyna.actor.initPosRot.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins);
sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.home.pos.x + (sins * vtxVec->z));
sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.home.pos.y;
sp9C[i2].z = this->dyna.actor.home.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins);
}
Collider_SetTrisVertices(&this->collider, i1, &sp9C[0], &sp9C[1], &sp9C[2]);
}
@@ -168,7 +168,7 @@ void BgPoEvent_InitBlocks(BgPoEvent* this, GlobalContext* globalCtx) {
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if ((this->type == 0) && (this->index != 3)) {
newBlock = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_PO_EVENT,
blockPosX[this->index], this->dyna.actor.posRot.pos.y, blockPosZ[this->index], 0,
blockPosX[this->index], this->dyna.actor.world.pos.y, blockPosZ[this->index], 0,
this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z - 0x4000,
((this->index + 1) << 0xC) + (this->type << 8) + this->dyna.actor.params);
if (newBlock == NULL) {
@@ -189,9 +189,9 @@ void BgPoEvent_InitBlocks(BgPoEvent* this, GlobalContext* globalCtx) {
this->dyna.actor.child->child->child->child = &this->dyna.actor;
}
}
this->dyna.actor.posRot.pos.y = 833.0f;
this->dyna.actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId,
&this->dyna.actor, &this->dyna.actor.posRot.pos);
this->dyna.actor.world.pos.y = 833.0f;
this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId,
&this->dyna.actor, &this->dyna.actor.world.pos);
this->actionFunc = BgPoEvent_BlockWait;
}
@@ -241,14 +241,14 @@ void BgPoEvent_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) {
this->dyna.actor.posRot.pos.y = 833.0f;
this->dyna.actor.world.pos.y = 833.0f;
if (sPuzzleState == 0x3F) {
if (this->type == 1) {
func_800800F8(globalCtx, 0xC4E, 0x41, NULL, 0);
}
this->timer = 45;
this->actionFunc = BgPoEvent_BlockShake;
} else if (this->dyna.actor.xzDistToLink > 50.0f) {
} else if (this->dyna.actor.xzDistToPlayer > 50.0f) {
if (this->type != 1) {
sPuzzleState |= (1 << this->index);
} else {
@@ -264,13 +264,13 @@ void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) {
void BgPoEvent_BlockShake(BgPoEvent* this, GlobalContext* globalCtx) {
DECR(this->timer);
if (this->timer < 15) {
this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x + 2.0f * ((this->timer % 3) - 1);
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + 2.0f * ((this->timer % 3) - 1);
if (!(this->timer % 4)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE);
}
}
if (this->timer == 0) {
this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x;
sPuzzleState = 0;
this->timer = 60;
this->actionFunc = BgPoEvent_BlockFall;
@@ -284,24 +284,24 @@ void BgPoEvent_CheckBlock(BgPoEvent* this) {
s32 phi_a3;
if ((this->index == 3) || (this->index == 1)) {
phi_v1 = this->dyna.actor.posRot.pos.z;
phi_a1 = this->dyna.actor.child->posRot.pos.z;
phi_v1 = this->dyna.actor.world.pos.z;
phi_a1 = this->dyna.actor.child->world.pos.z;
if (this->index == 3) {
phi_a3 = this->dyna.actor.posRot.pos.x;
phi_t0 = this->dyna.actor.child->posRot.pos.x;
phi_a3 = this->dyna.actor.world.pos.x;
phi_t0 = this->dyna.actor.child->world.pos.x;
} else { // this->index == 1
phi_a3 = this->dyna.actor.child->posRot.pos.x;
phi_t0 = this->dyna.actor.posRot.pos.x;
phi_a3 = this->dyna.actor.child->world.pos.x;
phi_t0 = this->dyna.actor.world.pos.x;
}
} else {
phi_v1 = this->dyna.actor.posRot.pos.x;
phi_a1 = this->dyna.actor.child->posRot.pos.x;
phi_v1 = this->dyna.actor.world.pos.x;
phi_a1 = this->dyna.actor.child->world.pos.x;
if (this->index == 0) {
phi_a3 = this->dyna.actor.posRot.pos.z;
phi_t0 = this->dyna.actor.child->posRot.pos.z;
phi_a3 = this->dyna.actor.world.pos.z;
phi_t0 = this->dyna.actor.child->world.pos.z;
} else { // this->index == 2
phi_a3 = this->dyna.actor.child->posRot.pos.z;
phi_t0 = this->dyna.actor.posRot.pos.z;
phi_a3 = this->dyna.actor.child->world.pos.z;
phi_t0 = this->dyna.actor.world.pos.z;
}
}
if ((phi_v1 == phi_a1) && ((phi_t0 - phi_a3) == 60)) {
@@ -315,7 +315,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, GlobalContext* globalCtx) {
static s32 firstFall = 0;
this->dyna.actor.velocity.y++;
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 433.0f, this->dyna.actor.velocity.y)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, 433.0f, this->dyna.actor.velocity.y)) {
this->dyna.actor.flags &= ~0x20;
this->dyna.actor.velocity.y = 0.0f;
sBlocksAtRest++;
@@ -344,8 +344,8 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) {
this->actionFunc = BgPoEvent_BlockSolved;
if ((this->type == 0) && (this->index == 0)) {
amy =
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->dyna.actor.posRot.pos.x + 30.0f,
this->dyna.actor.posRot.pos.y - 30.0f, this->dyna.actor.posRot.pos.z + 30.0f, 0,
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->dyna.actor.world.pos.x + 30.0f,
this->dyna.actor.world.pos.y - 30.0f, this->dyna.actor.world.pos.z + 30.0f, 0,
this->dyna.actor.shape.rot.y, 0, this->dyna.actor.params + 0x300);
if (amy != NULL) {
func_800800F8(globalCtx, 0xC62, 0x1E, amy, 0);
@@ -360,7 +360,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) {
sBlocksAtRest = 0;
}
if ((sPuzzleState == 0x40) || ((sPuzzleState == 0x10) && !Player_InCsMode(globalCtx))) {
this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z;
this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z;
this->actionFunc = BgPoEvent_BlockReset;
if (sPuzzleState == 0x10) {
sPuzzleState = 0x40;
@@ -398,16 +398,16 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) {
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speedXZ);
displacement = this->direction * blockPushDist;
this->dyna.actor.posRot.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.initPosRot.pos.x;
this->dyna.actor.posRot.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.initPosRot.pos.z;
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x;
this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z;
if (blockStop) {
player->stateFlags2 &= ~0x10;
if ((this->dyna.unk_150 > 0.0f) && (func_800435D8(globalCtx, &this->dyna, 0x1E, 0x32, -0x14) == 0)) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
}
this->dyna.unk_150 = 0.0f;
this->dyna.actor.initPosRot.pos.x = this->dyna.actor.posRot.pos.x;
this->dyna.actor.initPosRot.pos.z = this->dyna.actor.posRot.pos.z;
this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
blockPushDist = 0.0f;
this->dyna.actor.speedXZ = 0.0f;
this->direction = 5;
@@ -429,8 +429,8 @@ void BgPoEvent_BlockReset(BgPoEvent* this, GlobalContext* globalCtx) {
player->stateFlags2 &= ~0x10;
this->dyna.unk_150 = 0.0f;
}
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 493.0f, 1.0f) &&
Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.posRot.rot.z - 0x4000, 0x400)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, 493.0f, 1.0f) &&
Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.world.rot.z - 0x4000, 0x400)) {
this->index = (this->index + 1) % 4;
this->actionFunc = BgPoEvent_BlockFall;
@@ -448,7 +448,7 @@ void BgPoEvent_BlockSolved(BgPoEvent* this, GlobalContext* globalCtx) {
if (this->dyna.unk_150 != 0.0f) {
player->stateFlags2 &= ~0x10;
}
if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 369.0f, 2.0f)) {
if (Math_StepToF(&this->dyna.actor.world.pos.y, 369.0f, 2.0f)) {
sPuzzleState = 0x20;
Actor_Kill(&this->dyna.actor);
}
@@ -468,9 +468,9 @@ void BgPoEvent_AmyPuzzle(BgPoEvent* this, GlobalContext* globalCtx) {
Vec3f pos;
if (sPuzzleState == 0xF) {
pos.x = this->dyna.actor.posRot.pos.x - 5.0f;
pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.posRot.pos.y;
pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.posRot.pos.z;
pos.x = this->dyna.actor.world.pos.x - 5.0f;
pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.y;
pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.z;
EffectSsDeadDb_Spawn(globalCtx, &pos, &sZeroVec, &sZeroVec, 170, 0, 200, 255, 100, 170, 0, 255, 0, 1, 9, true);
} else if (sPuzzleState == 0x20) {
Actor_Kill(&this->dyna.actor);
@@ -525,9 +525,9 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) {
DECR(this->timer);
if (((this->timer == 0) || ((thisx->xzDistToLink < 150.0f) && (thisx->yDistToLink < 50.0f)) ||
(func_8002DD78(player) && (thisx->xzDistToLink < 320.0f) &&
((this->index != 2) ? (thisx->yDistToLink < 100.0f) : (thisx->yDistToLink < 0.0f)) &&
if (((this->timer == 0) || ((thisx->xzDistToPlayer < 150.0f) && (thisx->yDistToPlayer < 50.0f)) ||
(func_8002DD78(player) && (thisx->xzDistToPlayer < 320.0f) &&
((this->index != 2) ? (thisx->yDistToPlayer < 100.0f) : (thisx->yDistToPlayer < 0.0f)) &&
func_8002DFC8(thisx, 0x2000, globalCtx))) &&
((thisx->parent != NULL) || (thisx->child != NULL))) {
/*The third condition in the || is checking if
@@ -541,8 +541,8 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) {
this->actionFunc = BgPoEvent_PaintingVanish;
} else if (this->collider.base.acFlags & AC_HIT) {
if (!BgPoEvent_NextPainting(this)) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->posRot.pos.x,
thisx->posRot.pos.y - 40.0f, thisx->posRot.pos.z, 0, thisx->shape.rot.y, 0,
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->world.pos.x,
thisx->world.pos.y - 40.0f, thisx->world.pos.z, 0, thisx->shape.rot.y, 0,
thisx->params + ((this->type - 1) << 8));
func_800800F8(globalCtx, 0xC58, 0x50, thisx, 0);
func_80078884(NA_SE_SY_CORRECT_CHIME);
@@ -568,9 +568,9 @@ void BgPoEvent_PaintingBurn(BgPoEvent* this, GlobalContext* globalCtx) {
Vec3f sp54;
this->timer--;
sp54.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 5.0f) + this->dyna.actor.posRot.pos.x;
sp54.y = Rand_CenteredFloat(66.0f) + this->dyna.actor.posRot.pos.y;
sp54.z = Rand_CenteredFloat(50.0f) + this->dyna.actor.posRot.pos.z;
sp54.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 5.0f) + this->dyna.actor.world.pos.x;
sp54.y = Rand_CenteredFloat(66.0f) + this->dyna.actor.world.pos.y;
sp54.z = Rand_CenteredFloat(50.0f) + this->dyna.actor.world.pos.z;
if (this->timer >= 0) {
if (this->type == 2) {
EffectSsDeadDb_Spawn(globalCtx, &sp54, &sZeroVec, &sZeroVec, 100, 0, 255, 255, 150, 170, 255, 0, 0, 1, 9,
@@ -626,11 +626,11 @@ void BgPoEvent_Draw(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_po_event.c", 1508);
if ((this->type == 0) || (this->type == 1)) {
sp48 = (833.0f - this->dyna.actor.posRot.pos.y) * 0.0025f;
sp48 = (833.0f - this->dyna.actor.world.pos.y) * 0.0025f;
if (!(sp48 > 1.0f)) {
sp58.x = this->dyna.actor.posRot.pos.x;
sp58.y = this->dyna.actor.posRot.pos.y - 30.0f;
sp58.z = this->dyna.actor.posRot.pos.z;
sp58.x = this->dyna.actor.world.pos.x;
sp58.y = this->dyna.actor.world.pos.y - 30.0f;
sp58.z = this->dyna.actor.world.pos.z;
sp4C.y = 1.0f;
sp4C.x = sp4C.z = (sp48 * 0.3f) + 0.4f;
func_80033C30(&sp58, &sp4C, (u8)(155.0f + sp48 * 100.0f), globalCtx);

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