Merge remote-tracking branch 'upstream/master' into ovl_Eff_Dust

This commit is contained in:
angie
2021-01-23 01:22:30 -03:00
1003 changed files with 28386 additions and 22481 deletions
+12 -19
View File
@@ -776,22 +776,19 @@ s32 Audio_ResetStep(void) {
return 1;
}
#ifdef NON_EQUIVALENT
// first half matches, reorderings and regalloc in second half
void func_800DFBF8(void) {
s32 pad[6];
s32 i;
s32 j;
s32 pad1[4];
s16* mem;
u16 windowSize;
s32 persistentMem;
s32 temporaryMem;
s32 totalMem;
AudioSessionSettings* preset;
s32 wantMisc;
u32 intMask;
s32 i;
s32 j;
s32 pad2;
AudioSessionSettings* preset = &gAudioSessionPresets[gAudioContext.gAudioResetPresetIdToLoad];
preset = &gAudioSessionPresets[gAudioContext.gAudioResetPresetIdToLoad];
gAudioContext.gSampleDmaNumListItems = 0;
gAudioContext.gAudioBufferParameters.frequency = preset->frequency;
gAudioContext.gAudioBufferParameters.aiFrequency = osAiSetFrequency(gAudioContext.gAudioBufferParameters.frequency);
@@ -894,8 +891,8 @@ void func_800DFBF8(void) {
gAudioContext.gNumSynthesisReverbs = preset->numReverbs;
for (i = 0; i < gAudioContext.gNumSynthesisReverbs; i++) {
SynthesisReverb* reverb = &gAudioContext.gSynthesisReverbs[i];
ReverbSettings* settings = &preset->reverbSettings[i];
SynthesisReverb* reverb = &gAudioContext.gSynthesisReverbs[i];
reverb->downsampleRate = settings->downsampleRate;
reverb->windowSize = settings->windowSize * 64;
reverb->windowSize /= reverb->downsampleRate;
@@ -914,19 +911,19 @@ void func_800DFBF8(void) {
reverb->unk_1C = 0;
reverb->unk_20 = 0;
reverb->unk_03 = 0;
reverb->unk_24 = reverb->windowSize;
reverb->unk_02 = 2;
reverb->unk_00 = 1;
reverb->unk_24 = reverb->windowSize;
reverb->sound.sample = &reverb->sample;
reverb->sample.loop = &reverb->loop;
reverb->sound.tuning = 1.0f;
reverb->sample.bits4 = 4;
reverb->sample.bits2 = 0;
reverb->sample.bits24 = reverb->windowSize * 2;
reverb->sample.sampleAddr = (u8*)reverb->unk_28;
reverb->loop.start = 0;
reverb->loop.count = 1;
reverb->loop.end = reverb->windowSize;
reverb->sound.tuning = 1.0f;
reverb->sample.sampleAddr = (u8*)reverb->unk_28;
if (reverb->downsampleRate != 1) {
reverb->unk_0E = 0x8000 / reverb->downsampleRate;
@@ -934,7 +931,6 @@ void func_800DFBF8(void) {
reverb->unk_34 = Audio_AllocZeroed(&gAudioContext.gNotesAndBuffersPool, 0x20);
reverb->unk_38 = Audio_AllocZeroed(&gAudioContext.gNotesAndBuffersPool, 0x20);
reverb->unk_3C = Audio_AllocZeroed(&gAudioContext.gNotesAndBuffersPool, 0x20);
reverb = reverb;
for (j = 0; j < gAudioContext.gAudioBufferParameters.updatesPerFrame; j++) {
mem = func_800DE258(&gAudioContext.gNotesAndBuffersPool, 0x340);
reverb->items[0][j].toDownsampleLeft = mem;
@@ -963,9 +959,9 @@ void func_800DFBF8(void) {
}
Audio_InitSequencePlayers();
for (i = 0; i < gAudioContext.gAudioBufferParameters.numSequencePlayers; i++) {
func_800EC734(i);
Audio_ResetSequencePlayer(&gAudioContext.gSequencePlayers[i]);
for (j = 0; j < gAudioContext.gAudioBufferParameters.numSequencePlayers; j++) {
func_800EC734(j);
Audio_ResetSequencePlayer(&gAudioContext.gSequencePlayers[j]);
}
func_800E0634(preset->unk_30, preset->unk_34);
@@ -980,9 +976,6 @@ void func_800DFBF8(void) {
osWritebackDCacheAll();
osSetIntMask(intMask);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_800DFBF8.s")
#endif
void* func_800E04E8(s32 poolIdx, s32 id) {
s32 i;
+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,
+436 -426
View File
File diff suppressed because it is too large Load Diff
+7 -7
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);
@@ -4390,7 +4390,7 @@ void BgCheck_DrawDynaPolyList(GlobalContext* globalCtx, CollisionContext* colCtx
vC.y += AREG(26) * ny;
vC.z += AREG(26) * nz;
}
func_8005B2AC(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b);
Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b);
if (curNode->next == SS_NULL) {
break;
}
@@ -4461,7 +4461,7 @@ void BgCheck_DrawStaticPoly(GlobalContext* globalCtx, CollisionContext* colCtx,
vC.y += AREG(26) * ny;
vC.z += AREG(26) * nz;
}
func_8005B2AC(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b);
Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b);
}
/**
@@ -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);
}
+96 -96
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);
@@ -3382,8 +3382,8 @@ s32 Camera_KeepOn3(Camera* camera) {
Camera_Vec3fVecSphGeoAdd(&lineChkPointB, &anim->atTarget, &atToEyeAdj);
if (!(keep3->flags & 0x80)) {
while (i < angleCnt) {
if (!func_800626B0(camera->globalCtx, &camera->globalCtx->colChkCtx, &anim->atTarget, &lineChkPointB,
&colChkActors, 2) &&
if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &anim->atTarget,
&lineChkPointB, &colChkActors, 2) &&
!Camera_BGCheck(camera, &anim->atTarget, &lineChkPointB)) {
break;
}
@@ -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)
@@ -3666,8 +3666,8 @@ s32 Camera_KeepOn4(Camera* camera) {
if (!(keep4->unk_1C & 1)) {
angleCnt = ARRAY_COUNT(D_8011D3B0);
for (i = 0; i < angleCnt; i++) {
if (!func_800626B0(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50, &D_8015BD70, spCC,
sp9C) &&
if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50,
&D_8015BD70, spCC, sp9C) &&
!Camera_BGCheck(camera, &D_8015BD50, &D_8015BD70)) {
break;
}
@@ -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;
+767 -51
View File
@@ -1,109 +1,825 @@
#include "global.h"
DamageTable D_8011DB20[] = {
static DamageTable sDamageTablePresets[] = {
{ {
0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 0
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0xE),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0xF),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0xF),
/* Master sword */ DMG_ENTRY(2, 0xF),
/* Giant's Knife */ DMG_ENTRY(2, 0xF),
/* Fire arrow */ DMG_ENTRY(2, 0x2),
/* Ice arrow */ DMG_ENTRY(1, 0x0),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(2, 0x2),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 1 Used by En_Karebaba
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0xE),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0xF),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0xF),
/* Master sword */ DMG_ENTRY(2, 0xF),
/* Giant's Knife */ DMG_ENTRY(2, 0xF),
/* Fire arrow */ DMG_ENTRY(2, 0x2),
/* Ice arrow */ DMG_ENTRY(1, 0x0),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(2, 0x2),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
// 2 Used by En_St, En_Ssh
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(2, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x1),
/* Normal arrow */ DMG_ENTRY(2, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(2, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(4, 0x0),
/* Ice arrow */ DMG_ENTRY(4, 0x0),
/* Light arrow */ DMG_ENTRY(4, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(3, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(4, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(4, 0x0),
/* Master jump */ DMG_ENTRY(8, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
// 3
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(1, 0x0),
/* Hookshot */ DMG_ENTRY(1, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(1, 0x0),
/* Giant's Knife */ DMG_ENTRY(1, 0x0),
/* Fire arrow */ DMG_ENTRY(1, 0x0),
/* Ice arrow */ DMG_ENTRY(1, 0x0),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(1, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(1, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(1, 0x0),
/* Fire magic */ DMG_ENTRY(1, 0x0),
/* Ice magic */ DMG_ENTRY(1, 0x0),
/* Light magic */ DMG_ENTRY(1, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(2, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(2, 0x0),
/* Master jump */ DMG_ENTRY(2, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
// 4 Used by En_Dodojr
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(2, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(2, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(2, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(4, 0x0),
/* Ice arrow */ DMG_ENTRY(4, 0x0),
/* Light arrow */ DMG_ENTRY(4, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(4, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(4, 0x0),
/* Master jump */ DMG_ENTRY(8, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x31, 0x01, 0x00, 0x00,
0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 5
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x1),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(1, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(1, 0x0),
/* Giant's Knife */ DMG_ENTRY(1, 0x0),
/* Fire arrow */ DMG_ENTRY(1, 0x0),
/* Ice arrow */ DMG_ENTRY(1, 0x3),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(1, 0x3),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(1, 0x0),
/* Master spin */ DMG_ENTRY(1, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 6
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(3, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(6, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(4, 0x0),
/* Hammer swing */ DMG_ENTRY(4, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(2, 0x0),
/* Master sword */ DMG_ENTRY(6, 0x0),
/* Giant's Knife */ DMG_ENTRY(0, 0x0),
/* Fire arrow */ DMG_ENTRY(6, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00,
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 7
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(3, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(6, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(4, 0x0),
/* Hammer swing */ DMG_ENTRY(4, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(2, 0x0),
/* Master sword */ DMG_ENTRY(6, 0x0),
/* Giant's Knife */ DMG_ENTRY(0, 0x0),
/* Fire arrow */ DMG_ENTRY(6, 0x0),
/* Ice arrow */ DMG_ENTRY(6, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(4, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 8
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(3, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(4, 0x0),
/* Hammer swing */ DMG_ENTRY(4, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(2, 0x0),
/* Master sword */ DMG_ENTRY(0, 0x0),
/* Giant's Knife */ DMG_ENTRY(0, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(4, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
// 9 Used by En_Bubble
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(2, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(0, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(2, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(4, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(4, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(4, 0x0),
/* Master jump */ DMG_ENTRY(8, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x00, 0xE2, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00,
0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 10
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(2, 0xE),
/* Boomerang */ DMG_ENTRY(0, 0x1),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0xF),
/* Master sword */ DMG_ENTRY(2, 0xF),
/* Giant's Knife */ DMG_ENTRY(2, 0xF),
/* Fire arrow */ DMG_ENTRY(2, 0x2),
/* Ice arrow */ DMG_ENTRY(2, 0x3),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(2, 0x2),
/* Ice magic */ DMG_ENTRY(2, 0x3),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 11 Used by En_Horse
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(0, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(0, 0x0),
/* Hammer swing */ DMG_ENTRY(0, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(9, 0x0),
/* Master sword */ DMG_ENTRY(0, 0x0),
/* Giant's Knife */ DMG_ENTRY(0, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 12
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(4, 0x0),
/* Hammer swing */ DMG_ENTRY(4, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(2, 0x0),
/* Master sword */ DMG_ENTRY(4, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(4, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x02, 0x22, 0x01, 0x01, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 13
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x1),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(2, 0x0),
/* Fire arrow */ DMG_ENTRY(2, 0x2),
/* Ice arrow */ DMG_ENTRY(1, 0x0),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(2, 0x2),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(1, 0x0),
/* Master spin */ DMG_ENTRY(1, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
// 14 Used by En_Sw
/* Deku nut */ DMG_ENTRY(1, 0x0),
/* Deku stick */ DMG_ENTRY(2, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(2, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(2, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(4, 0x0),
/* Ice arrow */ DMG_ENTRY(4, 0x0),
/* Light arrow */ DMG_ENTRY(4, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(4, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(4, 0x0),
/* Master jump */ DMG_ENTRY(8, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 15 Used by En_Fd
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(0, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(0, 0x0),
/* Hammer swing */ DMG_ENTRY(0, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(0, 0x0),
/* Master sword */ DMG_ENTRY(0, 0x0),
/* Giant's Knife */ DMG_ENTRY(0, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
// 16 Used by En_Fw
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(2, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(2, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(2, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(4, 0x0),
/* Fire arrow */ DMG_ENTRY(4, 0x0),
/* Ice arrow */ DMG_ENTRY(4, 0x0),
/* Light arrow */ DMG_ENTRY(4, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(4, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(4, 0x0),
/* Kokiri jump */ DMG_ENTRY(2, 0x0),
/* Giant jump */ DMG_ENTRY(4, 0x0),
/* Master jump */ DMG_ENTRY(8, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 17
/* Deku nut */ DMG_ENTRY(1, 0x0),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(1, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(1, 0x0),
/* Hookshot */ DMG_ENTRY(1, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(1, 0x0),
/* Giant's Knife */ DMG_ENTRY(1, 0x0),
/* Fire arrow */ DMG_ENTRY(1, 0x0),
/* Ice arrow */ DMG_ENTRY(1, 0x0),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(1, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(1, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(1, 0x0),
/* Fire magic */ DMG_ENTRY(1, 0x0),
/* Ice magic */ DMG_ENTRY(1, 0x0),
/* Light magic */ DMG_ENTRY(1, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 18
/* Deku nut */ DMG_ENTRY(1, 0x0),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(1, 0x0),
/* Boomerang */ DMG_ENTRY(1, 0x0),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(1, 0x0),
/* Hookshot */ DMG_ENTRY(1, 0x0),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(1, 0x0),
/* Giant's Knife */ DMG_ENTRY(1, 0x0),
/* Fire arrow */ DMG_ENTRY(1, 0x0),
/* Ice arrow */ DMG_ENTRY(1, 0x0),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(1, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(1, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(1, 0x0),
/* Fire magic */ DMG_ENTRY(1, 0x0),
/* Ice magic */ DMG_ENTRY(1, 0x0),
/* Light magic */ DMG_ENTRY(1, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x00, 0x02, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00,
0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 19
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(2, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x1),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0xF),
/* Master sword */ DMG_ENTRY(2, 0xF),
/* Giant's Knife */ DMG_ENTRY(2, 0xF),
/* Fire arrow */ DMG_ENTRY(2, 0x2),
/* Ice arrow */ DMG_ENTRY(2, 0x3),
/* Light arrow */ DMG_ENTRY(1, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(2, 0x2),
/* Ice magic */ DMG_ENTRY(2, 0x3),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x01, 0xF2, 0xE0, 0x01, 0xD2, 0x10, 0x01, 0x02, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00,
0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 20
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(1, 0x0),
/* Explosive */ DMG_ENTRY(2, 0xF),
/* Boomerang */ DMG_ENTRY(0, 0xE),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(2, 0xD),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(2, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(2, 0x3),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(2, 0x3),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(2, 0x0),
/* Master spin */ DMG_ENTRY(2, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x10, 0x01, 0x00, 0xF0, 0x10, 0x01, 0xF0, 0x10, 0x01, 0x02, 0x02, 0x00, 0x12, 0x00, 0x00, 0x00,
0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 21
/* Deku nut */ DMG_ENTRY(0, 0x1),
/* Deku stick */ DMG_ENTRY(1, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0xF),
/* Boomerang */ DMG_ENTRY(0, 0x1),
/* Normal arrow */ DMG_ENTRY(1, 0x0),
/* Hammer swing */ DMG_ENTRY(0, 0xF),
/* Hookshot */ DMG_ENTRY(0, 0x1),
/* Kokiri sword */ DMG_ENTRY(1, 0x0),
/* Master sword */ DMG_ENTRY(2, 0x0),
/* Giant's Knife */ DMG_ENTRY(2, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(2, 0x1),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(2, 0x1),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(1, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
{ {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// 22 Used by En_Du, En_Go, En_Ma1, En_Ma2, En_Ma3
/* Deku nut */ DMG_ENTRY(0, 0x0),
/* Deku stick */ DMG_ENTRY(0, 0x0),
/* Slingshot */ DMG_ENTRY(0, 0x0),
/* Explosive */ DMG_ENTRY(0, 0x0),
/* Boomerang */ DMG_ENTRY(0, 0x0),
/* Normal arrow */ DMG_ENTRY(0, 0x0),
/* Hammer swing */ DMG_ENTRY(0, 0x0),
/* Hookshot */ DMG_ENTRY(0, 0x0),
/* Kokiri sword */ DMG_ENTRY(0, 0x0),
/* Master sword */ DMG_ENTRY(0, 0x0),
/* Giant's Knife */ DMG_ENTRY(0, 0x0),
/* Fire arrow */ DMG_ENTRY(0, 0x0),
/* Ice arrow */ DMG_ENTRY(0, 0x0),
/* Light arrow */ DMG_ENTRY(0, 0x0),
/* Unk arrow 1 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 2 */ DMG_ENTRY(0, 0x0),
/* Unk arrow 3 */ DMG_ENTRY(0, 0x0),
/* Fire magic */ DMG_ENTRY(0, 0x0),
/* Ice magic */ DMG_ENTRY(0, 0x0),
/* Light magic */ DMG_ENTRY(0, 0x0),
/* Shield */ DMG_ENTRY(0, 0x0),
/* Mirror Ray */ DMG_ENTRY(0, 0x0),
/* Kokiri spin */ DMG_ENTRY(0, 0x0),
/* Giant spin */ DMG_ENTRY(0, 0x0),
/* Master spin */ DMG_ENTRY(0, 0x0),
/* Kokiri jump */ DMG_ENTRY(0, 0x0),
/* Giant jump */ DMG_ENTRY(0, 0x0),
/* Master jump */ DMG_ENTRY(0, 0x0),
/* Unknown 1 */ DMG_ENTRY(0, 0x0),
/* Unblockable */ DMG_ENTRY(0, 0x0),
/* Hammer jump */ DMG_ENTRY(0, 0x0),
/* Unknown 2 */ DMG_ENTRY(0, 0x0),
} },
};
// Gets the pointer to one of the 23 preset damage tables. Returns NULL if index is out of range.
DamageTable* DamageTable_Get(s32 index) {
if (index < 0 || index >= 23) {
if (!(0 <= index && index < ARRAY_COUNT(sDamageTablePresets))) {
// Index over
osSyncPrintf("CollisionBtlTbl_get():インデックスオーバー\n");
return 0;
return NULL;
}
return &D_8011DB20[index];
return &sDamageTablePresets[index];
}
void func_8005B248(DamageTable* table) {
// Sets all entries in the damage table to 0x00
void DamageTable_Clear(DamageTable* table) {
s32 i;
for (i = 0; i < 32; i++) {
table->table[i] = 0;
+2129 -1790
View File
File diff suppressed because it is too large Load Diff
+43 -30
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),
@@ -34,8 +34,22 @@ const ActorInit En_A_Obj_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x39, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_ALL,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK2,
{ 0x00000000, 0x00, 0x00 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_ON,
},
{ 25, 60, 0, { 0, 0, 0 } },
};
@@ -94,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;
@@ -107,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:
@@ -132,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 = 0xFF;
thisx->unk_1F = 0;
thisx->colChkInfo.mass = MASS_IMMOVABLE;
thisx->targetMode = 0;
break;
case A_OBJ_KNOB:
thisx->gravity = -1.5f;
@@ -152,7 +166,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (thisx->params < 5) {
thisx->colChkInfo.mass = 0xFF;
thisx->colChkInfo.mass = MASS_IMMOVABLE;
}
if (this->dyna.bgId != BGACTOR_NEG_ONE) {
@@ -187,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);
@@ -201,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);
}
@@ -212,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;
@@ -234,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;
}
}
}
@@ -251,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;
}
@@ -282,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);
@@ -303,20 +316,20 @@ 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:
case A_OBJ_SIGNPOST_ARROW:
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
+59 -59
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,26 +490,26 @@ 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;
}
}
}
Collider_CylinderUpdate(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
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);
+12 -12
View File
@@ -237,7 +237,7 @@ void Gameplay_Init(GameState* thisx) {
func_8006BA00(globalCtx);
Effect_InitContext(globalCtx);
EffectSs_InitInfo(globalCtx, 0x55);
func_8005D3BC(globalCtx, &globalCtx->colChkCtx);
CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx);
AnimationContext_Reset(&globalCtx->animationCtx);
func_8006450C(globalCtx, &globalCtx->csCtx);
@@ -835,7 +835,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
LOG_NUM("1", 1, "../z_play.c", 3612);
}
func_8006139C(globalCtx, &globalCtx->colChkCtx);
CollisionCheck_AT(globalCtx, &globalCtx->colChkCtx);
if (1 && HREG(63)) {
LOG_NUM("1", 1, "../z_play.c", 3618);
@@ -847,13 +847,13 @@ void Gameplay_Update(GlobalContext* globalCtx) {
LOG_NUM("1", 1, "../z_play.c", 3624);
}
func_800622E4(globalCtx, &globalCtx->colChkCtx);
CollisionCheck_Damage(globalCtx, &globalCtx->colChkCtx);
if (1 && HREG(63)) {
LOG_NUM("1", 1, "../z_play.c", 3631);
}
CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx);
CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx);
if (1 && HREG(63)) {
LOG_NUM("1", 1, "../z_play.c", 3637);
@@ -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),
+21 -22
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;
@@ -945,7 +945,7 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w
Vec3f* newBase) {
if (weaponInfo->active == 0) {
if (collider != NULL) {
Collider_QuadSetAT(globalCtx, &collider->base);
Collider_ResetQuadAT(globalCtx, &collider->base);
}
Math_Vec3f_Copy(&weaponInfo->tip, newTip);
Math_Vec3f_Copy(&weaponInfo->base, newBase);
@@ -955,12 +955,12 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w
(weaponInfo->tip.z == newTip->z) && (weaponInfo->base.x == newBase->x) &&
(weaponInfo->base.y == newBase->y) && (weaponInfo->base.z == newBase->z)) {
if (collider != NULL) {
Collider_QuadSetAT(globalCtx, &collider->base);
Collider_ResetQuadAT(globalCtx, &collider->base);
}
return 0;
} else {
if (collider != NULL) {
func_80062734(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip);
Collider_SetQuadVertices(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base);
}
Math_Vec3f_Copy(&weaponInfo->base, newBase);
@@ -972,22 +972,22 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w
void func_80090604(GlobalContext* globalCtx, Player* this, ColliderQuad* collider, Vec3f* quadSrc) {
static u8 shieldColTypes[PLAYER_SHIELD_MAX] = {
COLTYPE_METAL_SHIELD,
COLTYPE_WOODEN_SHIELD,
COLTYPE_METAL_SHIELD,
COLTYPE_METAL_SHIELD,
COLTYPE_METAL,
COLTYPE_WOOD,
COLTYPE_METAL,
COLTYPE_METAL,
};
if (this->stateFlags1 & 0x400000) {
Vec3f quadDest[4];
this->shieldQuad.base.type = shieldColTypes[this->currentShield];
this->shieldQuad.base.colType = shieldColTypes[this->currentShield];
Matrix_MultVec3f(&quadSrc[0], &quadDest[0]);
Matrix_MultVec3f(&quadSrc[1], &quadDest[1]);
Matrix_MultVec3f(&quadSrc[2], &quadDest[2]);
Matrix_MultVec3f(&quadSrc[3], &quadDest[3]);
func_80062734(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]);
Collider_SetQuadVertices(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &collider->base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base);
@@ -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);
}
}
}
+1 -1
View File
@@ -527,7 +527,7 @@ RomFile sNaviMsgFiles[] = {
s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };
u32 gObjectTableSize = 402;
u32 gObjectTableSize = ARRAY_COUNT(gObjectTable);
RomFile gObjectTable[] = {
ROM_FILE_UNSET,
+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;
}
/**
+37 -23
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),
@@ -25,8 +25,22 @@ const ActorInit Arms_Hook_InitVars = {
};
ColliderQuadInit sQuadInit = {
{ COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD },
{ 0x02, { 0x00000080, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_PLAYER,
AC_NONE,
OC1_NONE,
OC2_TYPE_PLAYER,
COLSHAPE_QUAD,
},
{
ELEMTYPE_UNK2,
{ 0x00000080, 0x00, 0x01 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ 0 },
};
@@ -58,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) {
@@ -116,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;
}
}
@@ -126,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) {
@@ -161,10 +175,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
ArmsHook_CheckForCancel(this);
if (this->timer != 0) {
if ((this->collider.base.atFlags & 2) && (this->collider.body.atHitItem->flags != 4)) {
if ((this->collider.base.atFlags & AT_HIT) && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
touchedActor = this->collider.base.at;
if ((touchedActor->update != NULL) && (touchedActor->flags & 0x600)) {
if (this->collider.body.atHitItem->bumperFlags & 4) {
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
ArmsHook_AttachHookToActor(this, touchedActor);
if ((touchedActor->flags & 0x400) == 0x400) {
func_80865044(this);
@@ -186,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;
@@ -198,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;
@@ -225,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);
}
@@ -244,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;
}
@@ -252,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);
@@ -262,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) {
@@ -278,7 +292,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
&D_801333E0, &D_801333E8);
return;
}
func_80062D60(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;
@@ -328,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),
@@ -45,8 +45,22 @@ const ActorInit Bg_Bdan_Objects_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_HARD,
BUMP_NONE,
OCELEM_NONE,
},
{ 0x00BB, 0x0050, 0x0000, { 0 } },
};
@@ -107,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;
}
@@ -115,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;
@@ -145,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;
}
@@ -167,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 {
@@ -188,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;
@@ -229,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;
@@ -242,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);
@@ -266,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;
}
}
}
@@ -298,22 +312,22 @@ void func_8086C5BC(BgBdanObjects* this, GlobalContext* globalCtx) {
}
void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) {
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
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;
}
@@ -322,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);
}
@@ -330,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 {
@@ -367,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;
}
@@ -383,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) {
@@ -412,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);
}
}
@@ -421,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;
@@ -434,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);
}
@@ -443,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),
@@ -59,17 +59,31 @@ extern CollisionHeader D_06005CF8;
extern Gfx D_060061A0[];
extern Gfx D_06005A20[];
static ColliderJntSphItemInit sJntSphItemsInit[] = {
static ColliderJntSphElementInit sJntSphElementsInit[] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0xEFC1FFFE, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_ON,
},
{ 0, { { 0, 120, 0 }, 370 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
1,
sJntSphItemsInit,
sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
@@ -121,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) {
@@ -140,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:
@@ -152,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);
@@ -256,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);
}
}
}
@@ -323,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);
}
}
@@ -333,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);
}
}
}
@@ -398,14 +412,14 @@ void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) {
default:
return;
case YELLOW_TALL_1:
if (((this->collider.base.acFlags & 2) != 0) && this->unk_1D8 <= 0) {
if (((this->collider.base.acFlags & AC_HIT) != 0) && this->unk_1D8 <= 0) {
this->unk_1D8 = 0xA;
func_8086DC30(this);
func_8086D4B4(this, globalCtx);
}
break;
case YELLOW_TALL_2:
if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) {
if (((this->collider.base.acFlags & AC_HIT) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) {
this->unk_1D8 = 0xA;
func_8086DC30(this);
func_8086D4B4(this, globalCtx);
@@ -419,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);
@@ -441,7 +455,7 @@ void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) {
}
break;
case YELLOW_TALL_2:
if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) {
if (((this->collider.base.acFlags & AC_HIT) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) {
this->unk_1D8 = 0xA;
func_8086DDA8(this);
func_8086D548(this, globalCtx);
@@ -455,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) {
@@ -466,35 +480,34 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) {
}
void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgBdanSwitch* this = THIS;
s32 type;
s32 temp;
if (this->unk_1DA > 0) {
this->unk_1DA -= 1;
this->unk_1DA--;
}
this->actionFunc(this, globalCtx);
func_8086D0EC(this);
type = this->dyna.actor.params & 0xFF;
if (type != 3 && type != 4) {
this->unk_1D8 -= 1;
return;
this->unk_1D8--;
} else {
if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) {
this->unk_1D8--;
}
this->unk_1DC = this->collider.base.acFlags;
this->collider.base.acFlags &= ~AC_HIT;
this->collider.elements[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f;
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) {
this->unk_1D8 -= 1;
}
temp = this->collider.base.acFlags;
this->collider.base.acFlags &= 0xFFFD;
this->unk_1DC = temp;
this->collider.list[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f;
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
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);
}
@@ -510,8 +523,8 @@ void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) {
case YELLOW_TALL_1:
case YELLOW_TALL_2:
func_8086DF58(this, globalCtx, D_060061A0);
func_800628A4(0, &this->collider);
Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.posRot2.pos);
Collider_UpdateSpheres(0, &this->collider);
Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.focus.pos);
break;
case BLUE:
func_8086DF58(this, globalCtx, D_06005A20);
@@ -21,7 +21,7 @@ typedef struct BgBdanSwitch {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgBdanSwitchActionFunc actionFunc;
/* 0x0168 */ ColliderJntSph collider;
/* 0x0188 */ ColliderJntSphItem colliderItems[1];
/* 0x0188 */ ColliderJntSphElement colliderItems[1];
/* 0x01C8 */ f32 unk_1C8;
/* 0x01CC */ s16 unk_1CC;
/* 0x01CE */ char unk_1CE[0x2];
@@ -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;
}
}
@@ -25,30 +25,58 @@ extern CollisionHeader D_050041B0;
extern Gfx D_05003FC0[];
extern Gfx D_05004088[];
static ColliderTrisItemInit sTrimItemInit[3] = {
static ColliderTrisElementInit sTrisElementsInit[3] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000048, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { -70.0f, 176.0f, 0.0f }, { -70.0f, -4.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000048, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { 70.0f, 176.0f, 0.0f }, { -70.0f, 176.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000048, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { 70.0f, -4.0f, 0.0f }, { 70.0f, 176.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } },
},
};
static ColliderTrisInit sTrisInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_TRIS,
},
3,
sTrimItemInit,
sTrisElementsInit,
};
const ActorInit Bg_Bombwall_InitVars = {
ACTOR_BG_BOMBWALL,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_GAMEPLAY_FIELD_KEEP,
sizeof(BgBombwall),
@@ -109,17 +137,17 @@ void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i <= 2; i++) {
for (j = 0; j <= 2; j++) {
sp80.x = sTrisInit.list[i].dim.vtx[j].x;
sp80.y = sTrisInit.list[i].dim.vtx[j].y;
sp80.z = sTrisInit.list[i].dim.vtx[j].z + 2.0f;
sp80.x = sTrisInit.elements[i].dim.vtx[j].x;
sp80.y = sTrisInit.elements[i].dim.vtx[j].y;
sp80.z = sTrisInit.elements[i].dim.vtx[j].z + 2.0f;
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;
}
func_800627A0(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]);
Collider_SetTrisVertices(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]);
}
this->unk_2A2 |= 1;
@@ -159,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;
@@ -187,11 +215,11 @@ void func_8086ED50(BgBombwall* this, GlobalContext* globalCtx) {
}
void func_8086ED70(BgBombwall* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 2) {
this->collider.base.acFlags &= ~2;
if (this->collider.base.acFlags & AC_HIT) {
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);
}
}
@@ -11,7 +11,7 @@ typedef void (*BgBombwallActionFunc)(struct BgBombwall*, GlobalContext*);
typedef struct BgBombwall {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderTris collider;
/* 0x0184 */ ColliderTrisItem colliderItems[3];
/* 0x0184 */ ColliderTrisElement colliderItems[3];
/* 0x0298 */ BgBombwallActionFunc actionFunc;
/* 0x029C */ Gfx* dList;
/* 0x02A0 */ s16 unk_2A0;
@@ -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),
@@ -33,6 +33,26 @@ const ActorInit Bg_Breakwall_InitVars = {
(ActorFunc)BgBreakwall_Update,
NULL,
};
static ColliderQuadInit D_80870760 = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_QUAD,
},
{
ELEMTYPE_UNK0,
{ 0x00000048, 0x00, 0x00 },
{ 0x00000048, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/BgBreakwall_SetupAction.s")
@@ -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),
@@ -32,8 +32,22 @@ const ActorInit Bg_Ddan_Kd_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_ALL,
OC1_NONE,
OC2_NONE,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK2,
{ 0x00000000, 0x00, 0x00 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 245, 180, -400, { 0, 0, 0 } },
};
@@ -73,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);
}
}
@@ -94,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 {
@@ -104,11 +118,11 @@ 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_CylinderUpdate(&this->dyna.actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -120,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;
@@ -139,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);
@@ -151,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),
@@ -34,14 +34,42 @@ const ActorInit Bg_Dodoago_InitVars = {
};
static ColliderCylinderInit sColCylinderInit0 = {
{ COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_ALL,
OC1_NONE,
OC2_NONE,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK2,
{ 0x00000000, 0x00, 0x00 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 80, 30, 80, { 0, 0, 0 } },
};
static ColliderCylinderInit sColCylinderInit1 = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x3D, 0x20, COLSHAPE_CYLINDER },
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_NONE,
AC_NONE,
OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK2,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 50, 60, 280, { 0, 0, 0 } },
};
@@ -123,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))) {
@@ -152,9 +180,9 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) {
} else {
if (Flags_GetEventChkInf(0xB0)) {
Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[0]);
Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[1]);
Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[2]);
Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[0]);
Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[1]);
Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[2]);
this->colliders[0].dim.pos.z += 0xC8;
this->colliders[1].dim.pos.z += 0xD7;
this->colliders[1].dim.pos.x += 0x5A;
@@ -192,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);
@@ -239,16 +267,17 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) {
EnBom* bomb;
if (this->dyna.actor.parent == NULL) {
if ((s32)(this->colliders[1].base.maskA & 2) || (this->colliders[2].base.maskA & 2)) {
if ((s32)(this->colliders[1].base.ocFlags1 & OC1_HIT) || (this->colliders[2].base.ocFlags1 & OC1_HIT)) {
if ((s32)(this->colliders[1].base.maskA & 2)) {
if ((s32)(this->colliders[1].base.ocFlags1 & OC1_HIT)) {
bomb = (EnBom*)this->colliders[1].base.oc;
} else {
bomb = (EnBom*)this->colliders[2].base.oc;
}
this->colliders[1].base.maskA &= ~2;
this->colliders[2].base.maskA &= ~2;
if (bomb->actor.type == ACTORTYPE_EXPLOSIVES && bomb->actor.id == ACTOR_EN_BOM && bomb->actor.params == 0) {
this->colliders[1].base.ocFlags1 &= ~OC1_HIT;
this->colliders[2].base.ocFlags1 &= ~OC1_HIT;
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),
@@ -33,8 +33,22 @@ const ActorInit Bg_Gnd_Soulmeiro_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00020800, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_1,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x00, 0x00 },
{ 0x00020800, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 50, 20, 20, { 0, 0, 0 } },
};
@@ -63,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;
@@ -116,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;
}
@@ -126,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;
}
}
@@ -159,13 +173,13 @@ void func_8087B284(BgGndSoulmeiro* this, GlobalContext* globalCtx) {
if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) {
this->actor.draw = BgGndSoulmeiro_Draw;
if (this->collider.base.acFlags & 2) {
if (this->collider.base.acFlags & AC_HIT) {
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->unk_198 = 40;
this->actionFunc = func_8087AF38;
return;
}
Collider_CylinderUpdate(&this->actor, &this->collider);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
+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),
@@ -41,42 +41,91 @@ const ActorInit Bg_Haka_Sgami_InitVars = {
NULL,
};
static ColliderTrisItemInit sTriItemsInit[] = {
static ColliderTrisElementInit sTrisElementsInit[4] = {
{
{ 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 },
{
ELEMTYPE_UNK2,
{ 0x20000000, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ { { 365.0f, 45.0f, 27.0f }, { 130.0f, 45.0f, 150.0f }, { 290.0f, 45.0f, 145.0f } } },
},
{
{ 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 },
{
ELEMTYPE_UNK2,
{ 0x20000000, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ { { 250.0f, 45.0f, 90.0f }, { 50.0f, 45.0f, 80.0f }, { 160.0f, 45.0f, 160.0f } } },
},
{
{ 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 },
{
ELEMTYPE_UNK2,
{ 0x20000000, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ { { -305.0f, 33.0f, -7.0f }, { -220.0f, 33.0f, 40.0f }, { -130.0f, 33.0f, -5.0f } } },
},
{
{ 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 },
{
ELEMTYPE_UNK2,
{ 0x20000000, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ { { -190.0f, 33.0f, 40.0f }, { -30.0f, 33.0f, 15.0f }, { -70.0f, 33.0f, -30.0f } } },
},
};
static ColliderTrisInit sTrisInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_TRIS },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_TRIS,
},
4,
sTriItemsInit,
sTrisElementsInit,
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_NONE,
AC_NONE,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 80, 130, 0, { 0, 0, 0 } },
};
static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, 0xFF };
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),
};
@@ -104,11 +153,11 @@ 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;
func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit);
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
for (i = 0; i < 4; i++) {
blureInit.p1StartColor[i] = sP1StartColor[i];
@@ -129,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) {
@@ -174,7 +223,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) {
f32 actorRotYSin;
f32 actorRotYCos;
s32 iterateCount;
ColliderTrisItemInit* colliderList;
ColliderTrisElementInit* elementInit;
if (this->timer != 0) {
this->timer--;
@@ -192,42 +241,43 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) {
iterateCount = (this->actor.params != 0) ? 4 : 2;
for (i = iterateCount - 2; i < iterateCount; i++) {
colliderList = &sTrisInit.list[i];
elementInit = &sTrisInit.elements[i];
for (j = 0; j < 3; j++) {
scytheVertices[j].x = this->actor.posRot.pos.x + colliderList->dim.vtx[j].z * actorRotYSin +
colliderList->dim.vtx[j].x * actorRotYCos;
scytheVertices[j].y = this->actor.posRot.pos.y + colliderList->dim.vtx[j].y;
scytheVertices[j].z = this->actor.posRot.pos.z + colliderList->dim.vtx[j].z * actorRotYCos -
colliderList->dim.vtx[j].x * 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.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;
}
func_800627A0(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]);
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;
}
func_800627A0(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]);
Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1],
&scytheVertices[2]);
}
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]);
@@ -17,7 +17,7 @@ typedef struct BgHakaSgami {
/* 0x0154 */ s32 blureEffectIndex[2];
/* 0x015C */ ColliderCylinder colliderScytheCenter;
/* 0x01A8 */ ColliderTris colliderScythe;
/* 0x01C8 */ ColliderTrisItem colliderScytheItems[4];
/* 0x01C8 */ ColliderTrisElement colliderScytheItems[4];
} BgHakaSgami; // size = 0x0338
extern const ActorInit Bg_Haka_Sgami_InitVars;
@@ -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),
@@ -43,29 +43,64 @@ const ActorInit Bg_Haka_Trap_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_METAL_SHIELD, 0x11, 0x0D, 0x09, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 },
{
COLTYPE_METAL,
AT_ON | AT_TYPE_ENEMY,
AC_ON | AC_HARD | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x00, 0x04 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_ON,
},
{ 30, 90, 0, { 0, 0, 0 } },
};
static ColliderTrisItemInit sTrisItemsInit[2] = {
static ColliderTrisElementInit sTrisElementsInit[2] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00020000, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { 1800.0f, 1200.0f, 0.0f }, { -1800.0f, 1200.0f, 0.0f }, { -1800.0f, 0.0f, 0.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00020000, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { 1800.0f, 1200.0f, 0.0f }, { -1800.0f, 0.0f, 0.0f }, { 1800.0f, 0.0f, 0.0f } } },
},
};
static ColliderTrisInit sTrisInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_TRIS,
},
2,
sTrisItemsInit,
sTrisElementsInit,
};
static CollisionCheckInfoInit sColChkInfoInit = { 0x00, 0x0050, 0x0064, 0xFF };
static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 100, MASS_IMMOVABLE };
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
@@ -117,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);
}
@@ -137,8 +172,8 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) {
this->colliderCylinder.dim.radius = 18;
this->colliderCylinder.dim.height = 115;
this->colliderCylinder.body.toucherFlags = this->colliderCylinder.body.toucherFlags;
this->colliderCylinder.body.toucherFlags |= 0x10;
this->colliderCylinder.info.toucherFlags = this->colliderCylinder.info.toucherFlags;
this->colliderCylinder.info.toucherFlags |= TOUCH_SFX_WOOD;
this->actionFunc = func_808801B8;
}
@@ -151,7 +186,7 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->uncullZoneScale = 500.0f;
}
func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit);
CollisionCheck_SetInfo(&thisx->colChkInfo, 0, &sColChkInfoInit);
}
void BgHakaTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -178,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);
@@ -192,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) {
@@ -201,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;
@@ -212,7 +247,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
func_8087FFC0(this, globalCtx);
if (this->colliderSpikes.base.acFlags & 2) {
if (this->colliderSpikes.base.acFlags & AC_HIT) {
this->timer = 20;
D_80880F30 = 1;
this->actionFunc = func_808802D8;
@@ -239,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);
@@ -267,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)) {
@@ -295,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) {
@@ -310,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;
}
@@ -331,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,
@@ -348,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);
}
@@ -362,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;
}
@@ -375,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;
}
@@ -402,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)) {
@@ -413,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) {
@@ -444,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);
@@ -475,13 +510,13 @@ void func_80880D68(BgHakaTrap* this) {
Vec3f vec2;
Vec3f vec1;
Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[0], &vec1);
Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[1], &vec2);
Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[2], &vec3);
func_800627A0(&this->colliderSpikes, 0, &vec1, &vec2, &vec3);
Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[0], &vec1);
Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[1], &vec2);
Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[2], &vec3);
Collider_SetTrisVertices(&this->colliderSpikes, 0, &vec1, &vec2, &vec3);
Matrix_MultVec3f(&sTrisItemsInit[1].dim.vtx[2], &vec2);
func_800627A0(&this->colliderSpikes, 1, &vec1, &vec3, &vec2);
Matrix_MultVec3f(&sTrisElementsInit[1].dim.vtx[2], &vec2);
Collider_SetTrisVertices(&this->colliderSpikes, 1, &vec1, &vec3, &vec2);
}
void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -508,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);
@@ -26,7 +26,7 @@ typedef struct BgHakaTrap {
/* 0x016C */ Vec3f unk_16C;
/* 0x0178 */ ColliderCylinder colliderCylinder;
/* 0x01C4 */ ColliderTris colliderSpikes;
/* 0x01E4 */ ColliderTrisItem colliderSpikesItem[2];
/* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2];
} BgHakaTrap; // size = 0x029C
extern const ActorInit Bg_Haka_Trap_InitVars;
@@ -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),
@@ -31,14 +31,42 @@ const ActorInit Bg_Haka_Tubo_InitVars = {
};
static ColliderCylinderInit sPotColliderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000008, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 25, 60, 30, { 0, 0, 0 } },
};
static ColliderCylinderInit sFlamesColliderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000008, 0x00, 0x00 }, 0x19, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000008, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 60, 45, 235, { 0, 0, 0 } },
};
@@ -85,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 & 2) {
this->flamesCollider.base.atFlags &= ~2;
func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsLink, 5.0f);
if (this->flamesCollider.base.atFlags & AT_HIT) {
this->flamesCollider.base.atFlags &= ~AT_HIT;
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 & 2) {
this->potCollider.base.acFlags &= ~2;
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;
@@ -112,8 +140,8 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) {
this->actionFunc = BgHakaTubo_DropCollectible;
}
} else {
Collider_CylinderUpdate(&this->dyna.actor, &this->flamesCollider);
Collider_CylinderUpdate(&this->dyna.actor, &this->potCollider);
Collider_UpdateCylinder(&this->dyna.actor, &this->flamesCollider);
Collider_UpdateCylinder(&this->dyna.actor, &this->potCollider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->potCollider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->flamesCollider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->flamesCollider.base);
@@ -129,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++;
@@ -144,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 {
@@ -180,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);
@@ -200,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));
@@ -8,20 +8,55 @@
#define FLAGS 0x00000010
typedef enum {
/* 0x0 */ STA_GIANT_BIRD_STATUE,
/* 0x1 */ STA_BOMBABLE_SKULL_WALL,
/* 0x2 */ STA_BOMBABLE_RUBBLE,
/* 0x3 */ STA_UNKNOWN
} ShadowTempleAssetsType;
#define THIS ((BgHakaZou*)thisx)
void BgHakaZou_Init(Actor* thisx, GlobalContext* globalCtx);
void BgHakaZou_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgHakaZou_Update(Actor* thisx, GlobalContext* globalCtx);
void BgHakaZou_Draw(Actor* thisx, GlobalContext* globalCtx);
extern UNK_TYPE D_06000A10;
extern UNK_TYPE D_06005E30;
extern UNK_TYPE D_06006F70;
void BgHakaZou_Wait(BgHakaZou* this, GlobalContext* globalCtx);
void func_80882BDC(BgHakaZou* this, GlobalContext* globalCtx);
void func_80883000(BgHakaZou* this, GlobalContext* globalCtx);
void func_80883104(BgHakaZou* this, GlobalContext* globalCtx);
void func_80883144(BgHakaZou* this, GlobalContext* globalCtx);
void func_80883254(BgHakaZou* this, GlobalContext* globalCtx);
void func_80883328(BgHakaZou* this, GlobalContext* globalCtx);
void func_808834D8(BgHakaZou* this, GlobalContext* globalCtx);
void BgHakaZou_DoNothing(BgHakaZou* this, GlobalContext* globalCtx);
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000008, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 5, 60, 0, { 0, 0, 0 } },
};
static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
/*
const ActorInit Bg_Haka_Zou_InitVars = {
ACTOR_BG_HAKA_ZOU,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgHakaZou),
@@ -30,35 +65,349 @@ const ActorInit Bg_Haka_Zou_InitVars = {
(ActorFunc)BgHakaZou_Update,
NULL,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Destroy.s")
static InitChainEntry sInitChain[] = {
ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808828F4.s")
extern Gfx D_06000A10[];
extern CollisionHeader D_06005E30;
extern CollisionHeader D_06006F70;
extern CollisionHeader D_06000C2C;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882A70.s")
void BgHakaZou_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHakaZou* this = THIS;
s32 pad;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882BDC.s")
Actor_ProcessInitChain(thisx, sInitChain);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882CC4.s")
this->switchFlag = (thisx->params >> 8) & 0xFF;
thisx->params &= 0xFF;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882E54.s")
if (thisx->params == STA_UNKNOWN) {
Actor_SetScale(thisx, (Rand_ZeroOne() * 0.005f) + 0.025f);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883000.s")
thisx->speedXZ = Rand_ZeroOne();
thisx->world.rot.y = thisx->shape.rot.y * ((Rand_ZeroOne() < 0.5f) ? -1 : 1) + Rand_CenteredFloat(4096.0f);
this->timer = 20;
thisx->world.rot.x = Rand_S16Offset(0x100, 0x300) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1);
thisx->world.rot.z = Rand_S16Offset(0x400, 0x800) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1);
} else {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
Collider_UpdateCylinder(thisx, &this->collider);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883104.s")
DynaPolyActor_Init(&this->dyna, 0);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883144.s")
if (thisx->params == STA_GIANT_BIRD_STATUE) {
thisx->uncullZoneForward = 2000.0f;
thisx->uncullZoneScale = 3000.0f;
thisx->uncullZoneDownward = 3000.0f;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883254.s")
this->requiredObjBankIndex = (thisx->params == STA_BOMBABLE_RUBBLE)
? Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKACH_OBJECTS)
: Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKA_OBJECTS);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883328.s")
if (this->requiredObjBankIndex < 0) {
Actor_Kill(thisx);
} else if ((thisx->params != STA_UNKNOWN) && Flags_GetSwitch(globalCtx, this->switchFlag)) {
if (thisx->params != STA_GIANT_BIRD_STATUE) {
Actor_Kill(thisx);
} else {
thisx->shape.rot.x = -0x4000;
thisx->world.pos.z -= 80.0f;
thisx->world.pos.y -= 54.0f;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808834D8.s")
this->actionFunc = BgHakaZou_Wait;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883568.s")
void BgHakaZou_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgHakaZou* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Update.s")
if (this->dyna.actor.params != STA_UNKNOWN) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
Collider_DestroyCylinder(globalCtx, &this->collider);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808835B8.s")
void func_808828F4(BgHakaZou* this, GlobalContext* globalCtx) {
Vec3f effectPos;
Vec3f effectVelocity;
f32 rand;
s32 i;
effectVelocity.x = 0.0f;
effectVelocity.y = 1.0f;
effectVelocity.z = 2.0f;
for (i = 0; i < 2; i++) {
if (i == 0) {
effectPos.x = this->dyna.actor.world.pos.x - (Rand_CenteredFloat(10.0f) + 112.0f);
} else {
effectPos.x = Rand_CenteredFloat(10.0f) + this->dyna.actor.world.pos.x;
}
rand = Rand_ZeroOne();
effectPos.y = this->dyna.actor.world.pos.y + (60.0f * rand);
effectPos.z = this->dyna.actor.world.pos.z + (112.0f * rand);
func_800286CC(globalCtx, &effectPos, &effectVelocity, &sZeroVec, (Rand_ZeroOne() * 200.0f) + 1000.0f, 100);
}
}
void BgHakaZou_Wait(BgHakaZou* this, GlobalContext* globalCtx) {
CollisionHeader* colHeader;
if (Object_IsLoaded(&globalCtx->objectCtx, this->requiredObjBankIndex)) {
this->dyna.actor.objBankIndex = this->requiredObjBankIndex;
this->dyna.actor.draw = BgHakaZou_Draw;
if (this->dyna.actor.params == STA_UNKNOWN) {
this->actionFunc = func_80882BDC;
return;
}
Actor_SetObjectDependency(globalCtx, &this->dyna.actor);
colHeader = NULL;
if (this->dyna.actor.params == STA_GIANT_BIRD_STATUE) {
CollisionHeader_GetVirtual(&D_06006F70, &colHeader);
this->collider.dim.radius = 80;
this->collider.dim.height = 100;
this->collider.dim.yShift = -30;
this->collider.dim.pos.x -= 56;
this->collider.dim.pos.z += 56;
this->dyna.actor.uncullZoneScale = 1500.0f;
} else if (this->dyna.actor.params == STA_BOMBABLE_SKULL_WALL) {
CollisionHeader_GetVirtual(&D_06005E30, &colHeader);
this->collider.dim.yShift = -50;
} else {
CollisionHeader_GetVirtual(&D_06000C2C, &colHeader);
this->collider.dim.radius = 55;
this->collider.dim.height = 20;
}
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if ((this->dyna.actor.params == STA_GIANT_BIRD_STATUE) && Flags_GetSwitch(globalCtx, this->switchFlag)) {
this->actionFunc = BgHakaZou_DoNothing;
return;
}
this->actionFunc = func_80883000;
}
}
void func_80882BDC(BgHakaZou* this, GlobalContext* globalCtx) {
if (this->timer != 0) {
this->timer--;
}
this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x;
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z;
if (this->dyna.actor.bgCheckFlags & 2) {
if (this->dyna.actor.velocity.y < -8.0f) {
this->dyna.actor.velocity.y *= -0.6f;
this->dyna.actor.velocity.y = (this->dyna.actor.velocity.y > 10.0f) ? 10.0f : this->dyna.actor.velocity.y;
this->dyna.actor.bgCheckFlags &= ~3;
this->dyna.actor.speedXZ = 2.0f;
} else {
Actor_Kill(&this->dyna.actor);
}
}
if (this->timer == 0) {
Actor_Kill(&this->dyna.actor);
}
}
void func_80882CC4(BgHakaZou* this, GlobalContext* globalCtx) {
s32 i;
s32 j;
Vec3f actorSpawnPos;
f32 sin;
f32 cos;
s32 pad;
sin = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 40.0f;
cos = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 40.0f;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
actorSpawnPos.x = this->dyna.actor.world.pos.x + (j - 1) * sin;
actorSpawnPos.z = this->dyna.actor.world.pos.z + (j - 1) * cos;
actorSpawnPos.y = this->dyna.actor.world.pos.y + (i - 1) * 55;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_HAKA_ZOU, actorSpawnPos.x, actorSpawnPos.y,
actorSpawnPos.z, 0, this->dyna.actor.shape.rot.y, 0, this->dyna.actor.params + 2);
func_800286CC(globalCtx, &actorSpawnPos, &sZeroVec, &sZeroVec, 1000, 50);
}
}
}
void func_80882E54(BgHakaZou* this, GlobalContext* globalCtx) {
Vec3f fragmentPos;
s32 i;
s32 j;
s32 num = 25;
fragmentPos.x = this->collider.dim.pos.x;
fragmentPos.y = this->collider.dim.pos.y;
fragmentPos.z = this->collider.dim.pos.z;
EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, D_06000A10);
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
fragmentPos.x = this->collider.dim.pos.x + (((j * 2) - 1) * num);
fragmentPos.z = this->collider.dim.pos.z + (((i * 2) - 1) * num);
EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, D_06000A10);
func_800286CC(globalCtx, &fragmentPos, &sZeroVec, &sZeroVec, 1000, 50);
}
}
}
void func_80883000(BgHakaZou* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 2) {
Flags_SetSwitch(globalCtx, this->switchFlag);
if (this->dyna.actor.params == STA_GIANT_BIRD_STATUE) {
this->timer = 20;
this->actionFunc = func_80883144;
func_800800F8(globalCtx, 3400, 999, &this->dyna.actor, 0);
} else if (this->dyna.actor.params == 2) {
func_80882E54(this, globalCtx);
this->dyna.actor.draw = NULL;
this->timer = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION);
this->actionFunc = func_80883104;
} else {
func_80882CC4(this, globalCtx);
this->timer = 1;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
this->actionFunc = func_80883104;
}
} else {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
void func_80883104(BgHakaZou* this, GlobalContext* globalCtx) {
if (this->timer != 0) {
this->timer--;
}
if (this->timer == 0) {
Actor_Kill(&this->dyna.actor);
}
}
void func_80883144(BgHakaZou* this, GlobalContext* globalCtx) {
Vec3f explosionPos;
if (this->timer != 0) {
this->timer--;
}
if (!(this->timer % 4)) {
explosionPos.x = Rand_CenteredFloat(200.0f) + (this->dyna.actor.world.pos.x - 56.0f);
explosionPos.y = (Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.y;
explosionPos.z = Rand_CenteredFloat(200.0f) + (this->dyna.actor.world.pos.z + 56.0f);
EffectSsBomb2_SpawnLayered(globalCtx, &explosionPos, &sZeroVec, &sZeroVec, 150, 70);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION);
}
if (this->timer == 0) {
this->timer = 20;
this->actionFunc = func_80883254;
}
}
void func_80883254(BgHakaZou* this, GlobalContext* globalCtx) {
f32 moveDist = (Rand_ZeroOne() * 0.5f) + 0.5f;
Math_StepToF(&this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.z - 80.0f, 2.0f * moveDist);
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 40.0f, moveDist)) {
if (this->timer != 0) {
this->timer--;
}
if (this->timer == 0) {
this->timer = 60;
this->dyna.actor.world.rot.x = 0x0008;
this->actionFunc = func_80883328;
}
} else {
func_808828F4(this, globalCtx);
}
}
void func_80883328(BgHakaZou* this, GlobalContext* globalCtx) {
Vec3f effectPos;
s32 i;
s32 j;
this->dyna.actor.world.rot.x += this->dyna.actor.world.rot.x * 0.125f;
if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, -0x4000, this->dyna.actor.world.rot.x) != 0) {
effectPos.x = this->dyna.actor.world.pos.x;
effectPos.y = this->dyna.actor.world.pos.y;
for (j = 0; j < 2; j++) {
effectPos.z = this->dyna.actor.world.pos.z;
for (i = 0; i < 4; i++) {
effectPos.z -= (i == 2) ? 550.0f : 50.0f;
func_800286CC(globalCtx, &effectPos, &sZeroVec, &sZeroVec, (Rand_ZeroOne() * 200.0f) + 1000.0f, 200);
}
effectPos.x -= 112.0f;
}
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND);
this->timer = 25;
this->actionFunc = func_808834D8;
}
}
void func_808834D8(BgHakaZou* this, GlobalContext* globalCtx) {
f32 moveDist;
if (this->timer != 0) {
this->timer--;
}
moveDist = ((this->timer % 2) ? 15.0f : -15.0f);
this->dyna.actor.world.pos.y += ((this->timer & 0xFE) * 0.04f * moveDist);
if (this->timer == 0) {
this->actionFunc = BgHakaZou_DoNothing;
}
}
void BgHakaZou_DoNothing(BgHakaZou* this, GlobalContext* globalCtx) {
}
void BgHakaZou_Update(Actor* thisx, GlobalContext* globalCtx) {
BgHakaZou* this = THIS;
this->actionFunc(this, globalCtx);
if (this->dyna.actor.params == 3) {
Actor_MoveForward(&this->dyna.actor);
}
}
void BgHakaZou_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* dLists[] = { 0x060064E0, 0x06005CE0, 0x06000A10, 0x06005CE0 };
Gfx_DrawDListOpa(globalCtx, dLists[thisx->params]);
}
@@ -6,9 +6,15 @@
struct BgHakaZou;
typedef void (*BgHakaZouActionFunc)(struct BgHakaZou*, GlobalContext*);
typedef struct BgHakaZou {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x6C];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgHakaZouActionFunc actionFunc;
/* 0x0168 */ s8 requiredObjBankIndex;
/* 0x0169 */ u8 switchFlag;
/* 0x016A */ s16 timer;
/* 0x016C */ ColliderCylinder collider;
} BgHakaZou; // size = 0x01B8
extern const ActorInit Bg_Haka_Zou_InitVars;
@@ -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),
@@ -33,18 +33,32 @@ typedef struct {
} BgHidanCurtainParams; // size = 0x10
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 81, 144, 0, { 0, 0, 0 } },
};
static CollisionCheckInfoInit sCcInfoInit = { 1, 0x50, 0x64, 0xFF };
static CollisionCheckInfoInit sCcInfoInit = { 1, 80, 100, MASS_IMMOVABLE };
static BgHidanCurtainParams sHCParams[] = { { 81, 144, 0.090f, 144.0f, 5.0f }, { 46, 88, 0.055f, 88.0f, 3.0f } };
const ActorInit Bg_Hidan_Curtain_InitVars = {
ACTOR_BG_HIDAN_CURTAIN,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(BgHidanCurtain),
@@ -60,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
@@ -83,19 +97,19 @@ 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_CylinderUpdate(&this->actor, &this->collider);
func_80061ED4(&thisx->colChkInfo, NULL, &sCcInfoInit);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sCcInfoInit);
if (this->type == 0) {
this->actionFunc = BgHidanCurtain_WaitForClear;
} 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)) ||
@@ -149,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;
}
@@ -158,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) {
@@ -196,25 +209,22 @@ void BgHidanCurtain_Update(Actor* thisx, GlobalContext* globalCtx2) {
f32 riseProgress;
if ((globalCtx->cameraPtrs[0]->setting == 0x28) || (globalCtx->cameraPtrs[0]->setting == 0x38)) {
this->collider.base.atFlags &= ~2;
this->collider.base.atFlags &= ~AT_HIT;
} else {
if (this->collider.base.atFlags & 2) {
this->collider.base.atFlags &= ~2;
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 1.0f);
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
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),
@@ -30,34 +30,69 @@ const ActorInit Bg_Hidan_Dalm_InitVars = {
(ActorFunc)BgHidanDalm_Draw,
};
static ColliderTrisItemInit sTrisItemInit[4] = {
static ColliderTrisElementInit sTrisElementInit[4] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK,
OCELEM_NONE,
},
{ { { 305.0f, 0.0f, -300.0f }, { 305.0f, 600.0f, -300.0f }, { 305.0f, 600.0f, 300.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK,
OCELEM_NONE,
},
{ { { 305.0f, 0.0f, -300.0f }, { 305.0f, 600.0f, 300.0f }, { 305.0f, 0.0f, 300.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK,
OCELEM_NONE,
},
{ { { -305.0f, 0.0f, -300.0f }, { -305.0f, 600.0f, 300.0f }, { -305.0f, 600.0f, -300.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK,
OCELEM_NONE,
},
{ { { -305.0f, 0.0f, -300.0f }, { -305.0f, 0.0f, 300.0f }, { -305.0f, 600.0f, 300.0f } } },
},
};
static ColliderTrisInit sTrisInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_TRIS,
},
4,
sTrisItemInit,
sTrisElementInit,
};
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, 65336, ICHAIN_STOP),
ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_STOP),
};
extern Gfx D_0600BBF0[];
@@ -95,16 +130,17 @@ void BgHidanDalm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if ((this->collider.base.acFlags & 2) && !Player_InCsMode(globalCtx) &&
if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(globalCtx) &&
(player->swordAnimation == 22 || player->swordAnimation == 23)) {
this->collider.base.acFlags &= ~2;
if (this->collider.list[0].body.bumperFlags & 2 || this->collider.list[1].body.bumperFlags & 2) {
this->dyna.actor.posRot.rot.y -= 0x4000;
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.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;
@@ -133,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);
}
@@ -150,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);
}
/**
@@ -161,19 +197,19 @@ void BgHidanDalm_UpdateCollider(BgHidanDalm* this) {
Vec3f pos1;
Vec3f pos0;
Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[0], &pos0);
Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[1], &pos1);
Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[2], &pos2);
func_800627A0(&this->collider, 0, &pos0, &pos1, &pos2);
Matrix_MultVec3f(&sTrisItemInit[1].dim.vtx[2], &pos1);
func_800627A0(&this->collider, 1, &pos0, &pos2, &pos1);
Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[0], &pos0);
Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[1], &pos1);
Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[2], &pos2);
Collider_SetTrisVertices(&this->collider, 0, &pos0, &pos1, &pos2);
Matrix_MultVec3f(&sTrisElementInit[1].dim.vtx[2], &pos1);
Collider_SetTrisVertices(&this->collider, 1, &pos0, &pos2, &pos1);
Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[0], &pos0);
Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[1], &pos1);
Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[2], &pos2);
func_800627A0(&this->collider, 2, &pos0, &pos1, &pos2);
Matrix_MultVec3f(&sTrisItemInit[3].dim.vtx[1], &pos2);
func_800627A0(&this->collider, 3, &pos0, &pos2, &pos1);
Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[0], &pos0);
Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[1], &pos1);
Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[2], &pos2);
Collider_SetTrisVertices(&this->collider, 2, &pos0, &pos1, &pos2);
Matrix_MultVec3f(&sTrisElementInit[3].dim.vtx[1], &pos2);
Collider_SetTrisVertices(&this->collider, 3, &pos0, &pos2, &pos1);
}
void BgHidanDalm_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -13,7 +13,7 @@ typedef struct BgHidanDalm {
/* 0x0164 */ BgHidanDalmActionFunc actionFunc;
/* 0x0168 */ u8 switchFlag;
/* 0x016C */ ColliderTris collider;
/* 0x018C */ ColliderTrisItem colliderItems[4];
/* 0x018C */ ColliderTrisElement colliderItems[4];
} BgHidanDalm; // size = 0x02FC
extern const ActorInit Bg_Hidan_Dalm_InitVars;
@@ -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),
@@ -37,17 +37,26 @@ const ActorInit Bg_Hidan_Firewall_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 30, 83, 0, { 0 } },
};
static CollisionCheckInfoInit sColChkInfoInit = {
0x01,
0x0050,
0x0064,
0xFF,
};
static CollisionCheckInfoInit sColChkInfoInit = { 1, 80, 100, MASS_IMMOVABLE };
static UNK_PTR D_80886D04[] = {
0x06015D20, 0x06016120, 0x06016520, 0x06016920, 0x06016D20, 0x06017120, 0x06017520, 0x06017920,
@@ -65,9 +74,9 @@ 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;
func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
this->actionFunc = BgHidanFirewall_Wait;
}
@@ -83,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;
@@ -142,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 {
@@ -166,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) {
@@ -176,16 +185,16 @@ void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_150 = (this->unk_150 + 1) % 8;
if (this->collider.base.atFlags & 2) {
this->collider.base.atFlags &= ~2;
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
BgHidanFirewall_Collide(this, globalCtx);
}
this->actionFunc(this, globalCtx);
if (this->actionFunc == BgHidanFirewall_Erupt) {
BgHidanFirewall_ColliderFollowPlayer(this, globalCtx);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
func_8002F974(&this->actor, NA_SE_EV_FIRE_PLATE - SFX_FLAG);
}
}
@@ -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),
@@ -41,8 +41,22 @@ const ActorInit Bg_Hidan_Fwbig_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 30, 130, 0, { 0, 0, 0 } },
};
@@ -58,18 +72,18 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = 0xFF;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
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;
@@ -80,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;
@@ -97,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) {
@@ -116,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;
@@ -127,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;
@@ -139,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;
@@ -160,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);
}
@@ -168,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 {
@@ -184,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);
@@ -194,20 +206,20 @@ 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) {
s32 pad;
BgHidanFwbig* this = THIS;
if (this->collider.base.atFlags & 2) {
this->collider.base.atFlags &= ~2;
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.posRot.rot.y, 1.0f);
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f);
if (this->direction != 0) {
this->actionFunc = BgHidanFwbig_Lower;
}
@@ -219,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);
@@ -244,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);
@@ -30,26 +30,47 @@ static f32 sYPosOffsets[] = {
-20.0f, -120.0f, -220.0f, -320.0f, -420.0f,
};
static ColliderTrisItemInit sTrisItemsInit[2] = {
static ColliderTrisElementInit sTrisElementsInit[2] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { -20.0f, 3.0f, -20.0f }, { -20.0f, 3.0f, 20.0f }, { 20.0f, 3.0f, 20.0f } } },
},
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ { { 20.0f, 3.0f, 20.0f }, { 20.0f, 3.0f, -20.0f }, { -20.0f, 3.0f, -20.0f } } },
},
};
static ColliderTrisInit sTrisInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS },
ARRAY_COUNT(sTrisItemsInit),
sTrisItemsInit,
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_TRIS,
},
2,
sTrisElementsInit,
};
const ActorInit Bg_Hidan_Hamstep_InitVars = {
ACTOR_BG_HIDAN_HAMSTEP,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_HIDAN_OBJECTS,
sizeof(BgHidanHamstep),
@@ -88,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, 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);
&globalCtx2->actorCtx, &step->dyna.actor, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z,
this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, params);
if (step == NULL) {
return 0;
@@ -119,7 +140,7 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 i2;
BgHidanHamstep* step;
DynaPolyActor_Init(&this->dyna.actor, DPM_PLAYER);
DynaPolyActor_Init(&this->dyna, DPM_PLAYER);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
if ((this->dyna.actor.params & 0xFF) == 0) {
@@ -128,11 +149,11 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i < 2; i++) {
for (i2 = 0; i2 < 3; i2++) {
sp48[i2].x = sTrisInit.list[i].dim.vtx[i2].x + this->dyna.actor.initPosRot.pos.x;
sp48[i2].y = sTrisInit.list[i].dim.vtx[i2].y + this->dyna.actor.initPosRot.pos.y;
sp48[i2].z = sTrisInit.list[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;
}
func_800627A0(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]);
Collider_SetTrisVertices(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]);
}
}
@@ -146,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) {
@@ -174,7 +195,7 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) {
while (step != NULL) {
Actor_Kill(&step->dyna.actor);
step = step->dyna.actor.child;
step = (BgHidanHamstep*)step->dyna.actor.child;
}
}
}
@@ -191,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;
@@ -203,23 +224,23 @@ 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);
}
}
void func_80888638(BgHidanHamstep* this, GlobalContext* globalCtx) {
BgHidanHamstep* child = this->dyna.actor.child;
BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child;
while (child != NULL) {
if ((child->dyna.actor.params & 0xFF) != 0) {
func_808884C8(child, globalCtx);
}
child = child->dyna.actor.child;
child = (BgHidanHamstep*)child->dyna.actor.child;
}
}
@@ -227,34 +248,34 @@ 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 = this->dyna.actor.child;
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 = child->dyna.actor.child;
child = (BgHidanHamstep*)child->dyna.actor.child;
}
}
void func_80888734(BgHidanHamstep* this) {
BgHidanHamstep* parent = this->dyna.actor.parent;
BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent;
f32 factor = SREG(30) * 0.5f;
if (parent != NULL) {
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);
@@ -262,14 +283,14 @@ void func_80888734(BgHidanHamstep* this) {
}
void func_808887C4(BgHidanHamstep* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 2) {
if (this->collider.base.acFlags & AC_HIT) {
func_800800F8(globalCtx, 3310, 100, &this->dyna.actor, 0);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH);
this->collider.base.acFlags = 0;
this->collider.base.acFlags = AC_NONE;
BgHidanHamstep_SetupAction(this, 1);
Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0xFF);
} else {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -280,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;
@@ -299,8 +319,8 @@ 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_80888638(&this->dyna.actor, globalCtx);
func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150);
func_80888638(this, globalCtx);
osSyncPrintf("A(%d)\n", this->dyna.actor.params);
}
}
@@ -309,14 +329,14 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) {
void func_808889B8(BgHidanHamstep* this, GlobalContext* globalCtx) {
s32 pad;
BgHidanHamstep* parent = this->dyna.actor.parent;
BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent;
func_80888734(this);
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);
@@ -338,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;
@@ -11,7 +11,7 @@ typedef void (*BgHidanHamstepActionFunc)(struct BgHidanHamstep*, GlobalContext*)
typedef struct BgHidanHamstep {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderTris collider;
/* 0x0184 */ ColliderTrisItem colliderItems[2];
/* 0x0184 */ ColliderTrisElement colliderItems[2];
/* 0x023C */ BgHidanHamstepActionFunc actionFunc;
/* 0x0240 */ s32 action;
/* 0x0244 */ s32 unk_244;
@@ -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),
@@ -29,6 +29,44 @@ const ActorInit Bg_Hidan_Hrock_InitVars = {
(ActorFunc)BgHidanHrock_Update,
(ActorFunc)BgHidanHrock_Draw,
};
static ColliderTrisElementInit D_80889820[2] = {
{
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK,
OCELEM_NONE,
},
{ { { -40.0f, 3.0f, -40.0f }, { -40.0f, 3.0f, 40.0f }, { 40.0f, 3.0f, 40.0f } } },
},
{
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x40000040, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK,
OCELEM_NONE,
},
{ { { 40.0f, 3.0f, 40.0f }, { 40.0f, 3.0f, -40.0f }, { -40.0f, 3.0f, -40.0f } } },
},
};
static ColliderTrisInit D_80889898 = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_TRIS,
},
2,
D_80889820,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s")
@@ -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),
@@ -38,15 +38,31 @@ const ActorInit Bg_Hidan_Kowarerukabe_InitVars = {
static Gfx* sBreakableWallDLists[] = { 0x0600B9C0, 0x0600C038, 0x0600B900 };
static ColliderJntSphItemInit sJntSphItemsInit[1] = { {
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{ 0, { { 0, 0, 0 }, 100 }, 100 },
} };
static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000008, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 0, { { 0, 0, 0 }, 100 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH },
ARRAY_COUNT(sJntSphItemsInit),
sJntSphItemsInit,
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_JNTSPH,
},
1,
sJntSphElementsInit,
};
void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, GlobalContext* globalCtx) {
@@ -72,15 +88,14 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, GlobalCon
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
this->collider.list[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF];
this->collider.list[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF];
this->collider.elements[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF];
this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF];
}
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[] = {
@@ -128,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);
}
@@ -153,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);
@@ -174,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);
}
}
}
@@ -194,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();
@@ -215,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);
}
}
}
@@ -235,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();
@@ -256,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);
}
}
@@ -287,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);
@@ -311,7 +326,7 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, GlobalContext* globalCtx) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[this->dyna.actor.params & 0xFF]);
func_800628A4(0, &this->collider);
Collider_UpdateSpheres(0, &this->collider);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 573);
}
@@ -9,7 +9,7 @@ struct BgHidanKowarerukabe;
typedef struct BgHidanKowarerukabe {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ ColliderJntSph collider;
/* 0x0184 */ ColliderJntSphItem colliderItems[1];
/* 0x0184 */ ColliderJntSphElement colliderItems[1];
} BgHidanKowarerukabe; // size = 0x01C4
extern const ActorInit Bg_Hidan_Kowarerukabe_InitVars;
@@ -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),
@@ -27,6 +27,26 @@ const ActorInit Bg_Hidan_Rock_InitVars = {
(ActorFunc)BgHidanRock_Update,
(ActorFunc)BgHidanRock_Draw,
};
static ColliderCylinderInit D_8088BF8C = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 45, 77, -40, { 3310, 120, 0 } },
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Init.s")
@@ -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),
@@ -21,37 +21,86 @@ const ActorInit Bg_Hidan_Rsekizou_InitVars = {
(ActorFunc)BgHidanRsekizou_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[6] = {
static ColliderJntSphElementInit sJntSphElementsInit[6] = {
{
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { 0, 30, 40 }, 25 }, 100 },
},
{
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { -35, 32, 77 }, 32 }, 100 },
},
{
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { -80, 35, 130 }, 42 }, 100 },
},
{
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { 0, 30, -40 }, 25 }, 100 },
},
{
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { 35, 32, -77 }, 32 }, 100 },
},
{
{ 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { 80, 35, -130 }, 42 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
6,
sJntSphItemsInit,
sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
@@ -81,7 +130,7 @@ void BgHidanRsekizou_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems);
for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) {
this->collider.list[i].dim.worldSphere.radius = this->collider.list[i].dim.modelSphere.radius;
this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius;
}
this->burnFrame = 0;
this->bendFrame = 0;
@@ -97,7 +146,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) {
BgHidanRsekizou* this = THIS;
s32 i;
ColliderJntSphItem* sphere;
ColliderJntSphElement* sphere;
s32 pad;
f32 yawSine;
f32 yawCosine;
@@ -117,14 +166,12 @@ void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) {
yawCosine = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) {
sphere = &this->collider.list[i];
sphere->dim.worldSphere.center.x = this->dyna.actor.initPosRot.pos.x +
yawCosine * sphere->dim.modelSphere.center.x +
sphere = &this->collider.elements[i];
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);
@@ -159,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),
@@ -11,7 +11,7 @@ typedef struct BgHidanRsekizou {
/* 0x0164 */ s16 bendFrame;
/* 0x0166 */ s16 burnFrame;
/* 0x0168 */ ColliderJntSph collider;
/* 0x0188 */ ColliderJntSphItem colliderItems[6];
/* 0x0188 */ ColliderJntSphElement colliderItems[6];
} BgHidanRsekizou; // size = 0x0308
extern const ActorInit Bg_Hidan_Rsekizou_InitVars;
@@ -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),
@@ -26,6 +26,88 @@ const ActorInit Bg_Hidan_Sekizou_InitVars = {
(ActorFunc)BgHidanSekizou_Update,
(ActorFunc)BgHidanSekizou_Draw,
};
static ColliderJntSphElementInit D_8088E180[6] = {
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 1, { { 0, 30, 40 }, 23 }, 100 },
},
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 1, { { 0, 32, 87 }, 30 }, 100 },
},
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 1, { { 0, 35, 150 }, 40 }, 100 },
},
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 1, { { 0, 30, 40 }, 23 }, 100 },
},
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 1, { { 0, 32, 87 }, 30 }, 100 },
},
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 1, { { 0, 35, 150 }, 40 }, 100 },
},
};
static ColliderJntSphInit D_8088E258 = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
6,
D_8088E180,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/func_8088CEC0.s")
@@ -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),
@@ -27,6 +27,44 @@ const ActorInit Bg_Hidan_Sima_InitVars = {
(ActorFunc)BgHidanSima_Update,
(ActorFunc)BgHidanSima_Draw,
};
static ColliderJntSphElementInit D_8088F1A0[2] = {
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { 0, 40, 100 }, 22 }, 100 },
},
{
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x01, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 1, { { 0, 40, 145 }, 30 }, 100 },
},
};
static ColliderJntSphInit D_8088F1E8 = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
2,
D_8088F1A0,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sima/BgHidanSima_Init.s")
@@ -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),
@@ -27,6 +27,46 @@ const ActorInit Bg_Ice_Shelter_InitVars = {
(ActorFunc)BgIceShelter_Update,
(ActorFunc)BgIceShelter_Draw,
};
static ColliderCylinderInit D_8089170C = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_OTHER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_ON,
},
{ 0, 0, 0, { 0, 0, 0 } },
};
static ColliderCylinderInit D_80891738 = {
{
COLTYPE_HARD,
AT_NONE,
AC_ON | AC_HARD | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x4FC1FFF6, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 0, 0, 0, { 0, 0, 0 } },
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s")
@@ -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);
}
@@ -22,8 +22,22 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx);
void BgIceTurara_Regrow(BgIceTurara* this, GlobalContext* globalCtx);
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x4FC007CA, 0x00, 0x00 }, 0x01, 0x01, 0x00 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x00, 0x04 },
{ 0x4FC007CA, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_NONE,
},
{ 13, 120, 0, { 0, 0, 0 } },
};
@@ -32,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),
@@ -59,13 +73,13 @@ void BgIceTurara_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader_GetVirtual(&D_06002594, &colHeader);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.actor.params == TURARA_STALAGMITE) {
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;
}
}
@@ -86,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);
@@ -104,7 +118,7 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) {
}
void BgIceTurara_Stalagmite(BgIceTurara* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 2) {
if (this->collider.base.acFlags & AC_HIT) {
BgIceTurara_Break(this, globalCtx, 50.0f);
Actor_Kill(&this->dyna.actor);
return;
@@ -113,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;
}
@@ -131,32 +145,32 @@ 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;
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
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);
this->actionFunc = BgIceTurara_Fall;
} 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;
}
}
void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) {
if ((this->collider.base.atFlags & 2) || (this->dyna.actor.bgCheckFlags & 1)) {
this->collider.base.atFlags &= ~2;
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 {
@@ -165,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;
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
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),
@@ -39,8 +39,22 @@ const ActorInit Bg_Jya_1flift_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{
COLTYPE_NONE,
AT_NONE,
AC_NONE,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_NONE,
BUMP_NONE,
OCELEM_ON,
},
{ 70, 80, -82, { 0, 0, 0 } },
};
@@ -77,7 +91,7 @@ void BgJya1flift_InitCollision(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
this->dyna.actor.colChkInfo.mass = 0xFF;
this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
}
void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -114,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) {
@@ -125,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) {
@@ -146,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 {
@@ -186,8 +200,8 @@ void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
this->isLinkRiding = tempIsRiding;
Collider_CylinderUpdate(thisx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
Collider_UpdateCylinder(thisx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
} else {
Actor_Kill(thisx);
}
@@ -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 {
@@ -10,13 +10,6 @@
#define THIS ((BgJyaBigmirror*)thisx)
#define BIGMIR_PUZZLE_COBRA1_SOLVED 1 << 0
#define BIGMIR_PUZZLE_COBRA2_SOLVED 1 << 1
#define BIGMIR_PUZZLE_BOMBIWA_DESTROYED 1 << 2
#define BIGMIR_PUZZLE_IN_STATUE_ROOM 1 << 3
#define BIGMIR_PUZZLE_IN_1ST_TOP_ROOM 1 << 4
#define BIGMIR_PUZZLE_IN_2ND_TOP_ROOM 1 << 5
void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx);
void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgJyaBigmirror_Update(Actor* thisx, GlobalContext* globalCtx);
@@ -26,7 +19,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),
@@ -81,7 +74,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) {
curCobraInfo = &this->cobraInfo[i];
if (curCobraInfo->cobra != NULL) {
curCobraInfo->rotY = curCobraInfo->cobra->actor.shape.rot.y;
curCobraInfo->rotY = curCobraInfo->cobra->dyna.actor.shape.rot.y;
if (curCobraInfo->rotY == curSpawnData->solvedRotY) {
this->puzzleFlags |= cobraPuzzleFlags[i];
@@ -89,7 +82,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) {
this->puzzleFlags &= ~cobraPuzzleFlags[i];
}
if (curCobraInfo->cobra->actor.update == NULL) {
if (curCobraInfo->cobra->dyna.actor.update == NULL) {
// Cobra deleted
osSyncPrintf("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203);
}
@@ -99,7 +92,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) {
curSpawnData->pos.y, curSpawnData->pos.z, 0, curCobraInfo->rotY, 0, curSpawnData->params);
this->actor.child = NULL;
if (&curCobraInfo->cobra->actor == NULL) {
if (&curCobraInfo->cobra->dyna.actor == NULL) {
// Cobra generation failed
osSyncPrintf("Error : コブラ発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 221);
}
@@ -110,11 +103,11 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) {
for (i = 0; i < 2; i++) {
curCobraInfo = &this->cobraInfo[i];
if (curCobraInfo->cobra != NULL) {
if (curCobraInfo->cobra->actor.child != NULL) {
Actor_Kill(curCobraInfo->cobra->actor.child);
curCobraInfo->cobra->actor.child = NULL;
if (curCobraInfo->cobra->dyna.actor.child != NULL) {
Actor_Kill(curCobraInfo->cobra->dyna.actor.child);
curCobraInfo->cobra->dyna.actor.child = NULL;
}
Actor_Kill(&curCobraInfo->cobra->actor);
Actor_Kill(&curCobraInfo->cobra->dyna.actor);
curCobraInfo->cobra = NULL;
}
}
@@ -229,11 +222,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 +237,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);
@@ -5,6 +5,13 @@
#include "global.h"
#include "overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h"
#define BIGMIR_PUZZLE_COBRA1_SOLVED (1 << 0)
#define BIGMIR_PUZZLE_COBRA2_SOLVED (1 << 1)
#define BIGMIR_PUZZLE_BOMBIWA_DESTROYED (1 << 2)
#define BIGMIR_PUZZLE_IN_STATUE_ROOM (1 << 3)
#define BIGMIR_PUZZLE_IN_1ST_TOP_ROOM (1 << 4)
#define BIGMIR_PUZZLE_IN_2ND_TOP_ROOM (1 << 5)
struct BgJyaBigmirror;
typedef struct {
@@ -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),
@@ -28,21 +28,35 @@ const ActorInit Bg_Jya_Bombchuiwa_InitVars = {
(ActorFunc)BgJyaBombchuiwa_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[1] = {
static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000008, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_ON,
},
{ 0, { { -300, 0, 0 }, 40 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x21, 0x20, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_2,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
1,
sJntSphItemsInit,
sJntSphElementsInit,
};
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),
@@ -77,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) {
@@ -97,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;
@@ -125,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) {
@@ -135,7 +149,7 @@ void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, GlobalContext*
}
void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* globalCtx) {
if ((this->collider.base.acFlags & 2) || (this->timer > 0)) {
if ((this->collider.base.acFlags & AC_HIT) || (this->timer > 0)) {
if (this->timer == 0) {
func_800800F8(globalCtx, 3410, -99, &this->actor, 0);
}
@@ -143,11 +157,11 @@ 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);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -162,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);
@@ -173,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);
@@ -220,7 +234,7 @@ void BgJyaBombchuiwa_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (this->drawFlags & 1) {
Gfx_DrawDListOpa(globalCtx, &D_0600E8D0);
func_800628A4(0, &this->collider);
Collider_UpdateSpheres(0, &this->collider);
}
if (this->drawFlags & 2) {
@@ -12,7 +12,7 @@ typedef struct BgJyaBombchuiwa {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgJyaBombchuiwaActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
/* 0x0170 */ ColliderJntSphItem colliderItems;
/* 0x0170 */ ColliderJntSphElement colliderItems;
/* 0x01B0 */ f32 lightRayIntensity;
/* 0x01B4 */ s16 timer;
/* 0x01B6 */ u8 drawFlags; // Used to determine how the actor is drawn.
@@ -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),
@@ -23,16 +23,30 @@ const ActorInit Bg_Jya_Bombiwa_InitVars = {
(ActorFunc)BgJyaBombiwa_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[] = {
static ColliderJntSphElementInit sJntSphElementsInit[] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00000008, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 0, { { 0, 0, 0 }, 50 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_JNTSPH,
},
1,
&sJntSphItemsInit,
&sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
@@ -106,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;
@@ -134,22 +148,22 @@ 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);
}
void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
BgJyaBombiwa* this = THIS;
if (this->collider.base.acFlags & 2) {
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);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -157,5 +171,5 @@ void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaBombiwa* this = THIS;
Gfx_DrawDListOpa(globalCtx, D_0600E490);
func_800628A4(0, &this->collider);
Collider_UpdateSpheres(0, &this->collider);
}
@@ -11,7 +11,7 @@ typedef struct BgJyaBombiwa {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ s32 unk_164;
/* 0x0168 */ ColliderJntSph collider;
/* 0x0188 */ ColliderJntSphItem colliderItems;
/* 0x0188 */ ColliderJntSphElement colliderItems;
} BgJyaBombiwa; // size = 0x01C8
extern const ActorInit Bg_Jya_Bombiwa_InitVars;
@@ -1,4 +1,7 @@
#include "z_bg_jya_cobra.h"
#include "overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h"
#include "overlays/actors/ovl_Mir_Ray/z_mir_ray.h"
#include "vt.h"
#define FLAGS 0x00000010
@@ -9,15 +12,38 @@ void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx);
void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx);
extern UNK_TYPE D_06010790;
extern UNK_TYPE D_06010C20;
extern UNK_TYPE D_0601167C;
extern UNK_TYPE D_060117D0;
void func_80896918(BgJyaCobra* this, GlobalContext* globalCtx);
void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx);
void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx);
void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx);
extern Gfx D_06010790[];
extern Gfx D_06010C20[];
extern UNK_TYPE D_0601167C;
extern Gfx D_060117D0[];
Vtx D_80897270[] = {
VTX(-800, 0, -800, 0, 2048, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(800, 0, -800, 2048, 2048, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(800, 0, 800, 2048, 0, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(-800, 0, 800, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF),
};
Gfx D_808972B0[] = {
gsDPPipeSync(),
gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetRenderMode(AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_DEC | FORCE_BL |
GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1),
G_RM_AA_ZB_XLU_DECAL2),
gsSPClearGeometryMode(G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPVertex(D_80897270, 4, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSPEndDisplayList(),
};
/*
const ActorInit Bg_Jya_Cobra_InitVars = {
ACTOR_BG_JYA_COBRA,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_JYA_OBJ,
sizeof(BgJyaCobra),
@@ -26,41 +52,637 @@ const ActorInit Bg_Jya_Cobra_InitVars = {
(ActorFunc)BgJyaCobra_Update,
(ActorFunc)BgJyaCobra_Draw,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808958F0.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_8089593C.s")
s16 D_80897308[] = { 0, 0, 0, 0 };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808959C4.s")
u8 D_80897310[] = { 1, 0, 1, 0 };
s16 D_80897314[] = { -0x4000, 0000, 0x4000, 0000 };
u8 D_8089731C[11][11] = {
{ 0x00, 0x00, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x00, 0x00 },
{ 0x00, 0x20, 0x80, 0xA0, 0xA3, 0xA3, 0xA3, 0xA0, 0x80, 0x20, 0x00 },
{ 0x20, 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80, 0x20 },
{ 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80 },
{ 0x80, 0xA3, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA3, 0x80 },
{ 0x80, 0xA3, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA3, 0x80 },
{ 0x80, 0xA3, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA3, 0x80 },
{ 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80 },
{ 0x20, 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80, 0x20 },
{ 0x00, 0x20, 0x80, 0xA0, 0xA3, 0xA3, 0xA3, 0xA0, 0x80, 0x20, 0x00 },
{ 0x00, 0x00, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x00, 0x00 },
};
u8 D_80897398[3][3] = {
{ 0x20, 0x80, 0x20 },
{ 0x80, 0xA0, 0x80 },
{ 0x20, 0x80, 0x20 },
};
Vec3f D_808973A4[] = {
{ -6.0f, 100.0f, 7.6f },
{ -12.6f, 69.200005f, -10.0f },
{ -9.0f, 43.0f, -1.0f },
{ -3.0f, 15.0f, 8.6f },
{ -8.6f, 15.0f, 13.5f },
{ -6.6f, 26.0f, 11.6f },
{ -12.5f, 43.0f, 8.0f },
{ -17.2f, 70.0f, 0.6f },
{ -8.0f, 100.0f, 7.6f },
{ 6.0f, 100.0f, 7.6f },
{ 12.6f, 69.200005f, -10.0f },
{ 9.0f, 43.0f, -1.0f },
{ 3.0f, 15.0f, 8.6f },
{ 8.6f, 15.0f, 13.5f },
{ 6.6f, 26.0f, 11.6f },
{ 12.5f, 43.0f, 8.0f },
{ 17.2f, 70.0f, 0.6f },
{ 8.0f, 100.0f, 7.6f },
{ 0.0f, 70.0f, -11.3f },
{ 0.0f, 44.6000023f, -2.0f },
{ 0.0f, 15.0f, 10.6f },
{ 0.0f, 15.0f, 0.3f },
{ 0.0f, 26.0f, 11.6f },
{ 0.0f, 88.4f, -1.4f },
{ 0.0f, 95.700005f, 14.900001f },
{ 0.0f, 101.4f, 5.0f },
};
Vec3f D_808974DC[] = {
{ 12.0f, 21.3000011f, -2.5f }, { 30.0f, 21.3000011f, -2.5f }, { -15.0f, 21.3000011f, -2.5f },
{ -30.0f, 21.3000011f, -2.5f }, { 12.0f, 21.3000011f, -2.5f },
};
s32 D_80897518[] = { 0x80, 0xA0, 0xA0, 0x80 };
InitChainEntry D_80897528[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
Vec3s D_80897538 = { 0, -0x4000, 0 };
Vec3s D_80897540 = { 0, 0x4000, 0 };
Vec3f D_80897548[] = {
{ 0.1f, 0.1f, 0.1f },
{ 0.072f, 0.072f, 0.072f },
{ 0.1f, 0.1f, 0.132f },
};
void func_808958F0(Vec3f* dest, Vec3f* src, f32 arg2, f32 arg3) {
dest->x = (src->z * arg2) + (src->x * arg3);
dest->y = src->y;
dest->z = (src->z * arg3) - (src->x * arg2);
}
void BgJyaCobra_InitDynapoly(BgJyaCobra* this, GlobalContext* globalCtx, void* arg2, DynaPolyMoveFlag flags) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2;
DynaPolyActor_Init(&this->dyna, flags);
CollisionHeader_GetVirtual(arg2, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
// Warning : move BG Registration Failure
osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_cobra.c", 247,
this->dyna.actor.id, this->dyna.actor.params);
}
}
void BgJyaCobra_SpawnRay(BgJyaCobra* this, GlobalContext* globalCtx) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_MIR_RAY, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6);
if (this->dyna.actor.child == NULL) {
osSyncPrintf(VT_FGCOL(RED));
// Error : Mir Ray occurrence failure
osSyncPrintf("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_cobra.c", 270);
osSyncPrintf(VT_RST);
}
}
#ifdef NON_MATCHING
// minor register and stack diffs
void func_80895A70(BgJyaCobra* this) {
s32 pad;
BgJyaBigmirror* temp_v1;
MirRay* phi_v0;
Vec3f sp28;
MirRay* temp;
temp_v1 = (BgJyaBigmirror*)this->dyna.actor.parent;
switch (this->dyna.actor.params & 3) {
case 0:
temp = (MirRay*)this->dyna.actor.child;
if (this->dyna.actor.child != NULL) {
phi_v0 = temp;
if (phi_v0->actor.update == NULL) {
this->dyna.actor.child = NULL;
return;
}
} else {
return;
}
break;
case 1:
phi_v0 = temp_v1->lightBeams[1];
if (phi_v0 == NULL) {
return;
}
break;
case 2:
phi_v0 = temp_v1->lightBeams[2];
if (phi_v0 == NULL) {
return;
}
break;
}
if (this->unk_18C <= 0.0f) {
phi_v0->unLit = 1;
return;
}
phi_v0->unLit = 0;
Math_Vec3f_Copy(&phi_v0->sourcePt, &this->unk_180);
Matrix_RotateY(this->dyna.actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_NEW);
Matrix_RotateX(D_80897308[this->dyna.actor.params & 3] * (M_PI / 0x8000), MTXMODE_APPLY);
sp28.x = 0.0f;
sp28.y = 0.0;
sp28.z = this->unk_190 * 2800.0f;
Matrix_MultVec3f(&sp28, &phi_v0->poolPt);
Math_Vec3f_Sum(&phi_v0->sourcePt, &phi_v0->poolPt, &phi_v0->poolPt);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895A70.s")
#endif
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895BEC.s")
void func_80895BEC(BgJyaCobra* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s32 pad;
Vec3f sp2C;
func_808958F0(&sp2C, &this->unk_174, Math_SinS(this->unk_170), Math_CosS(this->unk_170));
player->actor.world.pos.x = this->dyna.actor.world.pos.x + sp2C.x;
player->actor.world.pos.y = this->dyna.actor.world.pos.y + sp2C.y;
player->actor.world.pos.z = this->dyna.actor.world.pos.z + sp2C.z;
}
#ifdef NON_MATCHING
// Small stack diffs
void func_80895C74(BgJyaCobra* this, GlobalContext* globalCtx) {
s16 phi_v0;
s32 params = this->dyna.actor.params;
BgJyaBigmirror* parent = (BgJyaBigmirror*)this->dyna.actor.parent;
f32 phi_f0;
if ((params & 3) == 2 && parent != NULL &&
(!(parent->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) ||
!(parent->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) {
Math_StepToF(&this->unk_18C, 0.0f, 0.05f);
} else {
this->unk_18C = 1.0f;
if (D_80897310[(params & 3)] != 0) {
phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[(params & 3)];
phi_v0 = ABS(phi_v0);
if (phi_v0 < 0x2000 && phi_v0 != -0x8000) {
this->unk_18C += ((phi_v0 - 0x2000) * 0.00018310547f);
if (this->unk_18C < 0.0f) {
this->unk_18C = 0.0f;
}
}
}
}
this->unk_180.x = this->dyna.actor.world.pos.x;
this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f;
this->unk_180.z = this->dyna.actor.world.pos.z;
if (!(params & 3)) {
this->unk_190 = 0.1f;
} else if ((params & 3) == 1) {
phi_f0 = 0.1f;
phi_v0 = this->dyna.actor.shape.rot.y - 0x8000;
if (phi_v0 < 0x500 && phi_v0 > -0x500) {
phi_f0 = 0.34f;
} else {
phi_v0 = this->dyna.actor.shape.rot.y - 0x4000;
if (phi_v0 < 0x500 && phi_v0 > -0x500 && parent != NULL &&
(parent->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED)) {
phi_f0 = 0.34f;
}
}
Math_StepToF(&this->unk_190, phi_f0, 0.04f);
} else if ((params & 3) == 2) {
phi_f0 = 0.1f;
phi_v0 = this->dyna.actor.shape.rot.y - 0x8000;
if (phi_v0 < 0x500 && phi_v0 > -0x500) {
phi_f0 = 0.34f;
} else {
phi_v0 = this->dyna.actor.shape.rot.y + 0xFFFF4000;
if (phi_v0 < 0x500 && phi_v0 > -0x500) {
phi_f0 = 0.34f;
}
}
Math_StepToF(&this->unk_190, phi_f0, 0.04f);
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895C74.s")
#endif
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895EF0.s")
#ifdef NON_MATCHING
// Repeatedly calculates temp_z * 0x40 for temp_s2[temp_z] rather than calculating it once when temp_z is assigned.
// Making temp_z volatile or accessing through a pointer variable in if (!(temp_z & ~0x3F)) fix the above issue but are
// obviously wrong.
/*
* Updates the shadow with light coming from the side of the mirror
*/
void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) {
Vec3f spD4;
Vec3f spC8;
Vec3f spBC;
u8(*temp_s2)[0x40];
s32 temp_x;
s32 temp_z;
s32 x;
s32 z;
s32 i;
s32 j;
s32 k;
s32 l;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896518.s")
temp_s2 = (u8(*)[0x40])ALIGN16((s32)(&this->shadowTexture));
Lib_MemSet((u8*)temp_s2, 0x1000, 0);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Init.s")
Matrix_RotateX((M_PI / 4), MTXMODE_NEW);
Matrix_RotateY((!(this->dyna.actor.params & 3) ? (s16)(this->dyna.actor.shape.rot.y + 0x4000)
: (s16)(this->dyna.actor.shape.rot.y - 0x4000)) *
(M_PI / 0x8000),
MTXMODE_APPLY);
Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Destroy.s")
for (i = 0; i < 25; i++) {
Math_Vec3f_Diff(&D_808973A4[i + 1], &D_808973A4[i], &spD4);
spD4.x *= 0.5f;
spD4.y *= 0.5f;
spD4.z *= 0.5f;
for (j = 0; j < 2; j++) {
spC8.x = D_808973A4[i].x + (spD4.x * j);
spC8.y = D_808973A4[i].y + (spD4.y * j);
spC8.z = D_808973A4[i].z + (spD4.z * j);
Matrix_MultVec3f(&spC8, &spBC);
x = (s32)(((spBC.x + 50.0f) * 0.64f) + 0.5f);
z = (s32)(((88.0f - spBC.z) * 0.64f) + 0.5f);
for (k = 0; k < 11; k++) {
temp_z = z - 5 + k;
if (!(temp_z & ~0x3F)) {
for (l = 0; l < 11; l++) {
temp_x = (x - 5 + l);
if (!(temp_x & ~0x3F)) {
temp_s2[temp_z][temp_x] |= D_8089731C[k][l];
}
}
}
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896918.s")
for (i = 0; i < 4; i++) {
Math_Vec3f_Diff(&D_808974DC[i + 1], &D_808974DC[i], &spD4);
spD4.x = spD4.x * 0.2f;
spD4.y = spD4.y * 0.2f;
spD4.z = spD4.z * 0.2f;
for (j = 0; j < 5; j++) {
spC8.x = D_808974DC[i].x + (spD4.x * j);
spC8.y = D_808974DC[i].y + (spD4.y * j);
spC8.z = D_808974DC[i].z + (spD4.z * j);
Matrix_MultVec3f(&spC8, &spBC);
x = (s32)(((spBC.x + 50.0f) * 0.64f) + 0.5f);
z = (s32)(((88.0f - spBC.z) * 0.64f) + 0.5f);
for (k = 0; k < 3; k++) {
temp_z = z - 1 + k;
if (!(temp_z & ~0x3F)) {
for (l = 0; l < 3; l++) {
temp_x = x - 1 + l;
if (!(temp_x & ~0x3F)) {
temp_s2[temp_z][temp_x] |= D_80897398[k][l];
}
}
}
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896950.s")
for (i = 0; i < 0x40; i++) {
temp_s2[0][i] = 0;
temp_s2[0x3F][i] = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808969F8.s")
for (j = 1; j < 0x3F; j++) {
temp_s2[j][0] = 0;
temp_s2[j][0x3F] = 0;
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromSide.s")
#endif
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896ABC.s")
#ifdef NON_MATCHING
// minor register and stack diffs
/*
* Updates the shadow with light coming from above the mirror
*/
void BgJyaCobra_UpdateShadowFromTop(BgJyaCobra* this) {
f32 sp58[0x40];
f32 temp_f12;
f32 temp_f2;
u8* temp_s0;
s32 i_copy;
u8* phi_a3;
s32 counter;
s32 i;
s32 j;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Update.s")
for (i = 0; i < 0x40; i++) {
sp58[i] = SQ(i - 31.5f);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896CB4.s")
temp_s0 = (u8*)ALIGN16((s32)(&this->shadowTexture));
phi_a3 = temp_s0;
Lib_MemSet(temp_s0, 0x1000, 0);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896D78.s")
for (i = 0; i != 0x40; i++) {
temp_f12 = sp58[i];
for (j = 0; j < 0x40; j++) {
temp_f2 = (sp58[j] * 0.5f) + temp_f12;
if (temp_f2 < 300.0f) {
*phi_a3 |= CLAMP_MAX(640 - (s32)(temp_f2 * 2.0f), 166);
}
phi_a3++;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896EE4.s")
for (counter = 0, i = 0x780; counter < 4; counter++, i += 0x40) {
i_copy = i;
for (j = 4; j < 0x3C; j++) {
if (temp_s0[i + j] < D_80897518[counter]) {
temp_s0[i + j] = D_80897518[counter];
}
}
temp_s0[i_copy + 0x3C] = 0x20;
temp_s0[i_copy + 0x3] = 0x20;
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromTop.s")
#endif
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Draw.s")
void BgJyaCobra_Init(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
BgJyaCobra_InitDynapoly(this, globalCtx, &D_0601167C, DPM_UNK);
Actor_ProcessInitChain(&this->dyna.actor, D_80897528);
if (!(this->dyna.actor.params & 3) && Flags_GetSwitch(globalCtx, ((s32)this->dyna.actor.params >> 8) & 0x3F)) {
this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0;
}
if (!(this->dyna.actor.params & 3)) {
BgJyaCobra_SpawnRay(this, globalCtx);
}
func_80896918(this, globalCtx);
if ((this->dyna.actor.params & 3) == 1 || (this->dyna.actor.params & 3) == 2) {
this->dyna.actor.room = -1;
}
if ((this->dyna.actor.params & 3) == 1) {
BgJyaCobra_UpdateShadowFromTop(this);
}
// (jya cobra)
osSyncPrintf("(jya コブラ)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n", this->dyna.actor.params, this,
&this->shadowTexture, ALIGN16((s32)(&this->shadowTexture)));
}
void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void func_80896918(BgJyaCobra* this, GlobalContext* globalCtx) {
this->actionFunc = &func_80896950;
this->unk_168 = 0;
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y =
(s16)((this->unk_16C << 0xD) + this->dyna.actor.home.rot.y);
}
void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (this->dyna.unk_150 > 0.001f) {
this->unk_168++;
if (this->unk_168 >= 15) {
func_808969F8(this, globalCtx);
}
} else {
this->unk_168 = 0;
}
if (fabsf(this->dyna.unk_150) > 0.001f) {
this->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~0x10;
}
}
void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx) {
Player* player;
s32 phi_a3;
s16 temp2;
player = PLAYER;
this->actionFunc = func_80896ABC;
temp2 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
phi_a3 = (s16)(this->dyna.actor.shape.rot.y - this->dyna.unk_158);
phi_a3 = ABS(phi_a3);
if (temp2 > 0) {
if (phi_a3 > 0x4000) {
this->unk_16A = 1;
} else {
this->unk_16A = -1;
}
} else {
if (phi_a3 > 0x4000) {
this->unk_16A = -1;
} else {
this->unk_16A = 1;
}
}
this->unk_174.x = player->actor.world.pos.x - this->dyna.actor.world.pos.x;
this->unk_174.y = player->actor.world.pos.y - this->dyna.actor.world.pos.y;
this->unk_174.z = player->actor.world.pos.z - this->dyna.actor.world.pos.z;
this->unk_170 = this->unk_16E = 0;
this->unk_172 = 1;
}
void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) {
s16 temp_v0;
Player* player;
player = PLAYER;
temp_v0 = (s16)((this->unk_16C << 0xD) + this->dyna.actor.home.rot.y) - this->dyna.actor.world.rot.y;
if (ABS(temp_v0) < 7424) {
Math_StepToS(&this->unk_16E, 106, 4);
} else {
Math_StepToS(&this->unk_16E, 21, 10);
}
if (Math_ScaledStepToS(&this->unk_170, (s16)(this->unk_16A << 0xd), this->unk_16E) != 0) {
this->unk_16C = (this->unk_16C + this->unk_16A) & 7;
player->stateFlags2 &= ~0x10;
this->dyna.unk_150 = 0.0f;
func_80896918(this, globalCtx);
} else {
temp_v0 = (this->unk_16C << 0xD) + this->dyna.actor.home.rot.y + this->unk_170;
this->dyna.actor.world.rot.y = temp_v0;
this->dyna.actor.shape.rot.y = temp_v0;
}
if (player->stateFlags2 & 0x10) {
if (this->unk_172 != 0) {
func_80895BEC(this, globalCtx);
}
} else if (fabsf(this->dyna.unk_150) < 0.001f) {
this->unk_172 = 0;
}
this->dyna.unk_150 = 0.0f;
func_8002F974(&this->dyna.actor, 0x200A);
}
void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
s32 params;
this->actionFunc(this, globalCtx);
func_80895C74(this, globalCtx);
func_80895A70(this);
params = this->dyna.actor.params & 3;
if (params == 0 || params == 2) {
BgJyaCobra_UpdateShadowFromSide(this);
}
}
void func_80896CB4(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 864);
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 867),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06010C20);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 872);
}
void func_80896D78(BgJyaCobra* this, GlobalContext* globalCtx) {
s32 pad;
Vec3s sp44;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 924);
func_80093D84(globalCtx->state.gfxCtx);
sp44.x = D_80897308[this->dyna.actor.params & 3] + this->dyna.actor.shape.rot.x;
sp44.y = this->dyna.actor.shape.rot.y;
sp44.z = this->dyna.actor.shape.rot.z;
func_800D1694(this->unk_180.x, this->unk_180.y, this->unk_180.z, &sp44);
Matrix_Scale(0.1f, 0.1f, this->unk_190, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 939),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s32)(this->unk_18C * 140.0f));
gSPDisplayList(POLY_XLU_DISP++, D_060117D0);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 947);
}
void BgJyaCobra_DrawShadow(BgJyaCobra* this, GlobalContext* globalCtx) {
u32 pad;
s16 params;
Vec3f sp64;
Vec3s* phi_a3;
if (1) {}
params = this->dyna.actor.params & 3;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 966);
func_80094044(globalCtx->state.gfxCtx);
if (params == 0) {
sp64.x = this->dyna.actor.world.pos.x - 50.0f;
sp64.y = this->dyna.actor.world.pos.y;
sp64.z = this->dyna.actor.world.pos.z;
phi_a3 = &D_80897538;
} else {
phi_a3 = &this->dyna.actor.shape.rot;
if (params == 2) {
sp64.x = this->dyna.actor.world.pos.x + 70.0f;
sp64.y = this->dyna.actor.world.pos.y;
sp64.z = this->dyna.actor.world.pos.z;
phi_a3 = &D_80897540;
// params == 1
} else {
Math_Vec3f_Copy(&sp64, &this->dyna.actor.world.pos);
}
}
func_800D1694(sp64.x, sp64.y, sp64.z, phi_a3);
Matrix_Scale(D_80897548[params].x, D_80897548[params].y, D_80897548[params].z, MTXMODE_APPLY);
Matrix_Translate(0.0f, 0.0f, 40.0f, MTXMODE_APPLY);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 120);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 994),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPLoadTextureBlock(POLY_XLU_DISP++, ALIGN16((s32)(&this->shadowTexture)), G_IM_FMT_I, G_IM_SIZ_8b, 0x40, 0x40, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPDisplayList(POLY_XLU_DISP++, D_808972B0);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 1006);
}
void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaCobra* this = THIS;
func_80896CB4(globalCtx);
Gfx_DrawDListOpa(globalCtx, D_06010790);
if (this->unk_18C > 0.0f) {
func_80896D78(this, globalCtx);
}
if ((this->dyna.actor.params & 3) == 2) {
BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent;
if (mirror != NULL && (mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) &&
(mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED)) {
BgJyaCobra_DrawShadow(this, globalCtx);
}
} else {
BgJyaCobra_DrawShadow(this, globalCtx);
}
}
@@ -6,9 +6,22 @@
struct BgJyaCobra;
typedef void (*BgJyaCobraActionFunc)(struct BgJyaCobra*, GlobalContext*);
typedef struct BgJyaCobra {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x1058];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgJyaCobraActionFunc actionFunc;
/* 0x0168 */ s16 unk_168;
/* 0x016A */ s16 unk_16A;
/* 0x016C */ s16 unk_16C;
/* 0x016E */ s16 unk_16E;
/* 0x0170 */ s16 unk_170;
/* 0x0172 */ u8 unk_172;
/* 0x0174 */ Vec3f unk_174;
/* 0x0180 */ Vec3f unk_180;
/* 0x018C */ f32 unk_18C;
/* 0x0190 */ f32 unk_190;
/* 0x0194 */ u8 shadowTexture[0x1010];
} BgJyaCobra; // size = 0x11A4
extern const ActorInit Bg_Jya_Cobra_InitVars;
@@ -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),
@@ -37,20 +37,34 @@ const ActorInit Bg_Jya_Goroiwa_InitVars = {
};
extern Gfx D_060006B0[];
static ColliderJntSphItemInit sJntSphItemsInit[] = {
static ColliderJntSphElementInit sJntSphElementsInit[] = {
{
{ 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 },
{
ELEMTYPE_UNK0,
{ 0x20000000, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_ON,
},
{ 0, { { 0, 0, 0 }, 58 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x39, 0x20, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
1,
sJntSphItemsInit,
sJntSphElementsInit,
};
static CollisionCheckInfoInit sColChkInfoInit = { 0x01, 0xF, 0x0, 0xFE };
static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 0, MASS_HEAVY };
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
@@ -60,11 +74,11 @@ static InitChainEntry sInitChain[] = {
};
void func_80897970(BgJyaGoroiwa* this) {
Sphere16* worldSphere = &this->collider.list->dim.worldSphere;
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) {
@@ -73,15 +87,13 @@ void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) {
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItem);
func_80897970(this);
this->collider.list->dim.worldSphere.radius = 0x3A;
this->collider.elements[0].dim.worldSphere.radius = 58;
}
void func_80897A2C(BgJyaGoroiwa* this) {
Actor* thisx = &this->actor;
f32 rotFactor = 175.30046f;
f32 posDiff = thisx->posRot.pos.x - thisx->pos4.x;
f32 posDiff = this->actor.world.pos.x - this->actor.prevPos.x;
thisx->shape.rot.z -= rotFactor * posDiff;
this->actor.shape.rot.z -= 0x10000 / (119 * M_PI) * posDiff;
}
void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -89,12 +101,10 @@ void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
func_808979C0(this, globalCtx);
this->actor.shape.rot.z = 0;
this->actor.shape.rot.y = this->actor.shape.rot.z;
this->actor.shape.rot.x = this->actor.shape.rot.z;
func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
ActorShape_Init(&this->actor.shape, 595.0f, &ActorShadow_DrawFunc_Circle, 9.0f);
this->actor.shape.unk_14 = 0x80;
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_DrawCircle, 9.0f);
this->actor.shape.shadowAlpha = 128;
func_80897B1C(this);
}
@@ -106,7 +116,7 @@ void BgJyaGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80897B1C(BgJyaGoroiwa* this) {
this->actionFunc = func_80897B48;
this->collider.base.atFlags = this->collider.base.atFlags | 1;
this->collider.base.atFlags |= AT_ON;
this->unk_1B4 = 0;
this->unk_1B0 = 1.0f;
}
@@ -115,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 & 2) {
this->collider.base.atFlags &= ~3;
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;
@@ -155,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);
@@ -196,13 +206,13 @@ 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 & 1) {
if (this->collider.base.atFlags & AT_ON) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
@@ -12,7 +12,7 @@ typedef struct BgJyaGoroiwa {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgJyaGoroiwaFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
/* 0x0170 */ ColliderJntSphItem colliderItem;
/* 0x0170 */ ColliderJntSphElement colliderItem;
/* 0x01B0 */ f32 unk_1B0;
/* 0x01B4 */ s16 unk_1B4;
/* 0x01B6 */ s16 unk_1B6;
@@ -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),
@@ -35,17 +35,31 @@ const ActorInit Bg_Jya_Haheniron_InitVars = {
(ActorFunc)BgJyaHaheniron_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[1] = {
static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{ 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 },
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x00, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ 0, { { 0, 0, 0 }, 10 }, 100 },
},
};
static ColliderJntSphInit D_80898764 = {
{ COLTYPE_UNK10, 0x11, 0x01, 0x00, 0x00, COLSHAPE_JNTSPH },
static ColliderJntSphInit sJntSphInit = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_ON,
OC1_NONE,
OC2_NONE,
COLSHAPE_JNTSPH,
},
1,
sJntSphItemsInit,
sJntSphElementsInit,
};
static s16 sKakeraScales[] = { 5, 8, 11, 14, 17 };
@@ -68,7 +82,7 @@ void BgJyaHaheniron_ColliderInit(BgJyaHaheniron* this, GlobalContext* globalCtx)
s32 pad;
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &D_80898764, this->colliderItems);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
}
void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f* vec2) {
@@ -95,7 +109,7 @@ void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f*
}
EffectSsKakera_Spawn(globalCtx, vec1, &vel, vec1, -350, arg5, 40, 4, 0, sKakeraScales[i], 0, 20, 40,
KAKERA_COLOR_NONE, OBJECT_JYA_IRON, &D_06000880);
KAKERA_COLOR_NONE, OBJECT_JYA_IRON, D_06000880);
angle += 0x3333;
}
pos.x = vec1->x + (vec2->x * 5.0f);
@@ -138,18 +152,18 @@ 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);
if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & 2) && (this->collider.base.at != NULL) &&
(this->collider.base.at->type == ACTORTYPE_PLAYER))) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85);
if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) &&
(this->collider.base.at->category == ACTORCAT_PLAYER))) {
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, &vec);
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, &vec);
Actor_Kill(&this->actor);
} else if (this->timer > 60) {
Actor_Kill(&this->actor);
} else {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
this->actor.shape.rot.y += 0x4B0;
this->actor.shape.rot.x += 0xFA0;
@@ -163,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, D_808987A0);
BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987A0);
Actor_Kill(&this->actor);
}
this->actor.shape.rot.y += 0x258;
@@ -176,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, D_808987AC);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot, 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);
}
}
@@ -196,7 +210,7 @@ void BgJyaHaheniron_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaHaheniron* this = THIS;
if (this->actor.params == 0) {
func_800628A4(0, &this->collider);
Collider_UpdateSpheres(0, &this->collider);
}
Gfx_DrawDListOpa(globalCtx, dLists[this->actor.params]);
}
@@ -12,7 +12,7 @@ typedef struct BgJyaHaheniron {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgJyaHahenironActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
/* 0x0170 */ ColliderJntSphItem colliderItems[1];
/* 0x0170 */ ColliderJntSphElement colliderItems[1];
/* 0x01B0 */ s16 timer;
} BgJyaHaheniron; // size = 0x01B4
@@ -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,6 +23,26 @@ const ActorInit Bg_Jya_Ironobj_InitVars = {
(ActorFunc)BgJyaIronobj_Update,
(ActorFunc)BgJyaIronobj_Draw,
};
static ColliderCylinderInit D_808994AC = {
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_ENEMY,
OC1_NONE,
OC2_TYPE_2,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0xFFCFFFFF, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 30, 150, 0, { 0, 0, 0 } },
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s")
@@ -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),
@@ -39,17 +39,31 @@ const ActorInit Bg_Jya_Megami_InitVars = {
(ActorFunc)BgJyaMegami_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[] = {
static ColliderJntSphElementInit sJntSphElementsInit[] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, 0x00, 0x01, 0x00 },
{ 0x00, { { 0x0000, 0xFDA8, 0xFF38 }, 0x003C }, 0x0064 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x00200000, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_NONE,
},
{ 0, { { 0, -600, -200 }, 60 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_JNTSPH,
},
1,
sJntSphItemsInit,
sJntSphElementsInit,
};
static BgJyaMegamiPieceInit sPiecesInit[] = {
@@ -150,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);
}
@@ -166,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);
}
}
@@ -185,9 +199,9 @@ void BgJyaMegami_SetupDetectLight(BgJyaMegami* this) {
}
void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 0x2) {
if (this->collider.base.acFlags & AC_HIT) {
this->lightTimer++;
this->collider.base.acFlags &= ~0x2;
this->collider.base.acFlags &= ~AC_HIT;
if (globalCtx->gameplayFrames % 4 == 0) {
func_8089A41C(this, globalCtx, (this->crumbleIndex * 0.04f) + 0.05f);
}
@@ -198,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) {
@@ -221,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;
@@ -236,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++) {
@@ -266,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) {
@@ -334,7 +348,7 @@ void BgJyaMegami_DrawExplode(BgJyaMegami* this, GlobalContext* globalCtx) {
void BgJyaMegami_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgJyaMegami* this = THIS;
func_800628A4(0, &this->collider);
Collider_UpdateSpheres(0, &this->collider);
if (this->actionFunc == BgJyaMegami_Explode) {
BgJyaMegami_DrawExplode(this, globalCtx);
} else {
@@ -19,7 +19,7 @@ typedef struct BgJyaMegami {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgJyaMegamiActionFunc actionFunc;
/* 0x0168 */ ColliderJntSph collider;
/* 0x0188 */ ColliderJntSphItem colliderItem;
/* 0x0188 */ ColliderJntSphElement colliderItem;
/* 0x01C8 */ s16 lightTimer;
/* 0x01CA */ s16 explosionTimer;
/* 0x01CC */ s16 crumbleIndex;

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