Misc Cleanup 2 (#1260)

* more misc cleanup

* PR suggestions

* more abs alt, csId

* more cleanup, can't help it

* fix incorrect sq

* more fixes
This commit is contained in:
engineer124 2023-06-02 14:39:39 +10:00 committed by GitHub
parent 0261dc0a5c
commit 4b25b4d8e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 636 additions and 423 deletions

View File

@ -66,11 +66,10 @@ s8 PadUtils_GetRelY(Input* input) {
}
void PadUtils_UpdateRelXY(Input* input) {
s32 curX, curY;
s32 relX, relY;
curX = PadUtils_GetCurX(input);
curY = PadUtils_GetCurY(input);
s32 curX = PadUtils_GetCurX(input);
s32 curY = PadUtils_GetCurY(input);
s32 relX;
s32 relY;
if (curX > 7) {
relX = (curX < 0x43) ? curX - 7 : 0x43 - 7;

View File

@ -447,7 +447,7 @@ void osSyncPrintfThreadContext(OSThread* t) {
OSThread* Fault_FindFaultedThread() {
OSThread* iter = __osGetActiveQueue();
while (iter->priority != -1) {
if (iter->priority > 0 && iter->priority < 0x7F && (iter->flags & 3)) {
if ((iter->priority > 0) && (iter->priority < 0x7F) && (iter->flags & 3)) {
return iter;
}
iter = iter->tlnext;

View File

@ -57,7 +57,7 @@ void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 col
s32 xSize = xEnd - xStart + 1;
s32 ySize = yEnd - yStart + 1;
if (xDiff > 0 && yDiff > 0) {
if ((xDiff > 0) && (yDiff > 0)) {
if (xDiff < xSize) {
xSize = xDiff;
}
@ -127,11 +127,11 @@ void FaultDrawer_UpdatePrintColor() {
if (sFaultDrawContext->osSyncPrintfEnabled) {
osSyncPrintf(VT_RST);
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->foreColor);
if (idx >= 0 && idx < 8) {
if ((idx >= 0) && (idx < 8)) {
osSyncPrintf(VT_SGR("3%d"), idx);
}
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->backColor);
if (idx >= 0 && idx < 8) {
if ((idx >= 0) && (idx < 8)) {
osSyncPrintf(VT_SGR("4%d"), idx);
}
}
@ -180,7 +180,7 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
for (; count != 0; count--, str++) {
if (sFaultDrawContext->escCode) {
sFaultDrawContext->escCode = false;
if (*str >= '1' && *str <= '9') {
if ((*str >= '1') && (*str <= '9')) {
FaultDrawer_SetForeColor(sFaultDrawContext->printColors[*str - '0']);
}
} else {
@ -192,9 +192,11 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
sFaultDrawContext->cursorX = sFaultDrawContext->w;
break;
case '\x1A':
sFaultDrawContext->escCode = true;
break;
default:
if (sFaultDrawContext->osSyncPrintfEnabled) {
osSyncPrintf("%c", *str);

View File

@ -396,7 +396,7 @@ void Sched_HandleRetrace(SchedContext* sched) {
if (sched->curBuf->updateRate2 > 0) {
sched->curBuf->updateRate2--;
}
if (sched->curBuf->updateRate2 <= 0 && sched->pendingSwapBuf1 != NULL) {
if ((sched->curBuf->updateRate2 <= 0) && (sched->pendingSwapBuf1 != NULL)) {
Sched_RetraceUpdateFramebuffer(sched, sched->pendingSwapBuf1);
}
}

View File

@ -695,7 +695,7 @@ void func_800B5814(TargetContext* targetCtx, Player* player, Actor* actor, GameS
* Tests if current scene switch flag is set.
*/
s32 Flags_GetSwitch(PlayState* play, s32 flag) {
if (flag >= 0 && flag < 0x80) {
if ((flag >= 0) && (flag < 0x80)) {
return play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F));
}
return 0;
@ -705,7 +705,7 @@ s32 Flags_GetSwitch(PlayState* play, s32 flag) {
* Sets current scene switch flag.
*/
void Flags_SetSwitch(PlayState* play, s32 flag) {
if (flag >= 0 && flag < 0x80) {
if ((flag >= 0) && (flag < 0x80)) {
play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F);
}
}
@ -714,7 +714,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) {
* Unsets current scene switch flag.
*/
void Flags_UnsetSwitch(PlayState* play, s32 flag) {
if (flag >= 0 && flag < 0x80) {
if ((flag >= 0) && (flag < 0x80)) {
play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] &= ~(1 << (flag & 0x1F));
}
}
@ -793,7 +793,7 @@ void Flags_UnsetClearTemp(PlayState* play, s32 roomNumber) {
* Tests if current scene collectible flag is set.
*/
s32 Flags_GetCollectible(PlayState* play, s32 flag) {
if (flag > 0 && flag < 0x80) {
if ((flag > 0) && (flag < 0x80)) {
return play->actorCtx.sceneFlags.collectible[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F));
}
return 0;
@ -803,7 +803,7 @@ s32 Flags_GetCollectible(PlayState* play, s32 flag) {
* Sets current scene collectible flag.
*/
void Flags_SetCollectible(PlayState* play, s32 flag) {
if (flag > 0 && flag < 0x80) {
if ((flag > 0) && (flag < 0x80)) {
play->actorCtx.sceneFlags.collectible[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F);
}
}
@ -3268,12 +3268,12 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
for (i = 0; i < numTransitionActors; transitionActorList++, i++) {
if (transitionActorList->id >= 0) {
if ((transitionActorList->sides[0].room >= 0 &&
(play->roomCtx.curRoom.num == transitionActorList->sides[0].room ||
play->roomCtx.prevRoom.num == transitionActorList->sides[0].room)) ||
(transitionActorList->sides[1].room >= 0 &&
(play->roomCtx.curRoom.num == transitionActorList->sides[1].room ||
play->roomCtx.prevRoom.num == transitionActorList->sides[1].room))) {
if (((transitionActorList->sides[0].room >= 0) &&
((play->roomCtx.curRoom.num == transitionActorList->sides[0].room) ||
(play->roomCtx.prevRoom.num == transitionActorList->sides[0].room))) ||
((transitionActorList->sides[1].room >= 0) &&
((play->roomCtx.curRoom.num == transitionActorList->sides[1].room) ||
(play->roomCtx.prevRoom.num == transitionActorList->sides[1].room)))) {
s16 rotY = DEG_TO_BINANG((transitionActorList->rotY >> 7) & 0x1FF);
if (Actor_SpawnAsChildAndCutscene(actorCtx, play, transitionActorList->id & 0x1FFF,

View File

@ -1920,12 +1920,14 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul
s32 bgId;
f32 temp_f0_2;
f32 f32temp;
f32 nx2, nz2;
f32 nx2;
f32 nz2;
Vec3f checkLineNext;
Vec3f checkLinePrev;
f32 n2XZDist;
f32 n3XZDist;
f32 nx3, nz3;
f32 nx3;
f32 nz3;
s32 bccFlags;
Vec3f posIntersect2;
s32 bgId2;

View File

@ -6777,8 +6777,9 @@ s32 Camera_Special5(Camera* camera) {
spA4 = BINANG_SUB(focalActorPosRot->rot.y, sp6C.yaw);
sp74.r = roData->eyeDist;
rand = Rand_ZeroOne();
sp74.yaw = BINANG_ROT180(focalActorPosRot->rot.y) +
(s16)(spA4 < 0 ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
sp74.yaw =
BINANG_ROT180(focalActorPosRot->rot.y) +
(s16)((spA4 < 0) ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
sp74.pitch = roData->pitch;
OLib_AddVecGeoToVec3f(eyeNext, &spA8.pos, &sp74);
*eye = *eyeNext;

View File

@ -790,7 +790,7 @@ DamageTable sDamageTablePresets[] = {
* is out of range.
*/
DamageTable* DamageTable_Get(s32 index) {
if (index < 0 || index > ARRAY_COUNT(sDamageTablePresets) - 1) {
if ((index < 0) || (index >= ARRAY_COUNT(sDamageTablePresets))) {
return NULL;
}

View File

@ -753,7 +753,7 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
j = 0;
for (i = 0; i < this->numElements - 1; i++) {
for (i = 0; i < this->numElements - 1; i++, j += 4) {
if (this->drawMode == 1) {
alphaRatio = (f32)this->elements[i].timer / (f32)this->elemDuration;
gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, this->altPrimColor.r, this->altPrimColor.g,
@ -761,45 +761,43 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
gDPPipeSync(POLY_XLU_DISP++);
}
if (1) {} // Necessary to match
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
if (this->flags & 4) {
sp1B0.x = ((f32)vtx[4 * i + 0].v.ob[0] + (f32)vtx[4 * i + 1].v.ob[0]) * 0.5f;
sp1B0.y = ((f32)vtx[4 * i + 0].v.ob[1] + (f32)vtx[4 * i + 1].v.ob[1]) * 0.5f;
sp1B0.z = ((f32)vtx[4 * i + 0].v.ob[2] + (f32)vtx[4 * i + 1].v.ob[2]) * 0.5f;
sp1A4.x = ((f32)vtx[4 * i + 2].v.ob[0] + (f32)vtx[4 * i + 3].v.ob[0]) * 0.5f;
sp1A4.y = ((f32)vtx[4 * i + 2].v.ob[1] + (f32)vtx[4 * i + 3].v.ob[1]) * 0.5f;
sp1A4.z = ((f32)vtx[4 * i + 2].v.ob[2] + (f32)vtx[4 * i + 3].v.ob[2]) * 0.5f;
Math_Vec3f_Diff(&sp1A4, &sp1B0, &sp198);
scale = sqrtf(SQXYZ(sp198));
if (fabsf(scale) > 0.0005f) {
scale = 1.0f / scale;
Math_Vec3f_Scale(&sp198, scale);
SkinMatrix_SetTranslate(&sp154, sp1B0.x, sp1B0.y, sp1B0.z);
SkinMatrix_SetRotateAroundVec(&sp114, 0x3FFF, sp198.x, sp198.y, sp198.z);
SkinMatrix_MtxFMtxFMult(&sp154, &sp114, &spD4);
SkinMatrix_SetTranslate(&sp154, -sp1B0.x, -sp1B0.y, -sp1B0.z);
SkinMatrix_MtxFMtxFMult(&spD4, &sp154, &sp94);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94);
if (mtx == NULL) {
break;
}
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
if (!(this->flags & 4)) {
continue;
}
j += 4;
sp1B0.x = ((f32)vtx[4 * i + 0].v.ob[0] + (f32)vtx[4 * i + 1].v.ob[0]) / 2.0f;
sp1B0.y = ((f32)vtx[4 * i + 0].v.ob[1] + (f32)vtx[4 * i + 1].v.ob[1]) / 2.0f;
sp1B0.z = ((f32)vtx[4 * i + 0].v.ob[2] + (f32)vtx[4 * i + 1].v.ob[2]) / 2.0f;
sp1A4.x = ((f32)vtx[4 * i + 2].v.ob[0] + (f32)vtx[4 * i + 3].v.ob[0]) / 2.0f;
sp1A4.y = ((f32)vtx[4 * i + 2].v.ob[1] + (f32)vtx[4 * i + 3].v.ob[1]) / 2.0f;
sp1A4.z = ((f32)vtx[4 * i + 2].v.ob[2] + (f32)vtx[4 * i + 3].v.ob[2]) / 2.0f;
Math_Vec3f_Diff(&sp1A4, &sp1B0, &sp198);
scale = sqrtf(SQXYZ(sp198));
if (fabsf(scale) > 0.0005f) {
scale = 1.0f / scale;
Math_Vec3f_Scale(&sp198, scale);
SkinMatrix_SetTranslate(&sp154, sp1B0.x, sp1B0.y, sp1B0.z);
SkinMatrix_SetRotateAroundVec(&sp114, 0x3FFF, sp198.x, sp198.y, sp198.z);
SkinMatrix_MtxFMtxFMult(&sp154, &sp114, &spD4);
SkinMatrix_SetTranslate(&sp154, -sp1B0.x, -sp1B0.y, -sp1B0.z);
SkinMatrix_MtxFMtxFMult(&spD4, &sp154, &sp94);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94);
if (mtx == NULL) {
break;
}
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
}
}

View File

@ -187,33 +187,31 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
s32 i;
for (i = 0; i < SPARK_COUNT; i++) {
if (1) {} // necessary to match
if (sEffectContext.sparks[i].status.active) {
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
if (!sEffectContext.sparks[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
}
for (i = 0; i < BLURE_COUNT; i++) {
if (1) {
if (gfxCtx) {}
} // necessary to match
if (sEffectContext.blures[i].status.active) {
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
if (!sEffectContext.blures[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
}
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (1) {} // necessary to match
if (sEffectContext.shieldParticles[i].status.active) {
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
if (!sEffectContext.shieldParticles[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
}
if (1) {} // necessary to match
for (i = 0; i < TIRE_MARK_COUNT; i++) {
if (sEffectContext.tireMarks[i].status.active) {
sEffectInfoTable[EFFECT_TIRE_MARK].draw(&sEffectContext.tireMarks[i].effect, gfxCtx);
if (!sEffectContext.tireMarks[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_TIRE_MARK].draw(&sEffectContext.tireMarks[i].effect, gfxCtx);
}
}
@ -221,38 +219,38 @@ void Effect_UpdateAll(PlayState* play) {
s32 i;
for (i = 0; i < SPARK_COUNT; i++) {
if (1) {} // necessary to match
if (sEffectContext.sparks[i].status.active) {
if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
Effect_Destroy(play, i);
}
if (!sEffectContext.sparks[i].status.active) {
continue;
}
if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
Effect_Destroy(play, i);
}
}
for (i = 0; i < BLURE_COUNT; i++) {
if (1) {} // necessary to match
if (sEffectContext.blures[i].status.active) {
if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
Effect_Destroy(play, i + SPARK_COUNT);
}
if (!sEffectContext.blures[i].status.active) {
continue;
}
if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
Effect_Destroy(play, i + SPARK_COUNT);
}
}
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (1) {} // necessary to match
if (sEffectContext.shieldParticles[i].status.active) {
if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT);
}
if (!sEffectContext.shieldParticles[i].status.active) {
continue;
}
if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT);
}
}
for (i = 0; i < TIRE_MARK_COUNT; i++) {
if (1) {} // necessary to match
if (sEffectContext.tireMarks[i].status.active) {
if (sEffectInfoTable[EFFECT_TIRE_MARK].update(&sEffectContext.tireMarks[i].effect) == 1) {
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT);
}
if (!sEffectContext.tireMarks[i].status.active) {
continue;
}
if (sEffectInfoTable[EFFECT_TIRE_MARK].update(&sEffectContext.tireMarks[i].effect) == 1) {
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT);
}
}
}

View File

@ -371,7 +371,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
Camera* retCam;
s32 csType = 0;
if ((csId < 0) || (sCutsceneMgr.csId != CS_ID_NONE)) {
if ((csId <= CS_ID_NONE) || (sCutsceneMgr.csId != CS_ID_NONE)) {
return csId;
}
@ -437,7 +437,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
s16 CutsceneManager_Stop(s16 csId) {
ActorCutscene* csEntry;
if (csId < 0) {
if (csId <= CS_ID_NONE) {
return csId;
}
@ -468,28 +468,28 @@ ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId) {
}
s16 CutsceneManager_GetAdditionalCsId(s16 csId) {
if (csId < 0) {
if (csId <= CS_ID_NONE) {
return CS_ID_NONE;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->additionalCsId;
}
s16 CutsceneManager_GetLength(s16 csId) {
if (csId < 0) {
if (csId <= CS_ID_NONE) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->length;
}
s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId) {
if (csId < 0) {
if (csId <= CS_ID_NONE) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->scriptIndex;
}
s16 CutsceneManager_GetCutsceneCustomValue(s16 csId) {
if (csId < 0) {
if (csId <= CS_ID_NONE) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->customValue;

View File

@ -3867,7 +3867,6 @@ void Interface_DrawItemButtons(PlayState* play) {
OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadow(OVERLAY_DISP, gButtonBackgroundTex, 0x20, 0x20, D_801BF9D4[0],
D_801BF9DC[0], D_801BFAF4[0], D_801BFAF4[0], D_801BF9E4[0] * 2,
D_801BF9E4[0] * 2, 100, 255, 120, interfaceCtx->bAlpha);
if (1) {}
gDPPipeSync(OVERLAY_DISP++);
// C-Left Button Color & Texture

View File

@ -89,7 +89,7 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
s32 i;
for (i = 0; i < objectCtx->num; i++) {
if ((objectCtx->status[i].id < 0 ? -objectCtx->status[i].id : objectCtx->status[i].id) == objectId) {
if (ABS_ALT(objectCtx->status[i].id) == objectId) {
return i;
}
}

View File

@ -400,7 +400,7 @@ void AnimatedMat_DrawMain(PlayState* play, AnimatedMaterial* matAnim, f32 alphaR
if ((matAnim != NULL) && (matAnim->segment != 0)) {
do {
segment = matAnim->segment;
segmentAbs = ((segment < 0) ? -segment : segment) + 7;
segmentAbs = ABS_ALT(segment) + 7;
matAnimDrawHandlers[matAnim->type](play, segmentAbs, Lib_SegmentedToVirtual(matAnim->params));
matAnim++;
} while (segment >= 0);

View File

@ -42,9 +42,6 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
break;
}
//! FAKE:
if (1) {}
// Actors which may be pictographed anywhere
switch (actor->id) {
case ACTOR_EN_KAKASI:
@ -71,15 +68,20 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
case ACTOR_EN_GE2:
seen |= PICTO_SEEN_ANYWHERE;
break;
default:
break;
}
if (!seen) {
continue;
}
// If actor is recordable, run its validity function and record if valid
if (seen) {
pictoActor = (PictoActor*)actor;
if (pictoActor->validationFunc != NULL) {
if ((pictoActor->validationFunc)(play, actor) == 0) {
validCount++;
}
pictoActor = (PictoActor*)actor;
if (pictoActor->validationFunc != NULL) {
if (pictoActor->validationFunc(play, actor) == 0) {
validCount++;
}
}
}

View File

@ -548,7 +548,7 @@ void Sram_GenerateRandomSaveFields(void) {
do {
randBombers = Rand_S16Offset(0, 6);
} while (randBombers <= 0 || randBombers >= 6);
} while ((randBombers <= 0) || (randBombers >= 6));
gSaveContext.save.saveInfo.bomberCode[0] = randBombers;
@ -558,7 +558,7 @@ void Sram_GenerateRandomSaveFields(void) {
do {
randBombers = Rand_S16Offset(0, 6);
} while (randBombers <= 0 || randBombers >= 6);
} while ((randBombers <= 0) || (randBombers >= 6));
sp2A = 0;
do {

View File

@ -6,8 +6,12 @@
*/
void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z) {
static f32 D_80134D00 = M_PI / 180.0f;
f32 sinr, sinp, sinh;
f32 cosr, cosp, cosh;
f32 sinr;
f32 sinp;
f32 sinh;
f32 cosr;
f32 cosp;
f32 cosh;
rot *= D_80134D00;
pitch *= D_80134D00;

View File

@ -66,7 +66,8 @@ s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid) {
u8 buf[BLOCKSIZE];
u8 comp[BLOCKSIZE];
u8 mask = 0;
s32 i, j = 0;
s32 i = 0;
s32 j = 0;
u16 index[4];
newid->repaired = 0xFFFFFFFF;

View File

@ -18,8 +18,10 @@ s32 osPfsChecker(OSPfs* pfs) {
__OSInodeUnit nextNodeInFile[16];
__OSInodeCache cache;
s32 fixed = 0;
u8 bank, prevBank = 254;
s32 cc, cl;
u8 bank = 254;
u8 prevBank = 254;
s32 cc;
s32 cl;
s32 offset;
ret = __osCheckId(pfs);

View File

@ -5,7 +5,7 @@ ldiv_t ldiv(long numer, long denom) {
val.quot = numer / denom;
val.rem = numer - denom * val.quot;
if (val.quot < 0 && val.rem > 0) {
if ((val.quot < 0) && (val.rem > 0)) {
val.quot++;
val.rem -= denom;
}
@ -18,7 +18,7 @@ lldiv_t lldiv(long long numer, long long denom) {
val.quot = numer / denom;
val.rem = numer - denom * val.quot;
if (val.quot < 0 && val.rem > 0) {
if ((val.quot < 0) && (val.rem > 0)) {
val.quot++;
val.rem -= denom;
}

View File

@ -36,7 +36,7 @@ void __ull_divremi(unsigned long long* quotient, unsigned long long* remainder,
long long __ll_mod(long long left, long long right) {
long long rem = left % right;
if ((rem < 0 && right > 0) || (rem > 0 && right < 0)) {
if (((rem < 0) && (right > 0)) || ((rem > 0) && (right < 0))) {
rem += right;
}
return rem;

View File

@ -107,7 +107,7 @@ void _Ldtob(_Pft* args, u8 type) {
val = (val - lo) * 1.0e8;
}
ptr = ptr + 8;
for (j = 8; lo > 0 && --j >= 0;) {
for (j = 8; (lo > 0) && (--j >= 0);) {
qr = ldiv(lo, 10);
*--ptr = qr.rem + '0';
lo = qr.quot;

View File

@ -206,7 +206,7 @@ void _Putfld(_Pft* px, va_list* pap, unsigned char code, unsigned char* ac) {
case 's':
px->s = va_arg(*pap, char*);
px->n1 = strlen(px->s);
if (px->prec >= 0 && px->n1 > px->prec) {
if ((px->prec >= 0) && (px->n1 > px->prec)) {
px->n1 = px->prec;
}
break;

View File

@ -85,7 +85,7 @@ void func_80BD66AC(BgHakaTomb* this, PlayState* play) {
if (Flags_GetClear(play, this->dyna.actor.room)) {
this->dyna.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
if (!func_80BD6638(&csId, this->csIdList, ARRAY_COUNT(this->csIdList)) && (csId < 0) &&
if (!func_80BD6638(&csId, this->csIdList, ARRAY_COUNT(this->csIdList)) && (csId <= CS_ID_NONE) &&
Flags_GetClear(play, this->dyna.actor.room)) {
this->dyna.actor.flags |= ACTOR_FLAG_1;
if (this->dyna.actor.isTargeted) {

View File

@ -93,7 +93,10 @@ s32 func_80C0A95C(BgIkninSusceil* this, PlayState* play) {
f32 new_var;
Player* player = GET_PLAYER(play);
Vec3f offset;
f32 temp1, temp2, temp3, temp4;
f32 temp1;
f32 temp2;
f32 temp3;
f32 temp4;
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
for (i = 0; i < 7; i++) {

View File

@ -843,9 +843,10 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla
case 594:
Audio_PlaySfxAtPos(&this->oathToOrderCutsceneVoicePos, NA_SE_EN_STAL24_SCREAM2);
break;
}
if (1) {}
default:
break;
}
if ((play->csCtx.curFrame >= 62) && (play->csCtx.curFrame < 273)) {
if ((Rand_ZeroOne() < 0.75f) && ((play->state.frames % 2) != 0)) {

View File

@ -572,6 +572,9 @@ void func_808B9CE8(DoorWarp1* this, PlayState* play) {
gSaveContext.save.saveInfo.unk_EA8[0] = (((void)0, gSaveContext.save.saveInfo.unk_EA8[0]) & 0x00FFFFFF) |
((((u8)gSaveContext.save.saveInfo.unk_EA8[1]) & 0xFF) << 0x18);
break;
default:
break;
}
gSaveContext.save.saveInfo.unk_EA8[1] = (gSaveContext.save.saveInfo.unk_EA8[1] & 0xFFFFFF00) |
@ -810,6 +813,9 @@ void func_808BA550(DoorWarp1* this, PlayState* play) {
case PLAYER_FORM_HUMAN:
temp_f0 = -25.0f;
break;
default:
break;
}
temp_f2 = this->dyna.actor.world.pos.y + (this->dyna.actor.shape.yOffset * 0.1f) + temp_f0;

View File

@ -203,7 +203,7 @@ void func_808A2918(EnBoom* this, PlayState* play) {
}
Math_ScaledStepToS(&this->actor.world.rot.y, sp72,
(this->unk_1CF > 0) ? 1000 : (s16)(((sp70 < 0) ? -sp70 : sp70) * sp64));
(this->unk_1CF > 0) ? 1000 : (s16)(ABS_ALT(sp70) * sp64));
}
Math_ScaledStepToS(&this->actor.world.rot.x, sp6E, ABS_ALT(sp6C) * sp64);

View File

@ -197,7 +197,8 @@ void func_809438F8(EnDaiku* this, PlayState* play) {
}
if (this->unk_278 == ENDAIKU_PARAMS_FF_3) {
f32 sq, abs;
f32 xzDist;
f32 yawDiff;
Math_ApproachF(&this->actor.world.pos.x, this->unk_26C.x, 0.5f,
fabsf(2.0f * Math_SinS(this->actor.world.rot.y)));
@ -205,9 +206,9 @@ void func_809438F8(EnDaiku* this, PlayState* play) {
fabsf(2.0f * Math_CosS(this->actor.world.rot.y)));
Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_282, 1, 0x7D0, 0xA);
sq = sqrtf(SQ(this->actor.world.pos.x - this->unk_26C.x) + SQ(this->actor.world.pos.z - this->unk_26C.z));
abs = fabsf(this->actor.world.rot.y - this->unk_282);
if ((sq < SQ(2.0f)) && (this->unk_258 != NULL) && (abs < 10.0f)) {
xzDist = sqrtf(SQ(this->actor.world.pos.x - this->unk_26C.x) + SQ(this->actor.world.pos.z - this->unk_26C.z));
yawDiff = fabsf(this->actor.world.rot.y - this->unk_282);
if ((xzDist < 4.0f) && (this->unk_258 != NULL) && (yawDiff < 10.0f)) {
this->unk_25C++;
if (this->unk_25C >= this->unk_258->count) {
this->unk_25C = 0;

View File

@ -667,7 +667,9 @@ void EnDekunuts_Update(Actor* thisx, PlayState* play) {
s32 EnDekunuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnDekunuts* this = THIS;
f32 arg1, arg2, arg3;
f32 arg1;
f32 arg2;
f32 arg3;
f32 currentFrame;
if (this->actionFunc == func_808BDA4C) {

View File

@ -266,34 +266,33 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, PlayState* play2) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < 256; i++, arg0++) {
if (arg0->isEnabled == 1) {
if (!isGfxSetup) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000000);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 0);
isGfxSetup = true;
}
Matrix_Push();
//! FAKE:
if (1) {}
arg0->unk_24 = (arg0->unk_01 / (f32)arg0->unk_02) * 255.0f;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)arg0->unk_24);
Matrix_Translate(arg0->unk_0C.x, arg0->unk_0C.y, arg0->unk_0C.z, MTXMODE_NEW);
Matrix_Scale(arg0->unk_04, arg0->unk_04, 1.0f, MTXMODE_APPLY);
Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
idx = (arg0->unk_01 / (f32)arg0->unk_02) * 8.0f;
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTextures[idx]));
gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000020);
Matrix_Pop();
sp5C += 1;
if (arg0->isEnabled != 1) {
continue;
}
if (!isGfxSetup) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000000);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 0);
isGfxSetup = true;
}
Matrix_Push();
arg0->unk_24 = (arg0->unk_01 / (f32)arg0->unk_02) * 255.0f;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)arg0->unk_24);
Matrix_Translate(arg0->unk_0C.x, arg0->unk_0C.y, arg0->unk_0C.z, MTXMODE_NEW);
Matrix_Scale(arg0->unk_04, arg0->unk_04, 1.0f, MTXMODE_APPLY);
Matrix_ReplaceRotation(&play->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
idx = (arg0->unk_01 / (f32)arg0->unk_02) * 8.0f;
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTextures[idx]));
gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000020);
Matrix_Pop();
sp5C += 1;
}
CLOSE_DISPS(play->state.gfxCtx);

View File

@ -62,8 +62,10 @@ static Color_RGBAf sOuterColors[] = {
};
typedef struct {
u8 r, g, b;
} FairyColorFlags;
/* 0x0 */ u8 r;
/* 0x1 */ u8 g;
/* 0x2 */ u8 b;
} FairyColorFlags; // size = 0x3
static FairyColorFlags sColorFlags[] = {
{ 0, 0, 0 }, { 1, 0, 0 }, { 1, 2, 0 }, { 1, 0, 2 }, { 0, 1, 0 }, { 2, 1, 0 }, { 0, 1, 2 },

View File

@ -114,7 +114,7 @@ void EnEndingHero6_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
OPEN_DISPS(play->state.gfxCtx);
if (this->npcIndex >= 4 && limbIndex == 15) {
if ((this->npcIndex >= 4) && (limbIndex == 15)) {
index = this->npcIndex - 4;
gSPDisplayList(POLY_OPA_DISP++, D_80C2426C[index]);
}
@ -136,25 +136,32 @@ void EnEndingHero6_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
if (this->objectIndex >= 0 && Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
if ((this->objectIndex >= 0) && Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objectIndex].segment);
switch (this->npcIndex) {
case 4:
gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255);
break;
case 5:
gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255);
break;
case 6:
gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255);
break;
case 7:
gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255);
break;
case 8:
gDPSetEnvColor(POLY_OPA_DISP++, 245, 155, 0, 255);
break;
default:
break;
}
if (this->npcIndex == 0) {

View File

@ -502,7 +502,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) {
surfaceType = SurfaceType_GetFloorProperty2(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
if ((this->actor.xzDistToPlayer < 30.0f) && (this->actor.floorHeight > BGCHECK_Y_MIN) && // close enough
(surfaceType != FLOOR_PROPERTY_12 && surfaceType != FLOOR_PROPERTY_13)) {
((surfaceType != FLOOR_PROPERTY_12) && (surfaceType != FLOOR_PROPERTY_13))) {
EnFamos_SetupAttackAim(this);
} else if ((Player_GetMask(play) == PLAYER_MASK_STONE) ||
@ -545,7 +545,8 @@ void EnFamos_Attack(EnFamos* this, PlayState* play) {
surfaceType = SurfaceType_GetFloorProperty2(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
hitFloor = this->actor.bgCheckFlags & BGCHECKFLAG_GROUND;
if (hitFloor || (this->actor.floorHeight == BGCHECK_Y_MIN) || (surfaceType == 0xC) || (surfaceType == 0xD)) {
if (hitFloor || (this->actor.floorHeight == BGCHECK_Y_MIN) || (surfaceType == FLOOR_PROPERTY_12) ||
(surfaceType == FLOOR_PROPERTY_13)) {
this->collider1.base.atFlags &= ~AT_ON;
this->collider2.base.atFlags |= AT_ON;
if (hitFloor) {
@ -747,7 +748,7 @@ void EnFamos_Update(Actor* thisx, PlayState* play) {
f32 oldHeight;
s32 oldHoverTimer; // save old value to test if changed
if (this->debrisTimer <= 0 ||
if ((this->debrisTimer <= 0) ||
(this->debrisTimer--, EnFamos_UpdateDebrisPosRot(this), (this->actionFunc != EnFamos_DeathFade))) {
oldHoverTimer = this->hoverTimer;
EnFamos_UpdateFlipStatus(this);

View File

@ -107,7 +107,7 @@ s32 EnFg_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s32 ret;
ret = false;
if (animIndex >= 0 && animIndex < 4) {
if ((animIndex >= 0) && (animIndex < 4)) {
ret = true;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {
@ -151,15 +151,19 @@ s32 EnFg_GetDamageEffect(EnFg* this) {
case 1:
ret = FG_DMGEFFECT_DEKUSTICK;
break;
case 15:
ret = FG_DMGEFFECT_HOOKSHOT;
break;
case 14:
ret = FG_DMGEFFECT_ARROW;
break;
case 3:
ret = FG_DMGEFFECT_ICEARROW;
break;
default:
ret = FG_DMGEFFECT_EXPLOSION;
break;
@ -187,8 +191,10 @@ void EnFg_Idle(EnFg* this, PlayState* play) {
this->actor.world.pos.y = this->actor.floorHeight + 2.0f;
this->actionFunc = EnFg_DoNothing;
break;
case FG_DMGEFFECT_HOOKSHOT:
break;
case FG_DMGEFFECT_ARROW:
this->actor.flags &= ~ACTOR_FLAG_1;
this->skelAnime.playSpeed = 0.0f;
@ -202,10 +208,10 @@ void EnFg_Idle(EnFg* this, PlayState* play) {
this->actor.scale.z = CLAMP_MIN(this->actor.scale.z, 0.001f);
this->actionFunc = EnFg_DoNothing;
break;
case FG_DMGEFFECT_EXPLOSION:
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_CRY_0);
if (1) {}
this->actor.params = FG_BLACK;
this->skelAnime.playSpeed = 0.0f;
ac = this->collider.base.ac;
@ -218,6 +224,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) {
this->timer = 0;
this->actionFunc = EnFg_Knockback;
break;
default:
if (DECR(this->timer) == 0) {
Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_JUMP);
@ -251,8 +258,10 @@ void EnFg_Jump(EnFg* this, PlayState* play) {
this->actor.scale.z = CLAMP_MIN(this->actor.scale.z, 0.001f);
this->actionFunc = EnFg_DoNothing;
break;
case FG_DMGEFFECT_HOOKSHOT:
break;
case FG_DMGEFFECT_EXPLOSION:
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfx(&this->actor, NA_SE_EV_FROG_CRY_0);
@ -269,6 +278,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) {
this->timer = 0;
this->actionFunc = EnFg_Knockback;
break;
default:
if (Animation_OnFrame(&this->skelAnime, 8.0f)) {
this->skelAnime.curFrame = 8.0f;
@ -461,26 +471,28 @@ void EnFg_DrawDust(PlayState* play, EnFgEffectDust* dustEffect) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < 10; i++, dustEffect++) {
if (dustEffect->type) {
if (!firstDone) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B328);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0);
firstDone = true;
}
if (1) {}
alpha = (255.0f / 16.0f) * dustEffect->timer;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, alpha);
gDPPipeSync(POLY_XLU_DISP++);
Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(dustEffect->xyScale, dustEffect->xyScale, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
index = 0.5f * dustEffect->timer;
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTextures[index]));
gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B338);
if (dustEffect->type == 0) {
continue;
}
if (!firstDone) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B328);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0);
firstDone = true;
}
alpha = (255.0f / 16.0f) * dustEffect->timer;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, alpha);
gDPPipeSync(POLY_XLU_DISP++);
Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(dustEffect->xyScale, dustEffect->xyScale, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
index = 0.5f * dustEffect->timer;
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTextures[index]));
gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B338);
}
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -126,7 +126,7 @@ static Vec3f sShopItemPositions[3] = {
s32 EnFsn_TestItemSelected(PlayState* play) {
MessageContext* msgCtx = &play->msgCtx;
if (msgCtx->unk12020 == 0x10 || msgCtx->unk12020 == 0x11) {
if ((msgCtx->unk12020 == 0x10) || (msgCtx->unk12020 == 0x11)) {
return CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A);
}
return CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) ||
@ -138,13 +138,17 @@ u16 EnFsn_GetWelcome(PlayState* play) {
switch (Player_GetMask(play)) {
case PLAYER_MASK_NONE:
return 0x29CC;
case PLAYER_MASK_DEKU:
return 0x29FC;
case PLAYER_MASK_GORON:
case PLAYER_MASK_ZORA:
return 0x29FD;
case PLAYER_MASK_KAFEIS_MASK:
return 0x2364;
default:
return 0x29FE;
}
@ -159,8 +163,9 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) {
} else {
this->textId = 0x29E4;
this->flags |= ENFSN_END_CONVERSATION;
break;
}
break;
case 0x29E0:
if (INV_CONTENT(ITEM_MASK_KEATON) == ITEM_MASK_KEATON) {
this->flags |= ENFSN_GIVE_ITEM;
@ -171,17 +176,20 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) {
break;
} else {
this->textId = 0x29E1;
break;
}
break;
case 0x29E1:
this->textId = 0x29E2;
break;
case 0x29E2:
this->flags |= ENFSN_GIVE_ITEM;
this->flags |= ENFSN_GAVE_KEATONS_MASK;
this->getItemId = GI_MASK_KEATON;
this->textId = 0x29E3;
break;
case 0x29E3:
this->flags |= ENFSN_GIVE_ITEM;
this->flags |= ENFSN_GAVE_LETTER_TO_MAMA;
@ -189,10 +197,14 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) {
SET_WEEKEVENTREG(WEEKEVENTREG_80_10);
this->textId = 0x29F1;
break;
case 0x29F1:
this->textId = 0x29E4;
this->flags |= ENFSN_END_CONVERSATION;
break;
default:
break;
}
Message_StartTextbox(play, this->textId, &this->actor);
if (this->flags & ENFSN_END_CONVERSATION) {
@ -210,7 +222,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, PlayState* play) {
void EnFsn_HandleSetupResumeInteraction(EnFsn* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) &&
this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) {
(this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED)) {
Actor_ProcessTalkRequest(&this->actor, &play->state);
func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1);
if (ENFSN_IS_SHOP(&this->actor)) {
@ -301,7 +313,7 @@ void EnFsn_CursorLeftRight(EnFsn* this) {
}
s16 EnFsn_GetThirdDayItemId(void) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_33_04) && CURRENT_DAY == 3) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_33_04) && (CURRENT_DAY == 3)) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_33_08) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_79_40)) {
return SI_BOMB_BAG_30_1;
}
@ -314,16 +326,22 @@ s16 EnFsn_GetStolenItemId(u32 stolenItem) {
switch (stolenItem) {
case ITEM_BOTTLE:
return SI_BOTTLE;
case ITEM_SWORD_GREAT_FAIRY:
return SI_SWORD_GREAT_FAIRY;
case ITEM_SWORD_KOKIRI:
return SI_SWORD_KOKIRI;
case ITEM_SWORD_RAZOR:
return SI_SWORD_RAZOR;
case ITEM_SWORD_GILDED:
return SI_SWORD_GILDED;
default:
return SI_NONE;
}
return SI_NONE;
}
s32 EnFsn_HasItemsToSell(void) {
@ -450,6 +468,7 @@ s32 EnFsn_FacingShopkeeperDialogResult(EnFsn* this, PlayState* play) {
}
Message_StartTextbox(play, this->actor.textId, &this->actor);
return true;
case 1:
func_8019F230();
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
@ -457,8 +476,10 @@ s32 EnFsn_FacingShopkeeperDialogResult(EnFsn* this, PlayState* play) {
func_80151BB4(play, 3);
this->actionFunc = EnFsn_SetupEndInteraction;
return true;
default:
return false;
}
return false;
}
s32 EnFsn_HasPlayerSelectedItem(EnFsn* this, PlayState* play, Input* input) {
@ -487,10 +508,10 @@ void EnFsn_UpdateJoystickInputState(EnFsn* this, PlayState* play) {
s8 stickY = CONTROLLER1(&play->state)->rel.stick_y;
if (this->stickAccumX == 0) {
if (stickX > 30 || stickX < -30) {
if ((stickX > 30) || (stickX < -30)) {
this->stickAccumX = stickX;
}
} else if (stickX <= 30 && stickX >= -30) {
} else if ((stickX <= 30) && (stickX >= -30)) {
this->stickAccumX = 0;
} else if ((this->stickAccumX * stickX) < 0) { // Stick has swapped directions
this->stickAccumX = stickX;
@ -503,10 +524,10 @@ void EnFsn_UpdateJoystickInputState(EnFsn* this, PlayState* play) {
}
}
if (this->stickAccumY == 0) {
if (stickY > 30 || stickY < -30) {
if ((stickY > 30) || (stickY < -30)) {
this->stickAccumY = stickY;
}
} else if (stickY <= 30 && stickY >= -30) {
} else if ((stickY <= 30) && (stickY >= -30)) {
this->stickAccumY = 0;
} else if ((this->stickAccumY * stickY) < 0) { // Stick has swapped directions
this->stickAccumY = stickY;
@ -765,7 +786,7 @@ void EnFsn_Haggle(EnFsn* this, PlayState* play) {
this->animIndex = FSN_ANIM_SLAM_COUNTER_LOOP;
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
} else {
if (this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP && Animation_OnFrame(&this->skelAnime, 18.0f)) {
if ((this->animIndex == FSN_ANIM_SLAM_COUNTER_LOOP) && Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_HANKO);
}
if (this->flags & ENFSN_CALM_DOWN) {
@ -828,20 +849,26 @@ void EnFsn_StartBuying(EnFsn* this, PlayState* play) {
this->actor.textId = 0x29CD;
Message_StartTextbox(play, this->actor.textId, &this->actor);
break;
case 0x29CD:
this->actor.textId = 0x29CE;
EnFsn_HandleLookToShopkeeperBuyingCutscene(this);
Message_StartTextbox(play, this->actor.textId, &this->actor);
break;
case 0x29CE:
this->actor.textId = 0xFF;
Message_StartTextbox(play, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_DeterminePrice;
break;
case 0x29CF:
player->exchangeItemId = PLAYER_IA_NONE;
this->actionFunc = EnFsn_SetupDeterminePrice;
break;
default:
break;
}
}
}
@ -860,6 +887,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) {
}
Message_StartTextbox(play, this->actor.textId, &this->actor);
break;
case 0x29D2:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_04)) {
this->actor.textId = 0x2A01;
@ -870,6 +898,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) {
}
Message_StartTextbox(play, this->actor.textId, &this->actor);
break;
case 0x29D3:
case 0x29D4:
case 0x29FA:
@ -877,6 +906,9 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) {
this->actor.textId = 0x29D5;
Message_StartTextbox(play, this->actor.textId, &this->actor);
break;
default:
break;
}
}
} else if (talkState == TEXT_STATE_CHOICE) {
@ -892,6 +924,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) {
Message_StartTextbox(play, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_FaceShopkeeperSelling;
break;
case 1:
func_8019F208();
this->isSelling = false;
@ -900,6 +933,9 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) {
Message_StartTextbox(play, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_StartBuying;
break;
default:
break;
}
}
}
@ -965,21 +1001,29 @@ void EnFsn_MakeOffer(EnFsn* this, PlayState* play) {
case 5:
this->getItemId = GI_RUPEE_BLUE;
break;
case 10:
this->getItemId = GI_RUPEE_10;
break;
case 20:
this->getItemId = GI_RUPEE_RED;
break;
case 50:
this->getItemId = GI_RUPEE_PURPLE;
break;
case 200:
this->getItemId = GI_RUPEE_HUGE;
break;
default:
break;
}
this->actionFunc = EnFsn_GiveItem;
break;
case 1:
func_8019F230();
player->exchangeItemId = PLAYER_IA_NONE;
@ -1146,6 +1190,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, PlayState* play) {
case CANBUY_RESULT_SUCCESS_2:
func_8019F208();
SET_WEEKEVENTREG(WEEKEVENTREG_33_04);
// fallthrough
case CANBUY_RESULT_SUCCESS_1:
if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) {
CutsceneManager_Stop(this->csId);
@ -1171,16 +1216,21 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, PlayState* play) {
this->itemIds[this->cursorIndex] = -1;
this->actionFunc = EnFsn_GiveItem;
break;
case CANBUY_RESULT_NEED_RUPEES:
play_sound(NA_SE_SY_ERROR);
Message_ContinueTextbox(play, 0x29F0);
this->actionFunc = EnFsn_PlayerCannotBuy;
break;
case CANBUY_RESULT_CANNOT_GET_NOW:
play_sound(NA_SE_SY_ERROR);
Message_ContinueTextbox(play, 0x29DD);
this->actionFunc = EnFsn_PlayerCannotBuy;
break;
default:
break;
}
}
@ -1211,10 +1261,15 @@ void EnFsn_SelectItem(EnFsn* this, PlayState* play) {
case 0:
EnFsn_HandleCanPlayerBuyItem(this, play);
break;
case 1:
func_8019F230();
this->actionFunc = this->prevActionFunc;
Message_ContinueTextbox(play, this->items[this->cursorIndex]->actor.textId);
break;
default:
break;
}
}
}
@ -1251,12 +1306,16 @@ void EnFsn_AskCanBuyMore(EnFsn* this, PlayState* play) {
Message_StartTextbox(play, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_DeterminePrice;
break;
case 1:
func_8019F230();
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
Message_StartTextbox(play, this->actor.textId, &this->actor);
func_80151BB4(play, 3);
break;
default:
break;
}
}
} else if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) {
@ -1298,12 +1357,16 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, PlayState* play) {
Message_StartTextbox(play, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_StartBuying;
break;
case 1:
func_8019F230();
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
Message_StartTextbox(play, this->actor.textId, &this->actor);
func_80151BB4(play, 3);
break;
default:
break;
}
}
} else if (((talkState == TEXT_STATE_5) || (talkState == TEXT_STATE_DONE)) && Message_ShouldAdvance(play)) {
@ -1341,6 +1404,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, PlayState* play) {
} else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
this->actor.textId = 0x29D6;
Message_StartTextbox(play, this->actor.textId, &this->actor);
//! FAKE:
if (play) {}
}
}
@ -1576,12 +1640,15 @@ s32 EnFsn_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
case FSN_LIMB_TORSO:
limbRotTableIdx = 0;
break;
case FSN_LIMB_LEFT_HAND:
limbRotTableIdx = 1;
break;
case FSN_LIMB_HEAD:
limbRotTableIdx = 2;
break;
default:
limbRotTableIdx = 9;
break;

View File

@ -426,23 +426,24 @@ void func_80962340(EnFu* this, PlayState* play) {
}
void func_80962588(EnFu* this, PlayState* play) {
if (Message_ShouldAdvance(play) && (this->unk_552 == 0x2871)) {
if (1) {}
if (play->msgCtx.choiceIndex == 0) {
if (gSaveContext.save.saveInfo.playerData.rupees >= 10) {
func_8019F208();
Rupees_ChangeBy(-10);
func_80963DE4(this, play);
} else {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(play, 0x2873, &this->actor);
this->unk_552 = 0x2873;
}
if (!Message_ShouldAdvance(play) || (this->unk_552 != 0x2871)) {
return;
}
if (play->msgCtx.choiceIndex == 0) {
if (gSaveContext.save.saveInfo.playerData.rupees >= 10) {
func_8019F208();
Rupees_ChangeBy(-10);
func_80963DE4(this, play);
} else {
func_8019F230();
Message_StartTextbox(play, 0x2872, &this->actor);
this->unk_552 = 0x2872;
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(play, 0x2873, &this->actor);
this->unk_552 = 0x2873;
}
} else {
func_8019F230();
Message_StartTextbox(play, 0x2872, &this->actor);
this->unk_552 = 0x2872;
}
}

View File

@ -151,7 +151,7 @@ s32 EnIn_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
s32 ret = false;
if (animIndex >= 0 && animIndex < 18) {
if ((animIndex >= 0) && (animIndex < 18)) {
ret = true;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {

View File

@ -685,7 +685,7 @@ void func_8095F180(EnIshi* this) {
}
void func_8095F194(EnIshi* this, PlayState* play) {
if (this->actor.csId < 0) {
if (this->actor.csId <= CS_ID_NONE) {
Actor_Kill(&this->actor);
} else if (CutsceneManager_GetCurrentCsId() != this->actor.csId) {
Actor_Kill(&this->actor);

View File

@ -1531,7 +1531,7 @@ void func_80B88D6C(EnKaizoku* this, PlayState* play) {
temp_ft4 = this->skelAnime.curFrame - this->skelAnime.playSpeed;
temp_ft5 = this->skelAnime.curFrame + this->skelAnime.playSpeed;
if (this->skelAnime.curFrame != 0.0f) {
if (((temp_ft4 < 0 && temp_ft5 > 0) || (temp_ft4 < 5 && temp_ft5 > 5))) {
if ((((temp_ft4 < 0) && (temp_ft5 > 0)) || ((temp_ft4 < 5) && (temp_ft5 > 5)))) {
Actor_PlaySfx(&this->picto.actor, NA_SE_EN_GERUDOFT_WALK);
}
}

View File

@ -348,8 +348,8 @@ void EnKakasi_IdleStanding(EnKakasi* this, PlayState* play) {
}
if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) {
Actor_GetScreenPos(play, &this->picto.actor, &x, &y);
if (this->picto.actor.projectedPos.z > -20.0f && x > 0 && x < SCREEN_WIDTH && y > 0 && y < SCREEN_HEIGHT &&
this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
if ((this->picto.actor.projectedPos.z > -20.0f) && (x > 0) && (x < SCREEN_WIDTH) && (y > 0) &&
(y < SCREEN_HEIGHT) && (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING)) {
// faster shaking
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
this->skelanime.playSpeed = 2.0f;

View File

@ -316,7 +316,7 @@ void func_80AEA128(EnLiftNuts* this, PlayState* play) {
}
void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
if ((func_80AE9B4C(0, 3) || func_80AE9B4C(0, 1)) && this->unk_34E == 1) {
if ((func_80AE9B4C(0, 3) || func_80AE9B4C(0, 1)) && (this->unk_34E == 1)) {
this->actor.flags |= ACTOR_FLAG_10000;
} else if (this->actor.xzDistToPlayer > 120.0f) {
func_80AE9FC8(this);
@ -326,7 +326,8 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
if (func_80AE9B4C(0, 0)) {
switch (CURRENT_DAY) {
case 1:
if (gSaveContext.save.time > CLOCK_TIME(23, 30) || gSaveContext.save.time <= CLOCK_TIME(6, 0)) {
if ((gSaveContext.save.time > CLOCK_TIME(23, 30)) ||
(gSaveContext.save.time <= CLOCK_TIME(6, 0))) {
Message_StartTextbox(play, 0x27F7, &this->actor);
this->textId = 0x27F7;
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10)) {
@ -339,7 +340,8 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
break;
case 2:
if (gSaveContext.save.time > CLOCK_TIME(23, 30) || gSaveContext.save.time <= CLOCK_TIME(6, 0)) {
if ((gSaveContext.save.time > CLOCK_TIME(23, 30)) ||
(gSaveContext.save.time <= CLOCK_TIME(6, 0))) {
Message_StartTextbox(play, 0x27F7, &this->actor);
this->textId = 0x27F7;
} else {
@ -360,7 +362,8 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
break;
case 3:
if (gSaveContext.save.time > CLOCK_TIME(23, 30) || gSaveContext.save.time <= CLOCK_TIME(6, 0)) {
if ((gSaveContext.save.time > CLOCK_TIME(23, 30)) ||
(gSaveContext.save.time <= CLOCK_TIME(6, 0))) {
Message_StartTextbox(play, 0x27F7, &this->actor);
this->textId = 0x27F7;
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_40)) {
@ -383,7 +386,7 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
Flags_UnsetSwitch(play, 0x40);
Inventory_SaveDekuPlaygroundHighScore(4);
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10) && CHECK_WEEKEVENTREG(WEEKEVENTREG_14_20) &&
CURRENT_DAY == 3) {
(CURRENT_DAY == 3)) {
this->unk_354 = 0;
Message_StartTextbox(play, 0x27F4, &this->actor);
this->textId = 0x27F4;
@ -394,7 +397,7 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
} else {
if (((void)0, gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2]) >=
gSaveContext.save.saveInfo.dekuPlaygroundHighScores[CURRENT_DAY - 1]) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] < 0x2EE0) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] < SECONDS_TO_TIMER(120)) {
Message_StartTextbox(play, 0x27F9, &this->actor);
this->textId = 0x27F9;
} else {
@ -428,6 +431,9 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
Message_StartTextbox(play, 0x27E9, &this->actor);
this->textId = 0x27E9;
break;
default:
break;
}
}
} else {
@ -435,7 +441,7 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) {
this->textId = 0x27D8;
}
func_80AEABF0(this);
} else if (func_80AE9AC4(this, 0) || this->unk_34E == 1) {
} else if (func_80AE9AC4(this, 0) || (this->unk_34E == 1)) {
if (this->unk_34E == 1) {
func_800B8614(&this->actor, play, 200.0f);
} else if (this->actor.playerHeightRel >= -13.0f) {
@ -533,6 +539,9 @@ void func_80AEA910(EnLiftNuts* this, PlayState* play) {
Message_StartTextbox(play, 0x27E9, &this->actor);
this->textId = 0x27E9;
break;
default:
break;
}
break;
@ -589,6 +598,9 @@ void func_80AEA910(EnLiftNuts* this, PlayState* play) {
Message_StartTextbox(play, 0x27ED, &this->actor);
this->textId = 0x27ED;
break;
default:
break;
}
}
}
@ -644,6 +656,9 @@ void func_80AEACF8(EnLiftNuts* this, PlayState* play) {
}
}
break;
default:
break;
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x2000, 0x500);
@ -668,6 +683,9 @@ void func_80AEACF8(EnLiftNuts* this, PlayState* play) {
this->unk_354++;
}
break;
default:
break;
}
}
func_80AEB974(this);
@ -759,7 +777,7 @@ void func_80AEB1C8(EnLiftNuts* this) {
void func_80AEB230(EnLiftNuts* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] > 0) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] > SECONDS_TO_TIMER(0)) {
player->stateFlags1 &= ~PLAYER_STATE1_20;
func_80AEB280(this);
}
@ -773,8 +791,8 @@ void func_80AEB294(EnLiftNuts* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (player->actor.floorBgId == BG_ACTOR_MAX) &&
player->actor.world.pos.y < 20.0f) ||
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] >= 0x2EE0) {
(player->actor.world.pos.y < 20.0f)) ||
(gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] >= SECONDS_TO_TIMER(120))) {
player->stateFlags1 |= PLAYER_STATE1_20;
Flags_SetSwitch(play, 0x41);
func_80AEB3E0(this, play);
@ -986,9 +1004,9 @@ void EnLiftNuts_Update(Actor* thisx, PlayState* play) {
s32 EnLiftNuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnLiftNuts* this = THIS;
if (limbIndex == OBJECT_DNT_LIMB_0F || limbIndex == OBJECT_DNT_LIMB_10 || limbIndex == OBJECT_DNT_LIMB_15 ||
limbIndex == OBJECT_DNT_LIMB_17 || limbIndex == OBJECT_DNT_LIMB_18 || limbIndex == OBJECT_DNT_LIMB_15 ||
limbIndex == OBJECT_DNT_LIMB_1B) {
if ((limbIndex == OBJECT_DNT_LIMB_0F) || (limbIndex == OBJECT_DNT_LIMB_10) || (limbIndex == OBJECT_DNT_LIMB_15) ||
(limbIndex == OBJECT_DNT_LIMB_17) || (limbIndex == OBJECT_DNT_LIMB_18) || (limbIndex == OBJECT_DNT_LIMB_15) ||
(limbIndex == OBJECT_DNT_LIMB_1B)) {
*dList = NULL;
}

View File

@ -198,7 +198,7 @@ void EnOssan_SetupAction(EnOssan* this, EnOssanActionFunc action) {
s32 EnOssan_TestItemSelected(PlayState* play) {
MessageContext* msgCtx = &play->msgCtx;
if (msgCtx->unk12020 == 0x10 || msgCtx->unk12020 == 0x11) {
if ((msgCtx->unk12020 == 0x10) || (msgCtx->unk12020 == 0x11)) {
return CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A);
}
return CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) ||
@ -210,7 +210,7 @@ void EnOssan_CheckValidSpawn(EnOssan* this) {
switch (gSaveContext.save.day) {
case 1:
case 2:
if (gSaveContext.save.time <= CLOCK_TIME(21, 30) && gSaveContext.save.time > CLOCK_TIME(6, 00)) {
if ((gSaveContext.save.time <= CLOCK_TIME(21, 30)) && (gSaveContext.save.time > CLOCK_TIME(6, 00))) {
if (this->actor.params != ENOSSAN_CURIOSITY_SHOP_MAN) {
Actor_Kill(&this->actor);
}
@ -218,16 +218,20 @@ void EnOssan_CheckValidSpawn(EnOssan* this) {
Actor_Kill(&this->actor);
}
break;
case 3:
if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) {
Actor_Kill(&this->actor);
}
if (!(gSaveContext.save.time <= CLOCK_TIME(22, 00) && gSaveContext.save.time >= CLOCK_TIME(6, 00))) {
if ((gSaveContext.save.time > CLOCK_TIME(22, 00)) || (gSaveContext.save.time < CLOCK_TIME(6, 00))) {
if (this->actor.params != ENOSSAN_CURIOSITY_SHOP_MAN) {
Actor_Kill(&this->actor);
}
}
break;
default:
break;
}
}
@ -377,9 +381,9 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) {
this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING;
}
} else {
if (this->actor.xzDistToPlayer < 100.0f &&
(player->actor.world.pos.x >= -40.0f && player->actor.world.pos.x <= 40.0f) &&
(player->actor.world.pos.z >= -91.0f && player->actor.world.pos.z <= -60.0f)) {
if ((this->actor.xzDistToPlayer < 100.0f) && (player->actor.world.pos.x >= -40.0f) &&
(player->actor.world.pos.x <= 40.0f) && (player->actor.world.pos.z >= -91.0f) &&
(player->actor.world.pos.z <= -60.0f)) {
func_800B8614(&this->actor, play, 100.0f);
}
if (this->actor.params == ENOSSAN_PART_TIME_WORKER) {
@ -411,11 +415,13 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) {
this->animIndex = FSN_ANIM_TURN_AROUND_FORWARD;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_TURN_AROUND_FORWARD);
break;
case FSN_ANIM_TURN_AROUND_FORWARD:
EnOssan_SetHaveMet(this);
this->textId = EnOssan_CuriosityShopMan_GetWelcome(this, play);
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, this->animIndex);
break;
case FSN_ANIM_HANDS_ON_COUNTER_START:
case FSN_ANIM_HAND_ON_FACE_START:
case FSN_ANIM_LEAN_FORWARD_START:
@ -425,6 +431,7 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) {
Message_StartTextbox(play, this->textId, &this->actor);
EnOssan_SetupStartShopping(play, this, false);
break;
case FSN_ANIM_HANDS_ON_COUNTER_LOOP:
case FSN_ANIM_HAND_ON_FACE_LOOP:
case FSN_ANIM_LEAN_FORWARD_LOOP:
@ -432,11 +439,13 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) {
this->animIndex = FSN_ANIM_TURN_AROUND_REVERSE;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_TURN_AROUND_REVERSE);
break;
case FSN_ANIM_TURN_AROUND_REVERSE:
this->animIndex = FSN_ANIM_SCRATCH_BACK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_SCRATCH_BACK);
EnOssan_SetupAction(this, EnOssan_Idle);
break;
default:
this->animIndex = FSN_ANIM_SCRATCH_BACK;
SubS_ChangeAnimationByInfoS(&this->skelAnime, animationInfo, FSN_ANIM_SCRATCH_BACK);
@ -459,11 +468,11 @@ void EnOssan_UpdateJoystickInputState(PlayState* play, EnOssan* this) {
this->moveHorizontal = this->moveVertical = false;
if (this->stickAccumX == 0) {
if (stickX > 30 || stickX < -30) {
if ((stickX > 30) || (stickX < -30)) {
this->stickAccumX = stickX;
this->moveHorizontal = true;
}
} else if (stickX <= 30 && stickX >= -30) {
} else if ((stickX <= 30) && (stickX >= -30)) {
this->stickAccumX = 0;
} else if ((this->stickAccumX * stickX) < 0) { // Stick has swapped directions
this->stickAccumX = stickX;
@ -477,11 +486,11 @@ void EnOssan_UpdateJoystickInputState(PlayState* play, EnOssan* this) {
}
}
if (this->stickAccumY == 0) {
if (stickY > 30 || stickY < -30) {
if ((stickY > 30) || (stickY < -30)) {
this->stickAccumY = stickY;
this->moveVertical = true;
}
} else if (stickY <= 30 && stickY >= -30) {
} else if ((stickY <= 30) && (stickY >= -30)) {
this->stickAccumY = 0;
} else if ((this->stickAccumY * stickY) < 0) { // Stick has swapped directions
this->stickAccumY = stickY;
@ -533,9 +542,9 @@ u8 EnOssan_SetCursorIndexFromNeutral(EnOssan* this, u8 shelfOffset) {
u8 EnOssan_CursorRight(EnOssan* this, u8 cursorIndex, u8 shelfSlotMin) {
u8 end = shelfSlotMin + 4;
while (cursorIndex >= shelfSlotMin && cursorIndex < end) {
while ((cursorIndex >= shelfSlotMin) && (cursorIndex < end)) {
cursorIndex -= 2;
if (cursorIndex >= shelfSlotMin && cursorIndex < end) {
if ((cursorIndex >= shelfSlotMin) && (cursorIndex < end)) {
if (this->items[cursorIndex] != NULL) {
return cursorIndex;
}
@ -607,12 +616,15 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, PlayState* play) {
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
return true;
case 1:
func_8019F230();
EnOssan_EndInteraction(play, this);
return true;
default:
return false;
}
return false;
}
void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
@ -656,7 +668,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
return;
}
}
if (this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation != PLAYER_FORM_ZORA) {
if ((this->actor.params == ENOSSAN_PART_TIME_WORKER) && (player->transformation != PLAYER_FORM_ZORA)) {
Math_SmoothStepToS(&this->partTimerHeadRot.y, 8000, 3, 2000, 0);
}
}
@ -871,7 +883,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, PlayState* play) {
}
}
} else {
if (this->stickAccumX > 0 && this->stickAccumX > 500) {
if ((this->stickAccumX > 0) && (this->stickAccumX > 500)) {
cursorIndex = EnOssan_CursorRight(this, this->cursorIndex, 4);
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
@ -879,7 +891,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, PlayState* play) {
EnOssan_SetupLookToShopkeeperFromShelf(play, this);
return;
}
} else if (this->stickAccumX < 0 && this->stickAccumX < -500) {
} else if ((this->stickAccumX < 0) && (this->stickAccumX < -500)) {
cursorIndex = EnOssan_CursorLeft(this, this->cursorIndex, 8);
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
@ -929,7 +941,7 @@ void EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) {
}
}
} else {
if (this->stickAccumX < 0 && this->stickAccumX < -500) {
if ((this->stickAccumX < 0) && (this->stickAccumX < -500)) {
cursorIndex = EnOssan_CursorRight(this, this->cursorIndex, 0);
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
@ -937,7 +949,7 @@ void EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) {
EnOssan_SetupLookToShopkeeperFromShelf(play, this);
return;
}
} else if (this->stickAccumX > 0 && this->stickAccumX > 500) {
} else if ((this->stickAccumX > 0) && (this->stickAccumX > 500)) {
cursorIndex = EnOssan_CursorLeft(this, this->cursorIndex, 4);
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
@ -1016,6 +1028,7 @@ void EnOssan_HandleCanBuyItem(PlayState* play, EnOssan* this) {
this->shopItemSelectedTween = 0.0f;
item->boughtFunc(play, item);
break;
case CANBUY_RESULT_SUCCESS_2:
func_8019F208();
item->buyFunc(play, item);
@ -1024,27 +1037,35 @@ void EnOssan_HandleCanBuyItem(PlayState* play, EnOssan* this) {
this->shopItemSelectedTween = 0.0f;
item->boughtFunc(play, item);
break;
case CANBUY_RESULT_NO_ROOM:
case CANBUY_RESULT_NO_ROOM_2:
play_sound(NA_SE_SY_ERROR);
EnOssan_SetupCannotBuy(play, this, sNoRoomTextIds[this->actor.params]);
break;
case CANBUY_RESULT_NEED_EMPTY_BOTTLE:
play_sound(NA_SE_SY_ERROR);
EnOssan_SetupCannotBuy(play, this, sNeedEmptyBottleTextIds[this->actor.params]);
break;
case CANBUY_RESULT_NEED_RUPEES:
play_sound(NA_SE_SY_ERROR);
EnOssan_SetupCannotBuy(play, this, sNeedRupeesTextIds[this->actor.params]);
break;
case CANBUY_RESULT_CANNOT_GET_NOW_2:
play_sound(NA_SE_SY_ERROR);
EnOssan_SetupCannotBuy(play, this, sCannotGetNowTextIds[this->actor.params]);
break;
case CANBUY_RESULT_CANNOT_GET_NOW:
play_sound(NA_SE_SY_ERROR);
EnOssan_SetupCannotBuy(play, this, sNoRoomTextIds[this->actor.params]);
break;
default:
break;
}
}
@ -1058,11 +1079,15 @@ void EnOssan_SelectItem(EnOssan* this, PlayState* play) {
case 0:
EnOssan_HandleCanBuyItem(play, this);
break;
case 1:
func_8019F230();
this->actionFunc = this->prevActionFunc;
Message_ContinueTextbox(play, this->items[this->cursorIndex]->actor.textId);
break;
default:
break;
}
}
}
@ -1134,6 +1159,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) {
EnOssan_SetupStartShopping(play, this, true);
func_800B85E0(&this->actor, play, 100.0f, PLAYER_IA_MINUS1);
break;
case 1:
default:
func_8019F230();
@ -1142,7 +1168,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) {
}
}
}
} else if (talkState == TEXT_STATE_5 && Message_ShouldAdvance(play)) {
} else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
EnOssan_ResetItemPosition(this);
item = this->items[this->cursorIndex];
item->restockFunc(play, item);
@ -1241,11 +1267,11 @@ void EnOssan_UpdateItemSelectedProperty(EnOssan* this) {
for (i = 0; i < ARRAY_COUNT(this->items); i++, items++) {
item = *items;
if (item != NULL) {
if (this->actionFunc != EnOssan_SelectItem && this->actionFunc != EnOssan_CannotBuy &&
this->drawCursor == 0) {
if ((this->actionFunc != EnOssan_SelectItem) && (this->actionFunc != EnOssan_CannotBuy) &&
(this->drawCursor == 0)) {
item->isSelected = false;
} else {
item->isSelected = this->cursorIndex == i ? true : false;
item->isSelected = (this->cursorIndex == i) ? true : false;
}
}
}
@ -1383,6 +1409,7 @@ u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) {
this->flags |= END_INTERACTION;
return textId;
}
switch (player->transformation) {
case PLAYER_FORM_DEKU:
this->animIndex = FSN_ANIM_SLAM_COUNTER_START;
@ -1390,21 +1417,25 @@ u16 EnOssan_CuriosityShopMan_GetWelcome(EnOssan* this, PlayState* play) {
return sWelcomeDekuTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeDekuFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
case PLAYER_FORM_ZORA:
this->animIndex = FSN_ANIM_LEAN_FORWARD_START;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_18_08)) {
return sWelcomeZoraTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeZoraFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
case PLAYER_FORM_GORON:
this->animIndex = FSN_ANIM_HAND_ON_FACE_START;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_18_04)) {
return sWelcomeGoronTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeGoronFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
default:
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START;
return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
this->animIndex = FSN_ANIM_HANDS_ON_COUNTER_START;
return sWelcomeHumanTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
u16 EnOssan_PartTimer_GetWelcome(EnOssan* this, PlayState* play) {
@ -1415,24 +1446,29 @@ u16 EnOssan_PartTimer_GetWelcome(EnOssan* this, PlayState* play) {
this->flags |= END_INTERACTION;
return textId;
}
switch (player->transformation) {
case PLAYER_FORM_DEKU:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_10)) {
return sWelcomeDekuTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeDekuFirstTimeTextIds[ENOSSAN_PART_TIME_WORKER];
case PLAYER_FORM_ZORA:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_08)) {
return sWelcomeZoraTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeZoraFirstTimeTextIds[ENOSSAN_PART_TIME_WORKER];
case PLAYER_FORM_GORON:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_04)) {
return sWelcomeGoronTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeGoronFirstTimeTextIds[ENOSSAN_PART_TIME_WORKER];
default:
return sWelcomeHumanTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeHumanTextIds[ENOSSAN_PART_TIME_WORKER];
}
void EnOssan_SetHaveMet(EnOssan* this) {
@ -1440,21 +1476,29 @@ void EnOssan_SetHaveMet(EnOssan* this) {
case 0x06A9:
SET_WEEKEVENTREG(WEEKEVENTREG_18_10);
break;
case 0x06C6:
SET_WEEKEVENTREG(WEEKEVENTREG_55_10);
break;
case 0x06A7:
SET_WEEKEVENTREG(WEEKEVENTREG_18_08);
break;
case 0x06C4:
SET_WEEKEVENTREG(WEEKEVENTREG_55_08);
break;
case 0x06A5:
SET_WEEKEVENTREG(WEEKEVENTREG_18_04);
break;
case 0x06C2:
SET_WEEKEVENTREG(WEEKEVENTREG_55_04);
break;
default:
break;
}
}
@ -1698,7 +1742,8 @@ s32 EnOssan_PartTimer_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dLi
void EnOssan_CuriosityShopMan_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnOssan* this = THIS;
if (limbIndex == FSN_LIMB_PELVIS || limbIndex == FSN_LIMB_LEFT_UPPER_ARM || limbIndex == FSN_LIMB_RIGHT_UPPER_ARM) {
if ((limbIndex == FSN_LIMB_PELVIS) || (limbIndex == FSN_LIMB_LEFT_UPPER_ARM) ||
(limbIndex == FSN_LIMB_RIGHT_UPPER_ARM)) {
rot->y += (s16)Math_SinS(this->limbRotTableY[limbIndex]) * 200;
rot->z += (s16)Math_CosS(this->limbRotTableZ[limbIndex]) * 200;
}

View File

@ -671,6 +671,9 @@ void func_80B5CD40(EnOt* this, PlayState* play) {
func_80B5CE6C(this, play);
}
break;
default:
break;
}
}

View File

@ -154,8 +154,6 @@ void EnPamera_Init(Actor* thisx, PlayState* play) {
func_80BD8588(this, play);
func_80BD8658(this);
if (1) {}
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) ||
CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || (gSaveContext.save.entrance == ENTRANCE(IKANA_CANYON, 9))) {
Actor_Kill(&this->actor);
@ -601,7 +599,6 @@ void func_80BD9938(EnPamera* this) {
void func_80BD994C(EnPamera* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
if (Player_GetMask(play) == PLAYER_MASK_GIBDO) {
if (1) {}
func_80BD93CC(this, 0, 1);
Message_StartTextbox(play, 0x15A8, &this->actor);

View File

@ -228,7 +228,8 @@ void func_8094702C(EnSda* this, u8* shadowTexture, Player* player, PlayState* pl
if (BREG(57) != 0) {
for (shadowTextureTemp = shadowTexture, i = 0; i < 0x1000; i++, shadowTextureTemp++) {
if ((i >= 0 && i < 0x40) || (i >= 0xFC0 && i < 0x1000) || ((i & 0x3F) == 0) || ((i & 0x3F) == 0x3F)) {
if (((i >= 0) && (i < 0x40)) || ((i >= 0xFC0) && (i < 0x1000)) || ((i & 0x3F) == 0) ||
((i & 0x3F) == 0x3F)) {
*shadowTextureTemp = 255;
} else {
*shadowTextureTemp = 0;
@ -352,6 +353,4 @@ void func_80947668(u8* shadowTexture, Player* player, PlayState* play) {
}
CLOSE_DISPS(gfxCtx);
if (1) {}
}

View File

@ -742,11 +742,11 @@ void func_809961E4(EnSkb* this, PlayState* play) {
}
void func_80996284(EnSkb* this, PlayState* play) {
if (this->unk_3D8 & 0x80) {
if (1) {}
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x10);
func_80996474(this);
if (!(this->unk_3D8 & 0x80)) {
return;
}
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x10);
func_80996474(this);
}
void func_809962D4(EnSkb* this) {
@ -982,22 +982,22 @@ void func_8099672C(EnSkb* this, PlayState* play) {
}
void func_80996AD0(EnSkb* this, PlayState* play) {
if (1) {}
if ((this->actionFunc == func_80996284) || (this->unk_3E2 == 1)) {
return;
}
if ((this->actionFunc != func_80996284) && (this->unk_3E2 != 1)) {
if (this->unk_3E4 != 0) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if (this->unk_3E4 != 0) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if (((this->unk_3DE != 0) || (this->unk_3D0 >= 11)) && (this->unk_3DE != 1) && (this->unk_3DE != 4) &&
(this->unk_3DE != 6) && (this->unk_3DE != 7) &&
((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
if (((this->unk_3DE != 0) || (this->unk_3D0 >= 11)) && (this->unk_3DE != 1) && (this->unk_3DE != 4) &&
(this->unk_3DE != 6) && (this->unk_3DE != 7) &&
((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
if ((this->actionFunc != func_80996284) && (this->actionFunc != func_809964A0)) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
if ((this->actionFunc != func_80996284) && (this->actionFunc != func_809964A0)) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
}

View File

@ -32,7 +32,7 @@ void EnTalk_Init(Actor* thisx, PlayState* play) {
EnTalk* this = THIS;
s8 targetMode = this->actor.home.rot.x - 0x1;
if (targetMode >= 0 && targetMode < 7) {
if ((targetMode >= 0) && (targetMode < 7)) {
this->actor.targetMode = targetMode;
}
@ -56,7 +56,7 @@ void func_80BDE090(EnTalk* this, PlayState* play) {
return;
}
if ((this->actor.xzDistToPlayer < 40.0f && Player_IsFacingActor(&this->actor, 0x3000, play)) ||
if (((this->actor.xzDistToPlayer < 40.0f) && Player_IsFacingActor(&this->actor, 0x3000, play)) ||
this->actor.isTargeted) {
func_800B8614(&this->actor, play, 120.0f);
}

View File

@ -390,26 +390,23 @@ void func_80BB5AAC(EnTanron1* this, PlayState* play) {
flag = 0;
ptr = ptrBase;
for (i = 0; i < this->actor.params; i++, ptr++) {
if (ptr->unk_24 != 2) {
continue;
if (ptr->unk_24 == 2) {
if (!flag) {
gSPDisplayList(POLY_OPA_DISP++, ovl_En_Tanron1_DL_001888);
gDPLoadTextureBlock(POLY_OPA_DISP++, ovl_En_Tanron1_DL_001428, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 32, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 5, G_TX_NOLOD,
G_TX_NOLOD);
flag++;
}
Matrix_Translate(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
Matrix_RotateYS(ptr->unk_1A, MTXMODE_APPLY);
Matrix_RotateXS(ptr->unk_18 * -1, MTXMODE_APPLY);
Matrix_Scale(1.0f, ptr->unk_2C, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, ovl_En_Tanron1_DL_001900);
}
if (!flag) {
gSPDisplayList(POLY_OPA_DISP++, ovl_En_Tanron1_DL_001888);
gDPLoadTextureBlock(POLY_OPA_DISP++, ovl_En_Tanron1_DL_001428, G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 32, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 5, G_TX_NOLOD, G_TX_NOLOD);
flag++;
}
Matrix_Translate(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
Matrix_RotateYS(ptr->unk_1A, MTXMODE_APPLY);
Matrix_RotateXS(ptr->unk_18 * -1, MTXMODE_APPLY);
Matrix_Scale(1.0f, ptr->unk_2C, 1.0f, MTXMODE_APPLY);
if (1) {}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, ovl_En_Tanron1_DL_001900);
}
CLOSE_DISPS(play->state.gfxCtx);

View File

@ -126,7 +126,7 @@ void EnTrt_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 a
s32 EnTrt_TestItemSelected(PlayState* play) {
MessageContext* msgCtx = &play->msgCtx;
if (msgCtx->unk12020 == 0x10 || msgCtx->unk12020 == 0x11) {
if ((msgCtx->unk12020 == 0x10) || (msgCtx->unk12020 == 0x11)) {
return CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A);
}
return CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) ||
@ -274,10 +274,10 @@ void EnTrt_UpdateJoystickInputState(PlayState* play, EnTrt* this) {
s8 stickY = CONTROLLER1(&play->state)->rel.stick_y;
if (this->stickAccumX == 0) {
if (stickX > 30 || stickX < -30) {
if ((stickX > 30) || (stickX < -30)) {
this->stickAccumX = stickX;
}
} else if (stickX <= 30 && stickX >= -30) {
} else if ((stickX <= 30) && (stickX >= -30)) {
this->stickAccumX = 0;
} else if ((this->stickAccumX * stickX) < 0) { // Stick has swapped directions
this->stickAccumX = stickX;
@ -290,10 +290,10 @@ void EnTrt_UpdateJoystickInputState(PlayState* play, EnTrt* this) {
}
}
if (this->stickAccumY == 0) {
if (stickY > 30 || stickY < -30) {
if ((stickY > 30) || (stickY < -30)) {
this->stickAccumY = stickY;
}
} else if (stickY <= 30 && stickY >= -30) {
} else if ((stickY <= 30) && (stickY >= -30)) {
this->stickAccumY = 0;
} else if ((this->stickAccumY * stickY) < 0) { // Stick has swapped directions
this->stickAccumY = stickY;
@ -351,10 +351,12 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) {
SET_WEEKEVENTREG(WEEKEVENTREG_53_08);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE_EMPTY);
break;
case 0x888:
this->textId = 0x889;
Message_StartTextbox(play, this->textId, &this->actor);
break;
case 0x889:
if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) {
CutsceneManager_Stop(this->csId);
@ -364,6 +366,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) {
play->msgCtx.stateTimer = 4;
this->actionFunc = EnTrt_PayForMushroom;
break;
default:
this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING;
EnTrt_EndInteraction(play, this);
@ -389,10 +392,14 @@ void EnTrt_Goodbye(EnTrt* this, PlayState* play) {
this->textId = 0x887;
Message_ContinueTextbox(play, this->textId);
break;
case 0x887:
case 0x88B:
EnTrt_EndInteraction(play, this);
break;
default:
break;
}
}
}
@ -504,12 +511,15 @@ s32 EnTrt_FacingShopkeeperDialogResult(EnTrt* this, PlayState* play) {
func_8019F208();
EnTrt_SetupTalkToShopkeeper(play, this);
return true;
case 1:
func_8019F230();
EnTrt_EndInteraction(play, this);
return true;
default:
return false;
}
return false;
}
void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) {
@ -603,7 +613,7 @@ s32 EnTrt_HasPlayerSelectedItem(PlayState* play, EnTrt* this, Input* input) {
return true;
}
if (EnTrt_TestItemSelected(play)) {
if (item->actor.params != SI_POTION_BLUE || (this->flags & ENTRT_GIVEN_MUSHROOM)) {
if ((item->actor.params != SI_POTION_BLUE) || (this->flags & ENTRT_GIVEN_MUSHROOM)) {
this->prevActionFunc = this->actionFunc;
Message_ContinueTextbox(play, EnTrt_GetItemChoiceTextId(this));
play_sound(NA_SE_SY_DECIDE);
@ -733,11 +743,15 @@ void EnTrt_SelectItem(EnTrt* this, PlayState* play) {
case 0:
EnTrt_HandleCanBuyItem(play, this);
break;
case 1:
func_8019F230();
this->actionFunc = this->prevActionFunc;
Message_ContinueTextbox(play, EnTrt_GetItemTextId(this));
break;
default:
break;
}
}
} else if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
@ -904,19 +918,25 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) {
this->actionFunc = EnTrt_StartRedPotionConversation;
}
break;
case 0x83E:
func_8011552C(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
this->actionFunc = EnTrt_FaceShopkeeper;
break;
case 0x850:
case 0x890:
this->actionFunc = EnTrt_SetupEndInteraction;
break;
case 0x88F:
this->actionFunc = EnTrt_StartRedPotionConversation;
break;
default:
break;
}
}
}
@ -1015,16 +1035,20 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) {
case 0x889:
this->textId = 0x88A;
break;
case 0x881:
this->textId = 0x88C;
break;
case 0x838:
case 0x83C:
case 0x88E:
case 0x88F:
this->textId = 0x83A;
break;
default:
//! FAKE:
if (1) {}
this->textId = 0x849;
break;
@ -1048,8 +1072,8 @@ void EnTrt_ShopkeeperGone(EnTrt* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
Message_StartTextbox(play, this->textId, &this->actor);
} else {
if ((player->actor.world.pos.x >= -50.0f && player->actor.world.pos.x <= 50.0f) &&
(player->actor.world.pos.z >= -19.0f && player->actor.world.pos.z <= 30.0f)) {
if ((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= 50.0f) &&
(player->actor.world.pos.z >= -19.0f) && (player->actor.world.pos.z <= 30.0f)) {
func_800B8614(&this->actor, play, 200.0f);
}
}
@ -1129,6 +1153,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) {
EnTrt_SetupStartShopping(play, this, true);
func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1);
break;
case 1:
default:
func_8019F230();

View File

@ -149,8 +149,8 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
u8 playerForm;
s16 playerParams;
if (play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON] >= 0 &&
CutsceneManager_GetCurrentCsId() != play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON]) {
if ((play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON] >= 0) &&
(CutsceneManager_GetCurrentCsId() != play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON])) {
if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON])) {
CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON]);
@ -245,7 +245,6 @@ void EnWarpTag_GrottoReturn(EnWarptag* this, PlayState* play) {
play->transitionTrigger = TRANS_TRIGGER_START;
func_8019F128(NA_SE_OC_SECRET_HOLE_OUT);
func_801A4058(5);
if (1) {}
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
}

View File

@ -76,24 +76,26 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
this->unk158 = this->actor.world.rot.y;
EnWeatherTag_SetupAction(this, func_80966A08);
break;
case WEATHERTAG_TYPE_UNK1:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) {
Actor_Kill(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80966B08);
break;
case WEATHERTAG_TYPE_WINTERFOG:
EnWeatherTag_SetupAction(this, func_80966E0C);
break;
case WEATHERTAG_TYPE_UNK3:
//! FAKE: this can move to different locations and still match
if (1) {}
case WEATHERTAG_TYPE_UNK3:
EnWeatherTag_SetupAction(this, func_80966EF0);
break;
case WEATHERTAG_TYPE_UNK4:
EnWeatherTag_SetupAction(this, func_80966FEC);
break;
case WEATHERTAG_TYPE_UNK5:
func_800BC154(play, &play->actorCtx, &this->actor, 7);
play->skyboxId = SKYBOX_3;
@ -102,6 +104,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
D_801F4E74 = 1.0f;
EnWeatherTag_SetupAction(this, func_80966BF4);
break;
case WEATHERTAG_TYPE_WATERMURK:
pathID = WEATHER_TAG_PATHID(&this->actor);
path = &play->setupPathList[pathID];
@ -109,8 +112,13 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
this->pathCount = path->count;
EnWeatherTag_SetupAction(this, func_809672DC);
break;
case WEATHERTAG_TYPE_LOCALDAY2RAIN:
EnWeatherTag_SetupAction(this, func_809674C8);
break;
default:
break;
}
}
@ -255,11 +263,13 @@ void func_80966BF4(EnWeatherTag* this, PlayState* play) {
case 0:
case 1:
default:
newUnk20 = 0;
break;
case 2:
newUnk20 = 3;
break;
case 3:
newUnk20 = 4;
break;
@ -287,9 +297,11 @@ void func_80966D20(EnWeatherTag* this, PlayState* play) {
default:
newUnk20 = 0;
break;
case 2:
newUnk20 = 3;
break;
case 3:
newUnk20 = 4;
break;

View File

@ -757,8 +757,6 @@ void func_80B97E0C(EnZot* this, PlayState* play) {
}
void func_80B97E4C(EnZot* this, PlayState* play) {
if (1) {}
if (this->unk_2F2 & 0x40) {
func_80B96BEC(this, 0, ANIMMODE_LOOP);
}
@ -768,33 +766,38 @@ void func_80B97E4C(EnZot* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
}
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.currentTextId) {
case 0x128C:
this->unk_2F2 &= ~4;
func_80B96BEC(this, 6, ANIMMODE_ONCE);
Message_ContinueTextbox(play, play->msgCtx.currentTextId + 1);
break;
if ((Message_GetState(&play->msgCtx) != TEXT_STATE_5) || !Message_ShouldAdvance(play)) {
return;
}
case 0x128D:
case 0x128E:
case 0x128F:
Message_ContinueTextbox(play, play->msgCtx.currentTextId + 1);
break;
switch (play->msgCtx.currentTextId) {
case 0x128C:
this->unk_2F2 &= ~4;
func_80B96BEC(this, 6, ANIMMODE_ONCE);
Message_ContinueTextbox(play, play->msgCtx.currentTextId + 1);
break;
case 0x1290:
Message_CloseTextbox(play);
this->actionFunc = func_80B97D6C;
this->unk_2F2 |= 4;
func_80B96BEC(this, 3, ANIMMODE_LOOP);
SET_WEEKEVENTREG(WEEKEVENTREG_38_08);
break;
case 0x128D:
case 0x128E:
case 0x128F:
Message_ContinueTextbox(play, play->msgCtx.currentTextId + 1);
break;
case 0x128B:
Message_CloseTextbox(play);
this->actionFunc = func_80B97FD0;
break;
}
case 0x1290:
Message_CloseTextbox(play);
this->actionFunc = func_80B97D6C;
this->unk_2F2 |= 4;
func_80B96BEC(this, 3, ANIMMODE_LOOP);
SET_WEEKEVENTREG(WEEKEVENTREG_38_08);
break;
case 0x128B:
Message_CloseTextbox(play);
this->actionFunc = func_80B97FD0;
break;
default:
break;
}
}

View File

@ -185,23 +185,24 @@ void func_80BDC830(EnZowStruct* ptr, PlayState* play) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < 15; i++, ptr++) {
if (ptr->unk_00 == 1) {
if (!flag) {
gDPPipeSync(POLY_XLU_DISP++);
gSPDisplayList(POLY_XLU_DISP++, gZoraRippleMaterialDL);
gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0);
if (1) {}
flag = true;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, ptr->unk_0F);
Matrix_Translate(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
Matrix_Scale(ptr->unk_04, 1.0f, ptr->unk_04, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraRippleModelDL);
if (ptr->unk_00 != 1) {
continue;
}
if (!flag) {
gDPPipeSync(POLY_XLU_DISP++);
gSPDisplayList(POLY_XLU_DISP++, gZoraRippleMaterialDL);
gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0);
flag = true;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, ptr->unk_0F);
Matrix_Translate(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
Matrix_Scale(ptr->unk_04, 1.0f, ptr->unk_04, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraRippleModelDL);
}
CLOSE_DISPS(play->state.gfxCtx);
@ -216,23 +217,24 @@ void func_80BDC9DC(EnZowStruct* ptr, PlayState* play) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < 15; i++, ptr++) {
if (ptr->unk_00 == 3) {
if (!flag) {
gSPDisplayList(POLY_XLU_DISP++, gZoraBubbleMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 150, 150, 150, 0);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
if (1) {}
flag = true;
}
Matrix_Translate(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(ptr->unk_04, ptr->unk_04, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraBubbleModelDL);
if (ptr->unk_00 != 3) {
continue;
}
if (!flag) {
gSPDisplayList(POLY_XLU_DISP++, gZoraBubbleMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 150, 150, 150, 0);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
flag = true;
}
Matrix_Translate(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(ptr->unk_04, ptr->unk_04, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraBubbleModelDL);
}
CLOSE_DISPS(play->state.gfxCtx);
@ -247,24 +249,25 @@ void func_80BDCB84(EnZowStruct* ptr, PlayState* play) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < 15; i++, ptr++) {
if (ptr->unk_00 == 2) {
if (!flag) {
gSPDisplayList(POLY_XLU_DISP++, gZoraSplashMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, 0);
if (1) {}
flag = true;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 180, 180, 180, ptr->unk_0F);
Matrix_Translate(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(ptr->unk_04, ptr->unk_04, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraSplashModelDL);
if (ptr->unk_00 != 2) {
continue;
}
if (!flag) {
gSPDisplayList(POLY_XLU_DISP++, gZoraSplashMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, 0);
flag = true;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 180, 180, 180, ptr->unk_0F);
Matrix_Translate(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(ptr->unk_04, ptr->unk_04, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraSplashModelDL);
}
CLOSE_DISPS(play->state.gfxCtx);

View File

@ -671,13 +671,14 @@ void func_80A24B74(ObjIceblock* this, PlayState* play) {
s32 pad;
Vec3f sp20;
if (this->dyna.actor.flags & ACTOR_FLAG_40) {
if (1) {}
sp20.x = this->dyna.actor.world.pos.x;
sp20.y = this->unk_244;
sp20.z = this->dyna.actor.world.pos.z;
EffectSsGRipple_Spawn(play, &sp20, 480, 880, 0);
if (!(this->dyna.actor.flags & ACTOR_FLAG_40)) {
return;
}
sp20.x = this->dyna.actor.world.pos.x;
sp20.y = this->unk_244;
sp20.z = this->dyna.actor.world.pos.z;
EffectSsGRipple_Spawn(play, &sp20, 480, 880, 0);
}
void func_80A24BDC(ObjIceblock* this, PlayState* play, f32 arg2, f32 arg3, s32 arg4) {

View File

@ -65,7 +65,7 @@ s32 ObjKibako2_ContainsSkulltula(ObjKibako2* this, PlayState* play) {
if ((u16)actorSpawnParam & 3) {
flag = ((actorSpawnParam & 0x3FC) >> 2) & 0xFF;
}
return !(flag >= 0 && Flags_GetTreasure(play, flag));
return !((flag >= 0) && Flags_GetTreasure(play, flag));
}
void ObjKibako2_Break(ObjKibako2* this, PlayState* play) {

View File

@ -64,7 +64,7 @@ void func_80C06B70(ObjMuPict* this, PlayState* play) {
s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
if (this->actor.csId < 0) {
if (this->actor.csId <= CS_ID_NONE) {
func_80C06DC8(this, play);
func_80C06CC4(this);
} else {

View File

@ -130,7 +130,7 @@ void func_80BA2514(ObjNozoki* this, PlayState* play) {
}
s32 func_80BA26A8(ObjNozoki* this) {
if (this->csId < 0) {
if (this->csId <= CS_ID_NONE) {
return true;
}

View File

@ -549,7 +549,7 @@ void func_80B04350(ObjSnowball* this, PlayState* play) {
this->unk_20A = 0;
}
if (this->actor.csId < 0) {
if (this->actor.csId <= CS_ID_NONE) {
func_80B03FF8(this, play);
if (this->unk_20A == 0) {
func_80B04608(this, play);

View File

@ -97,7 +97,7 @@ s32 ObjWarpstone_ClosedIdle(ObjWarpstone* this, PlayState* play) {
}
s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, PlayState* play) {
if ((this->dyna.actor.csId < 0) || CutsceneManager_IsNext(this->dyna.actor.csId)) {
if ((this->dyna.actor.csId <= CS_ID_NONE) || CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
ObjWarpstone_SetupAction(this, ObjWarpstone_PlayOpeningCutscene);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_OWL_WARP_SWITCH_ON);

View File

@ -145,13 +145,14 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
s32 pad;
Vec3f spawnPos;
//! FAKE:
if (1) {}
if (this->collider.base.acFlags & AC_HIT) {
play_sound(NA_SE_SY_CORRECT_CHIME);
if (1) {}
if (INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE) {
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_ETCETERA, 700.0f, -800.0f, 7261.0f, 0, 0, 0,
ITEM_ETC_ARROW_FIRE);
if (1) {}
gSaveContext.cutsceneTrigger = 1;
} else {
spawnPos.x = 700.0f;
@ -168,19 +169,19 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
return;
}
if (!(this->actor.xzDistToPlayer > 120.0f)) {
if ((gSaveContext.save.time >= CLOCK_TIME(6, 30)) && (gSaveContext.save.time < CLOCK_TIME(7, 30))) {
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (play->envCtx.sunPos.x * (1.0f / 6.0f));
cylinderPos.y =
(player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f) + (play->envCtx.sunPos.y * (1.0f / 6.0f));
cylinderPos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (play->envCtx.sunPos.z * (1.0f / 6.0f));
this->hitboxPos = cylinderPos;
Collider_SetCylinderPosition(&this->collider, &cylinderPos);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
if ((this->actor.xzDistToPlayer > 120.0f) || (gSaveContext.save.time < CLOCK_TIME(6, 30)) ||
(gSaveContext.save.time >= CLOCK_TIME(7, 30))) {
return;
}
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (play->envCtx.sunPos.x * (1.0f / 6.0f));
cylinderPos.y = (player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f) + (play->envCtx.sunPos.y * (1.0f / 6.0f));
cylinderPos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (play->envCtx.sunPos.z * (1.0f / 6.0f));
this->hitboxPos = cylinderPos;
Collider_SetCylinderPosition(&this->collider, &cylinderPos);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
void ShotSun_Update(Actor* thisx, PlayState* play) {

View File

@ -3995,8 +3995,8 @@ s32 func_80830F9C(PlayState* play) {
s32 func_80830FD4(PlayState* play) {
return (play->unk_1887C != 0) &&
(play->unk_1887C < 0 || CHECK_BTN_ANY(sPlayerControlInput->cur.button,
BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_B | BTN_A));
((play->unk_1887C < 0) || CHECK_BTN_ANY(sPlayerControlInput->cur.button,
BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_B | BTN_A));
}
s32 func_80831010(Player* this, PlayState* play) {