mirror of https://github.com/zeldaret/mm.git
Improve Various Matchings and Cleanup (#809)
* Improve various matchings and cleanup * Fix warnings * Missed 2 * Few hex to dec * PR Suggestions * More PR Suggestions * Document time calculation * Improved use of macros * DAY_LENGTH macro * More cleanup of functions Co-authored-by: hensldm <https://github.com/hensldm> * Missing a space * PR Suggestions * Use DAY_LENGTH more
This commit is contained in:
parent
9fcf1bd55b
commit
c2c7240634
|
|
@ -51,6 +51,7 @@
|
|||
|
||||
#define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60))
|
||||
#define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1))
|
||||
#define DAY_LENGTH (CLOCK_TIME(24, 0))
|
||||
|
||||
#define TIME_TO_MINUTES_F(time) ((time) * ((24.0f * 60.0f) / 0x10000)) // 0.021972656f
|
||||
#define CLOCK_TIME_F(hr, min) (((hr) * 60.0f + (min)) * (0x10000 / (24.0f * 60.0f)))
|
||||
|
|
|
|||
|
|
@ -129,9 +129,9 @@ typedef struct Save {
|
|||
/* 0x000C */ u16 time; // "zelda_time"
|
||||
/* 0x000E */ u16 owlSaveLocation;
|
||||
/* 0x0010 */ s32 isNight; // "asahiru_fg"
|
||||
/* 0x0014 */ u32 daySpeed; // "change_zelda_time"
|
||||
/* 0x0014 */ s32 daySpeed; // "change_zelda_time"
|
||||
/* 0x0018 */ s32 day; // "totalday"
|
||||
/* 0x001C */ u32 daysElapsed; // "eventday"
|
||||
/* 0x001C */ s32 daysElapsed; // "eventday"
|
||||
/* 0x0020 */ u8 playerForm; // "player_character"
|
||||
/* 0x0021 */ u8 snowheadCleared; // "spring_flag"
|
||||
/* 0x0022 */ u8 hasTatl; // "bell_flag"
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
|||
CollisionPoly* spF8;
|
||||
s32 bgId;
|
||||
f32 floorHeight[2];
|
||||
f32 pad;
|
||||
Light* firstLight = &mapper->l.l[0];
|
||||
f32 shadowAlpha;
|
||||
f32 shadowScaleX;
|
||||
f32 shadowScaleZ;
|
||||
|
|
@ -239,8 +239,6 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
|||
IREG(88) + 80, IREG(89) + 60, IREG(90) + 40, 30000, 200, 60);
|
||||
}
|
||||
actor->shape.unk_17 &= ~spB8;
|
||||
|
||||
if ((uintptr_t)mapper->l.l) {} // POSSIBLE FAKE MATCH
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +250,8 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
|||
shadowScaleZ = 1.0f - (distToFloor * (1.0f / 70.0f));
|
||||
shadowScaleX = actor->shape.shadowScale * shadowScaleZ * actor->scale.x;
|
||||
|
||||
for (lightPtr = mapper->l.l, j = 0; j < numLights; lightPtr++, j++) {
|
||||
lightPtr = firstLight;
|
||||
for (j = 0; j < numLights; j++) {
|
||||
if (lightPtr->l.dir[1] > 0) {
|
||||
lightNum = (lightPtr->l.col[0] + lightPtr->l.col[1] + lightPtr->l.col[2]) *
|
||||
ABS_ALT(lightPtr->l.dir[1]);
|
||||
|
|
@ -263,9 +262,10 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
|||
shadowScaleZ);
|
||||
}
|
||||
}
|
||||
lightPtr++;
|
||||
}
|
||||
|
||||
for (j = 0; j < 2; lightPtr++, j++) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
if (lightPtr->l.dir[1] > 0) {
|
||||
lightNum = ((lightPtr->l.col[0] + lightPtr->l.col[1] + lightPtr->l.col[2]) *
|
||||
ABS_ALT(lightPtr->l.dir[1])) -
|
||||
|
|
@ -275,6 +275,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
|||
shadowScaleZ);
|
||||
}
|
||||
}
|
||||
lightPtr++;
|
||||
}
|
||||
}
|
||||
feetPosPtr++;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
|
|||
u8 isStartFrame = false;
|
||||
f32 progress;
|
||||
SceneTableEntry* loadedScene;
|
||||
u16 time;
|
||||
|
||||
if ((csCtx->frames < cmd->startFrame) || ((csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame))) {
|
||||
return;
|
||||
|
|
@ -250,11 +249,9 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
|
|||
break;
|
||||
case 0x12:
|
||||
if (!gSaveContext.save.isNight) {
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = time - (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)REG(15);
|
||||
} else {
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = time - (u16)(2 * REG(15));
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)(2 * REG(15));
|
||||
}
|
||||
break;
|
||||
case 0x13:
|
||||
|
|
@ -328,10 +325,9 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
|
|||
D_801BB15C = csCtx->frames;
|
||||
|
||||
if (REG(15) != 0) {
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)REG(15) + time;
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + time;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
gSaveContext.save.time =
|
||||
((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -815,8 +815,6 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
s16 func_800A7650(s16 dropId) {
|
||||
s16 healthCapacity;
|
||||
|
||||
if ((((dropId == ITEM00_BOMBS_A) || (dropId == ITEM00_BOMBS_0) || (dropId == ITEM00_BOMBS_B)) &&
|
||||
(INV_CONTENT(ITEM_BOMB) == ITEM_NONE)) ||
|
||||
(((dropId == ITEM00_ARROWS_10) || (dropId == ITEM00_ARROWS_30) || (dropId == ITEM00_ARROWS_40) ||
|
||||
|
|
@ -828,8 +826,7 @@ s16 func_800A7650(s16 dropId) {
|
|||
}
|
||||
|
||||
if (dropId == ITEM00_HEART) {
|
||||
healthCapacity = gSaveContext.save.playerData.healthCapacity;
|
||||
if (healthCapacity == gSaveContext.save.playerData.health) {
|
||||
if (((void)0, gSaveContext.save.playerData.healthCapacity) == ((void)0, gSaveContext.save.playerData.health)) {
|
||||
return ITEM00_RUPEE_GREEN;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,23 +405,23 @@ void func_80151BB4(GlobalContext* globalCtx, u8 arg1) {
|
|||
|
||||
u32 func_80151C9C(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
u8 flag;
|
||||
|
||||
while (true) {
|
||||
if (msgCtx->unk120B1 == 0) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
msgCtx->unk120B1--;
|
||||
|
||||
if ((gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8] &
|
||||
(u8)D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]]) == 0) {
|
||||
flag = gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8];
|
||||
gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8] =
|
||||
flag | (u8)D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]];
|
||||
((void)0, gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8]) |
|
||||
(u8)D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]];
|
||||
|
||||
if ((D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]] != 0) && CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
|
||||
func_80151938(globalCtx, D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]]);
|
||||
play_sound(NA_SE_SY_SCHEDULE_WRITE);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,29 +193,32 @@ void Message_LoadTimeNES(GlobalContext* globalCtx, u8 arg1, s32* offset, f32* ar
|
|||
s16 p = *decodedBufPos;
|
||||
s32 o = *offset;
|
||||
f32 f = *arg3;
|
||||
u32 dayTime;
|
||||
u32 timeLeft;
|
||||
s16 digits[4];
|
||||
f32 timeInMinutes;
|
||||
s32 day;
|
||||
f32 timeLeftInMinutes;
|
||||
s16 i;
|
||||
|
||||
if (arg1 == 0xCF) {
|
||||
day = gSaveContext.save.day;
|
||||
dayTime = 0x40000 - ((day % 5) << 16) - (u16)(-0x4000 + gSaveContext.save.time);
|
||||
// Calculates the time left before the moon crashes.
|
||||
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
|
||||
timeLeft = (4 - CURRENT_DAY) * DAY_LENGTH - (u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0));
|
||||
} else {
|
||||
dayTime = 0x10000 - (u16)(-0x4000 + gSaveContext.save.time);
|
||||
// Calculates the time left before a new day.
|
||||
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
|
||||
timeLeft = DAY_LENGTH - (u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0));
|
||||
}
|
||||
timeInMinutes = TIME_TO_MINUTES_F(dayTime);
|
||||
|
||||
timeLeftInMinutes = TIME_TO_MINUTES_F(timeLeft);
|
||||
|
||||
digits[0] = 0;
|
||||
digits[1] = (timeInMinutes / 60.0f);
|
||||
digits[1] = (timeLeftInMinutes / 60.0f);
|
||||
while (digits[1] >= 10) {
|
||||
digits[0]++;
|
||||
digits[1] -= 10;
|
||||
}
|
||||
|
||||
digits[2] = 0;
|
||||
digits[3] = (s32)timeInMinutes % 60;
|
||||
digits[3] = (s32)timeLeftInMinutes % 60;
|
||||
while (digits[3] >= 10) {
|
||||
digits[2]++;
|
||||
digits[3] -= 10;
|
||||
|
|
|
|||
|
|
@ -142,11 +142,9 @@ void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id) {
|
|||
|
||||
// SceneTableEntry Header Command 0x00: Spawn List
|
||||
void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
GlobalContext* globalCtx2 = globalCtx;
|
||||
s32 loadedCount;
|
||||
void* nextObject;
|
||||
s16 playerObjectId;
|
||||
u8 playerForm;
|
||||
void* nextObject;
|
||||
|
||||
globalCtx->linkActorEntry = (ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) +
|
||||
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
|
||||
|
|
@ -158,11 +156,10 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
|
|||
}
|
||||
|
||||
loadedCount = Object_Spawn(&globalCtx->objectCtx, OBJECT_LINK_CHILD);
|
||||
nextObject = globalCtx2->objectCtx.status[globalCtx2->objectCtx.num].segment;
|
||||
nextObject = globalCtx->objectCtx.status[globalCtx->objectCtx.num].segment;
|
||||
globalCtx->objectCtx.num = loadedCount;
|
||||
globalCtx->objectCtx.spawnedObjectCount = loadedCount;
|
||||
playerForm = gSaveContext.save.playerForm;
|
||||
playerObjectId = gLinkFormObjectIndexes[playerForm];
|
||||
playerObjectId = gLinkFormObjectIndexes[(void)0, gSaveContext.save.playerForm];
|
||||
gActorOverlayTable[0].initInfo->objectId = playerObjectId;
|
||||
Object_Spawn(&globalCtx->objectCtx, playerObjectId);
|
||||
|
||||
|
|
@ -378,8 +375,6 @@ void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd) {
|
|||
|
||||
// SceneTableEntry Header Command 0x10: Time Settings
|
||||
void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
u32 dayTime;
|
||||
|
||||
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
|
||||
gSaveContext.environmentTime = gSaveContext.save.time =
|
||||
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
|
||||
|
|
@ -399,12 +394,9 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
|||
REG(15) = globalCtx->envCtx.timeIncrement;
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.save.time;
|
||||
globalCtx->envCtx.unk_4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.save.time;
|
||||
globalCtx->envCtx.unk_8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.save.time;
|
||||
globalCtx->envCtx.unk_C = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
|
||||
globalCtx->envCtx.unk_4 = -(Math_SinS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.unk_8 = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.unk_C = (Math_CosS(((void)0, gSaveContext.save.time) - 0x8000) * 20.0f) * 25.0f;
|
||||
|
||||
if (globalCtx->envCtx.timeIncrement == 0 && gSaveContext.save.cutscene < 0xFFF0) {
|
||||
gSaveContext.environmentTime = gSaveContext.save.time;
|
||||
|
|
|
|||
|
|
@ -82,17 +82,12 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f offset;
|
||||
f32 rotZ;
|
||||
f32 rotZtmp;
|
||||
|
||||
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
if (offset.z > 1100.0f) {
|
||||
rotZ = 0.0f;
|
||||
} else {
|
||||
rotZtmp = CLAMP_MAX(1100.0f - offset.z, 1000.0f);
|
||||
rotZ = rotZtmp;
|
||||
}
|
||||
rotZ = CLAMP(1100.0f - offset.z, 0.0f, 1000.0f);
|
||||
func_800DFAC8(globalCtx->cameraPtrs[CAM_ID_MAIN], 17);
|
||||
this->dyna.actor.shape.rot.z = rotZ * 16.384f;
|
||||
|
||||
if (globalCtx->csCtx.frames == 132) {
|
||||
play_sound(NA_SE_SY_SPIRAL_DASH);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
temp_v0 = gSaveContext.save.time;
|
||||
if (temp_v0 > CLOCK_TIME(12, 0)) {
|
||||
temp_v0 = 0xFFFF - temp_v0;
|
||||
temp_v0 = (DAY_LENGTH - 1) - temp_v0;
|
||||
}
|
||||
sp68 = (f32)temp_v0 / 0x8000;
|
||||
spD3 = ((10.0f * sp68) + 105.0f) * this->unk_19C;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,10 @@ const ActorInit Dm_Ravine_InitVars = {
|
|||
};
|
||||
|
||||
void DmRavine_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
DmRavine* this = THIS;
|
||||
u8 flag = gSaveContext.save.weekEventReg[0];
|
||||
if (((flag & 0x10) | cREG(0)) != 0) {
|
||||
|
||||
if (((((void)0, gSaveContext.save.weekEventReg[0]) & 0x10) | cREG(0)) != 0) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1512,7 +1512,6 @@ void func_80AA27EC(DmStk* this, GlobalContext* globalCtx) {
|
|||
|
||||
void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DmStk* this = THIS;
|
||||
u16 time;
|
||||
|
||||
if (this->actor.params != 1) {
|
||||
if (this->unk_2E0 == 33) {
|
||||
|
|
@ -1569,11 +1568,9 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
(globalCtx->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&globalCtx->state) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (ActorCutscene_GetCurrentIndex() == -1) &&
|
||||
(globalCtx->csCtx.state == 0)) {
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)REG(15) + time;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (REG(15) != 0) {
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + time;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,9 +570,7 @@ void func_808A1884(DoorShutter* this, GlobalContext* globalCtx) {
|
|||
if (DoorShutter_SetupDoor(this, globalCtx) && !(player->stateFlags1 & 0x800)) {
|
||||
DoorShutter_SetupAction(this, func_808A1C50);
|
||||
if (ActorCutscene_GetCurrentIndex() == 0x7D) {
|
||||
s8 data = gSaveContext.respawn[RESTART_MODE_DOWN].data;
|
||||
|
||||
func_801226E0(globalCtx, data);
|
||||
func_801226E0(globalCtx, ((void)0, gSaveContext.respawn[RESTART_MODE_DOWN].data));
|
||||
player->unk_A86 = -1;
|
||||
func_800B7298(globalCtx, NULL, 0x73);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,11 +100,8 @@ void func_809C10B0(EnAob01* this, s32 arg1) {
|
|||
}
|
||||
|
||||
void func_809C1124(void) {
|
||||
u16 time = gSaveContext.save.time;
|
||||
|
||||
gSaveContext.save.time = (u16)REG(15) + time;
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + time;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
|
||||
void func_809C1158(EnAob01* this, GlobalContext* globalCtx) {
|
||||
|
|
@ -882,8 +879,8 @@ void func_809C2F34(EnAob01* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_809C2FA0(void) {
|
||||
u8 i;
|
||||
u8 idx;
|
||||
u8 idx2;
|
||||
u8 rand;
|
||||
u8 index;
|
||||
u8 orig;
|
||||
u8 orig2;
|
||||
u8 sp44[7];
|
||||
|
|
@ -892,11 +889,11 @@ void func_809C2FA0(void) {
|
|||
};
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sp34); i++) {
|
||||
idx = Rand_ZeroFloat(14.0f);
|
||||
rand = Rand_ZeroFloat(14.0f);
|
||||
orig = sp34[i];
|
||||
|
||||
sp34[i] = sp34[idx];
|
||||
sp34[idx] = orig;
|
||||
sp34[i] = sp34[rand];
|
||||
sp34[rand] = orig;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sp44); i++) {
|
||||
|
|
@ -906,14 +903,14 @@ void func_809C2FA0(void) {
|
|||
|
||||
for (i = 0; i < ARRAY_COUNT(sp34); i++) {
|
||||
orig2 = sp34[i];
|
||||
idx2 = i / 2;
|
||||
index = i / 2;
|
||||
|
||||
if (i % 2) {
|
||||
sp44[idx2] |= orig2 << 0x4;
|
||||
idx = gSaveContext.save.weekEventReg[42 + idx2];
|
||||
gSaveContext.save.weekEventReg[42 + idx2] = idx | sp44[idx2];
|
||||
sp44[index] |= orig2 << 0x4;
|
||||
gSaveContext.save.weekEventReg[42 + index] =
|
||||
((void)0, gSaveContext.save.weekEventReg[42 + index]) | sp44[index];
|
||||
} else {
|
||||
sp44[idx2] |= orig2;
|
||||
sp44[index] |= orig2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,8 +116,7 @@ void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
|
||||
s32 tempDay;
|
||||
f32 tempTimeBeforeMoonCrash;
|
||||
f32 timeBeforeMoonCrash;
|
||||
|
||||
switch (this->actor.params) {
|
||||
case ENBJI01_PARAMS_DEFAULT:
|
||||
|
|
@ -180,10 +179,11 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
|
|||
this->textId = 0x5EA;
|
||||
break;
|
||||
case 3:
|
||||
tempDay = gSaveContext.save.day;
|
||||
tempTimeBeforeMoonCrash =
|
||||
((-(tempDay % 5 << 0x10) - ((u16)(gSaveContext.save.time - 0x4000))) + 0x40000);
|
||||
if (tempTimeBeforeMoonCrash < CLOCK_TIME_F(1, 0)) { /* 1 hr */
|
||||
// Calculates the time left before the moon crashes.
|
||||
// The day begins at CLOCK_TIME(6, 0) so it must be offset.
|
||||
timeBeforeMoonCrash = (4 - CURRENT_DAY) * DAY_LENGTH -
|
||||
(u16)(((void)0, gSaveContext.save.time) - CLOCK_TIME(6, 0));
|
||||
if (timeBeforeMoonCrash < CLOCK_TIME_F(1, 0)) {
|
||||
this->textId = 0x5E8;
|
||||
} else {
|
||||
this->textId = 0x5EB;
|
||||
|
|
@ -207,7 +207,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case 4:
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10000;
|
||||
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
|
|
@ -235,7 +235,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case 5:
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10000;
|
||||
switch (globalCtx->msgCtx.currentTextId) {
|
||||
case 0x5DE:
|
||||
|
|
|
|||
|
|
@ -675,14 +675,14 @@ void func_808726DC(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* ar
|
|||
f32 temp_f26 = Math_Vec3f_DistXYZ(arg3, arg1);
|
||||
s32 spB0;
|
||||
f32 temp_f2;
|
||||
f32 sqrt;
|
||||
f32 distXZ;
|
||||
|
||||
Math_Vec3f_Copy(&ptr->unk_00, arg1);
|
||||
Math_Vec3f_Diff(arg2, arg1, &spCC);
|
||||
|
||||
ptr->unk_18 = Math_FAtan2F(spCC.z, spCC.x);
|
||||
sqrt = sqrtf(SQ(spCC.x) + SQ(spCC.z));
|
||||
ptr->unk_1A = Math_FAtan2F(sqrt, spCC.y);
|
||||
distXZ = sqrtf(SQXZ(spCC));
|
||||
ptr->unk_1A = Math_FAtan2F(distXZ, spCC.y);
|
||||
|
||||
spB0 = (arg4 / 240) + 1;
|
||||
|
||||
|
|
@ -721,8 +721,8 @@ void func_808726DC(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* ar
|
|||
}
|
||||
|
||||
ptr2->unk_18 = Math_FAtan2F(spCC.z, spCC.x);
|
||||
sqrt = sqrtf(SQ(spCC.x) + SQ(spCC.z));
|
||||
ptr2->unk_1A = Math_FAtan2F(sqrt, spCC.y);
|
||||
distXZ = sqrtf(SQXZ(spCC));
|
||||
ptr2->unk_1A = Math_FAtan2F(distXZ, spCC.y);
|
||||
|
||||
ptr2->unk_18 = (s16)CLAMP(BINANG_SUB(ptr2->unk_18, ptr->unk_18), -8000, 8000) + ptr->unk_18;
|
||||
ptr2->unk_1A = (s16)CLAMP(BINANG_SUB(ptr2->unk_1A, ptr->unk_1A), -8000, 8000) + ptr->unk_1A;
|
||||
|
|
|
|||
|
|
@ -656,7 +656,6 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
|
|||
0x0721, 0x0722, 0x0723, 0x0724, 0x072C,
|
||||
};
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 idx;
|
||||
|
||||
func_80C012E0(this);
|
||||
func_80C0113C(this, 21, 1.0f);
|
||||
|
|
@ -683,10 +682,8 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
idx = gSaveContext.save.bombersCaughtNum;
|
||||
Message_StartTextbox(globalCtx, D_80C03230[idx], &this->actor);
|
||||
idx = gSaveContext.save.bombersCaughtNum;
|
||||
gSaveContext.save.bombersCaughtOrder[idx] = this->unk_2C8 + 1;
|
||||
Message_StartTextbox(globalCtx, D_80C03230[((void)0, gSaveContext.save.bombersCaughtNum)], &this->actor);
|
||||
gSaveContext.save.bombersCaughtOrder[((void)0, gSaveContext.save.bombersCaughtNum)] = this->unk_2C8 + 1;
|
||||
gSaveContext.save.bombersCaughtNum++;
|
||||
|
||||
if (gSaveContext.save.bombersCaughtNum > 4) {
|
||||
|
|
|
|||
|
|
@ -177,14 +177,11 @@ void EnElfgrp_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
s32 func_80A39BD0(GlobalContext* globalCtx, s32 arg2) {
|
||||
s8 sp1F;
|
||||
|
||||
if ((arg2 < 1) || (arg2 >= 5)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sp1F = gSaveContext.save.inventory.strayFairies[arg2 - 1];
|
||||
return (sp1F - func_80A39C1C(globalCtx, arg2)) + 10;
|
||||
return (((void)0, gSaveContext.save.inventory.strayFairies[arg2 - 1]) - func_80A39C1C(globalCtx, arg2)) + 10;
|
||||
}
|
||||
|
||||
s32 func_80A39C1C(GlobalContext* globalCtx, s32 arg1) {
|
||||
|
|
|
|||
|
|
@ -1069,7 +1069,7 @@ void EnFishing_UpdateEffects(FishingEffect* effect, GlobalContext* globalCtx) {
|
|||
}
|
||||
} else if (effect->type == FS_EFF_RAIN_DROP) {
|
||||
if (effect->pos.y < WATER_SURFACE_Y(globalCtx)) {
|
||||
f32 sqDistXZ = SQ(effect->pos.x) + SQ(effect->pos.z);
|
||||
f32 sqDistXZ = SQXZ(effect->pos);
|
||||
|
||||
if (sqDistXZ > SQ(920.0f)) {
|
||||
effect->pos.y = WATER_SURFACE_Y(globalCtx) + ((sqrtf(sqDistXZ) - 920.0f) * 0.11f);
|
||||
|
|
@ -1106,7 +1106,7 @@ void EnFishing_UpdateEffects(FishingEffect* effect, GlobalContext* globalCtx) {
|
|||
Math_ApproachS(&sEffOwnerHatRot.x, 0, 20, 100);
|
||||
Math_ApproachS(&sEffOwnerHatRot.z, -0x4000, 20, 100);
|
||||
|
||||
sqDistXZ = SQ(effect->pos.x) + SQ(effect->pos.z);
|
||||
sqDistXZ = SQXZ(effect->pos);
|
||||
bottomY = WATER_SURFACE_Y(globalCtx) + ((sqrtf(sqDistXZ) - 920.0f) * 0.147f);
|
||||
|
||||
if (effect->pos.y > (bottomY - 10.0f)) {
|
||||
|
|
@ -5188,7 +5188,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
spFC.x = sLurePos.x - player->actor.world.pos.x;
|
||||
spFC.z = sLurePos.z - player->actor.world.pos.z;
|
||||
lureDistXZ = sqrtf(SQ(spFC.x) + SQ(spFC.z));
|
||||
lureDistXZ = sqrtf(SQXZ(spFC));
|
||||
Matrix_InsertYRotation_f(Math_Acot2F(spFC.z, spFC.x), MTXMODE_NEW);
|
||||
|
||||
sp114.x = 0.0f;
|
||||
|
|
|
|||
|
|
@ -713,15 +713,13 @@ void func_808D2040(EnFloormas* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_808D217C(EnFloormas* this, Player* player) {
|
||||
Vec3f* ptr;
|
||||
u8 playerForm;
|
||||
|
||||
Animation_Change(&this->skelAnime, &gWallmasterJumpAnim, 1.0f, 36.0f, 45.0f, ANIMMODE_ONCE, -3.0f);
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
func_808D08D0(this);
|
||||
playerForm = gSaveContext.save.playerForm;
|
||||
ptr = &D_808D3900[playerForm];
|
||||
ptr = &D_808D3900[(void)0, gSaveContext.save.playerForm];
|
||||
this->actor.home.pos.x = ptr->z * Math_SinS(this->actor.shape.rot.y);
|
||||
this->actor.home.pos.y = CLAMP(-this->actor.playerHeightRel, ptr->x, ptr->y);
|
||||
this->actor.home.pos.z = ptr->z * Math_CosS(this->actor.shape.rot.y);
|
||||
|
|
|
|||
|
|
@ -652,9 +652,8 @@ void func_80962A10(EnFu* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && gSaveContext.save.playerData.magicAcquired) {
|
||||
s16 temp = gSaveContext.unk_3F30;
|
||||
|
||||
Parameter_AddMagic(globalCtx, temp + (gSaveContext.save.playerData.doubleMagic * 48) + 48);
|
||||
Parameter_AddMagic(globalCtx,
|
||||
((void)0, gSaveContext.unk_3F30) + (gSaveContext.save.playerData.doubleMagic * 48) + 48);
|
||||
}
|
||||
|
||||
func_80962F10(this);
|
||||
|
|
|
|||
|
|
@ -741,7 +741,7 @@ void func_80B51B40(EnGk* this, GlobalContext* globalCtx) {
|
|||
this->unk_1E4 |= 2;
|
||||
}
|
||||
}
|
||||
} else if ((temp_v0 == 4) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
} else if ((temp_v0 == 4) && Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
func_8019F208();
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ void func_80ABB590(EnGuardNuts* this, GlobalContext* globalCtx) {
|
|||
if ((this->guardTextIndex == 3) && (this->animIndex == WAIT_HEAD_TILT_ANIM)) {
|
||||
EnGuardNuts_ChangeAnim(this, WAIT_HEAD_TILT_ANIM);
|
||||
}
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
if (D_80ABBE38[this->guardTextIndex] != 1) {
|
||||
if (D_80ABBE38[this->guardTextIndex] == 2) {
|
||||
func_801477B4(globalCtx);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && (Message_ShouldAdvance(globalCtx))) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
this->headZRotTarget = 0;
|
||||
if ((this->textIdIndex == 13) || (this->textIdIndex == 14)) {
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, GlobalContext* globalCtx) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x40000;
|
||||
gSaveContext.unk_3DD0[4] = 6;
|
||||
SET_RACE_FLAGS(RACE_FLAG_4)
|
||||
SET_RACE_FLAGS(RACE_FLAG_4);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, GlobalContext* globalCtx) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x40000;
|
||||
gSaveContext.unk_3DD0[4] = 6;
|
||||
SET_RACE_FLAGS(RACE_FLAG_3)
|
||||
SET_RACE_FLAGS(RACE_FLAG_3);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, GlobalContext* globalCtx) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x02000000;
|
||||
gSaveContext.unk_3DD0[4] = 6;
|
||||
SET_RACE_FLAGS(RACE_FLAG_3)
|
||||
SET_RACE_FLAGS(RACE_FLAG_3);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ s32 func_808F8FAC(EnHorseGameCheck* this, GlobalContext* globalCtx) {
|
|||
play_sound(NA_SE_SY_START_SHOT);
|
||||
this->unk_164 |= 0x800;
|
||||
gSaveContext.unk_3DD0[4] = 6;
|
||||
SET_RACE_FLAGS(RACE_FLAG_2)
|
||||
SET_RACE_FLAGS(RACE_FLAG_2);
|
||||
this->unk_174 = 60;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ enum {
|
|||
gSaveContext.save.weekEventReg[92] &= (u8)~RACE_FLAGS; \
|
||||
gSaveContext.save.weekEventReg[92] = \
|
||||
gSaveContext.save.weekEventReg[92] | (u8)((gSaveContext.save.weekEventReg[92] & ~RACE_FLAGS) | (flag)); \
|
||||
}
|
||||
} (void)0
|
||||
|
||||
typedef struct EnHorseGameCheck {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
|
|
|
|||
|
|
@ -874,9 +874,7 @@ s32 func_80B44234(EnInvadepoh* this, Vec3f* vec) {
|
|||
}
|
||||
|
||||
void func_80B442E4(EnInvadepoh* this) {
|
||||
s32 pad;
|
||||
s32 sp18 = gSaveContext.save.time;
|
||||
s32 temp_v1_2 = sp18 - func_80B43A24(this->actor.params & 7);
|
||||
s32 temp_v1_2 = ((void)0, (s32)gSaveContext.save.time) - func_80B43A24(this->actor.params & 7);
|
||||
|
||||
if (D_80B4E940 == 1) {
|
||||
this->clockTime = 0.0f;
|
||||
|
|
@ -1001,6 +999,7 @@ void func_80B44700(EnInvadepoh* this) {
|
|||
this->clockTime = 1.0f;
|
||||
} else {
|
||||
f32 new_var = 0.00153374229558f;
|
||||
|
||||
this->clockTime = (currentTime + new_var4) * new_var;
|
||||
this->clockTime = CLAMP(this->clockTime, 0.0f, 1.0f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ void EnJg_GoronShrineIdle(EnJg* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnJg_GoronShrineTalk(EnJg* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && (Message_ShouldAdvance(globalCtx))) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
if ((this->textId == 0xDCC) || (this->textId == 0xDDD) || (this->textId == 0xDE0)) {
|
||||
// There is nothing more to say after these lines, so end the current conversation.
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
|
|
@ -425,7 +425,7 @@ void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, GlobalContext* globalCtx) {
|
|||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
|
||||
}
|
||||
} else if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_LOOP) {
|
||||
if ((messageState == 5) && (Message_ShouldAdvance(globalCtx))) {
|
||||
if ((messageState == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
globalCtx->msgCtx.unk12023 = 4;
|
||||
this->flags &= ~FLAG_LOOKING_AT_PLAYER;
|
||||
|
|
@ -480,7 +480,7 @@ void EnJg_Talk(EnJg* this, GlobalContext* globalCtx) {
|
|||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
|
||||
}
|
||||
|
||||
if ((messageState == 5) && (Message_ShouldAdvance(globalCtx))) {
|
||||
if ((messageState == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
temp = this->textId;
|
||||
if ((temp == 0xDB4) || (temp == 0xDB5) || (temp == 0xDC4) || (temp == 0xDC6)) {
|
||||
// There is nothing more to say after these lines, so end the current conversation.
|
||||
|
|
@ -600,7 +600,7 @@ void EnJg_FrozenIdle(EnJg* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnJg_EndFrozenInteraction(EnJg* this, GlobalContext* globalCtx) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 6 && Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 6 && Message_ShouldAdvance(globalCtx)) {
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
globalCtx->msgCtx.unk12023 = 4;
|
||||
this->actionFunc = EnJg_FrozenIdle;
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) {
|
|||
this->unkState1A8 = 0;
|
||||
}
|
||||
|
||||
if (this->unkMsgState1AC == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if ((this->unkMsgState1AC == Message_GetState(&globalCtx->msgCtx)) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
if (this->unkMsgState1AC == 5) {
|
||||
// bad song input
|
||||
|
|
@ -560,7 +560,7 @@ void EnKakasi_SetupSongTeach(EnKakasi* this, GlobalContext* globalCtx) {
|
|||
* before actually teaching
|
||||
*/
|
||||
void EnKakasi_OcarinaRemark(EnKakasi* this, GlobalContext* globalCtx) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 5 && Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_80152434(globalCtx, 0x35);
|
||||
this->unkState1A8 = 0;
|
||||
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
|
||||
|
|
@ -734,8 +734,8 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, GlobalContext* globalCtx) {
|
|||
|
||||
func_8096FAAC(this, globalCtx);
|
||||
|
||||
if (this->unkState1A8 != 0 && Message_GetState(&globalCtx->msgCtx) == this->unkMsgState1AC &&
|
||||
Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if ((this->unkState1A8 != 0) && (Message_GetState(&globalCtx->msgCtx) == this->unkMsgState1AC) &&
|
||||
Message_ShouldAdvance(globalCtx)) {
|
||||
|
||||
func_801477B4(globalCtx);
|
||||
|
||||
|
|
@ -1101,7 +1101,7 @@ void EnKakasi_IdleRisen(EnKakasi* this, GlobalContext* globalCtx) {
|
|||
void EnKakasi_RisenDialogue(EnKakasi* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 1000, 0);
|
||||
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 5 && Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
EnKakasi_SetupIdleRisen(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
f32 shadowAlpha;
|
||||
|
||||
if (dayTime >= CLOCK_TIME(12, 0)) {
|
||||
dayTime = 0xFFFF - dayTime;
|
||||
dayTime = (DAY_LENGTH - 1) - dayTime;
|
||||
}
|
||||
|
||||
shadowAlpha = (dayTime * 0.00275f) + 10.0f;
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ void EnMa4_Wait(EnMa4* this, GlobalContext* globalCtx) {
|
|||
|
||||
// Chooses the next dialogue based on player's selection
|
||||
void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (this->textId) {
|
||||
case 0x3339:
|
||||
if (globalCtx->msgCtx.choiceIndex == 0) {
|
||||
|
|
@ -491,7 +491,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 aux;
|
||||
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (this->textId) {
|
||||
case 0x2390:
|
||||
func_801477B4(globalCtx);
|
||||
|
|
@ -643,7 +643,7 @@ void EnMa4_DialogueHandler(EnMa4* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
|
||||
case 6: // End conversation
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
if ((globalCtx->msgCtx.unk120B1 == 0) || !CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
|
||||
EnMa4_SetupWait(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ void EnMaYts_DialogueHandler(EnMaYts* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
|
||||
case 6: // End conversation
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
EnMaYts_SetupStartDialogue(this);
|
||||
}
|
||||
break;
|
||||
|
|
@ -426,7 +426,7 @@ void EnMaYts_EndCreditsHandler(EnMaYts* this, GlobalContext* globalCtx) {
|
|||
|
||||
// Select the following dialogue based on the current one, and an appropiate face expression
|
||||
void EnMaYts_ChooseNextDialogue(EnMaYts* this, GlobalContext* globalCtx) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (this->textId) {
|
||||
case 0x335F:
|
||||
EnMaYts_SetFaceExpression(this, 0, 2);
|
||||
|
|
|
|||
|
|
@ -255,10 +255,9 @@ void EnMinifrog_SpawnDust(EnMinifrog* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
|
||||
u8 flag;
|
||||
|
||||
EnMinifrog_TurnToPlayer(this);
|
||||
EnMinifrog_Jump(this);
|
||||
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
EnMinifrog_SetJumpState(this);
|
||||
|
||||
|
|
@ -270,6 +269,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
|
|||
case 0xD87: // "Ah! You need not say a thing. Upon seeing that face, I understand!" ...
|
||||
func_80151938(globalCtx, globalCtx->msgCtx.currentTextId + 1);
|
||||
break;
|
||||
|
||||
case 0xD82: // "What has brought you all this way?"
|
||||
if (gSaveContext.save.weekEventReg[33] & 0x80) { // Mountain village is unfrozen
|
||||
func_80151938(globalCtx, 0xD83); // "Could it be... Has spring finally come to the mountains?"
|
||||
|
|
@ -277,10 +277,11 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
|
|||
func_80151938(globalCtx, 0xD86); // "Could it be... You came all this way looking for me?"
|
||||
}
|
||||
|
||||
flag = gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8];
|
||||
gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] =
|
||||
flag | (u8)isFrogReturnedFlags[this->frogIndex];
|
||||
((void)0, gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8]) |
|
||||
(u8)isFrogReturnedFlags[this->frogIndex];
|
||||
break;
|
||||
|
||||
case 0xD85: // "I understand. I shall head for the mountains immediately."
|
||||
default:
|
||||
func_801477B4(globalCtx);
|
||||
|
|
|
|||
|
|
@ -375,24 +375,17 @@ void func_80A6FBA0(EnMm3* this) {
|
|||
|
||||
void func_80A6FBFC(EnMm3* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
OSTime a;
|
||||
OSTime b;
|
||||
|
||||
if (gSaveContext.unk_3DD0[0] == 0x10) {
|
||||
player->stateFlags1 &= ~0x20;
|
||||
this->actor.flags |= ACTOR_FLAG_10000;
|
||||
if (gSaveContext.unk_3DE0[0] >= 0x5DD) {
|
||||
gSaveContext.unk_3DE0[0] = 0x5DC;
|
||||
} else {
|
||||
a = gSaveContext.unk_3DE0[0];
|
||||
if (a >= (OSTime)(995 - XREG(16))) {
|
||||
b = gSaveContext.unk_3DE0[0];
|
||||
if ((OSTime)(XREG(17) + 1005) >= b) {
|
||||
gSaveContext.unk_3DE0[0] = 1000;
|
||||
}
|
||||
}
|
||||
if (gSaveContext.unk_3DE0[0] > 1500) {
|
||||
gSaveContext.unk_3DE0[0] = 1500;
|
||||
} else if ((((void)0, gSaveContext.unk_3DE0[0]) >= (OSTime)(995 - XREG(16))) &&
|
||||
(((void)0, gSaveContext.unk_3DE0[0]) <= (OSTime)(1005 + XREG(17)))) {
|
||||
gSaveContext.unk_3DE0[0] = 1000;
|
||||
}
|
||||
} else if (gSaveContext.unk_3DE0[0] >= 0x5DD) {
|
||||
} else if (gSaveContext.unk_3DE0[0] > 1500) {
|
||||
gSaveContext.unk_3DD0[0] = 15;
|
||||
gSaveContext.unk_3DC8 = osGetTime();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,13 +99,13 @@ void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) {
|
|||
void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
|
||||
switch (Message_GetState(&globalCtx->msgCtx)) {
|
||||
case 6:
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
this->actionFunc = EnMs_Wait;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
Actor_PickUp(&this->actor, globalCtx, GI_MAGIC_BEANS, this->actor.xzDistToPlayer,
|
||||
this->actor.playerHeightRel);
|
||||
|
|
@ -114,7 +114,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
|
||||
case 4:
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0: // yes
|
||||
func_801477B4(globalCtx);
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, GlobalContext* globalCtx) {
|
|||
* responded to the Goron Elder's son's question.
|
||||
*/
|
||||
void EnMttag_HandleCantWinChoice(EnMttag* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 4) && (Message_ShouldAdvance(globalCtx))) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 4) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (globalCtx->msgCtx.choiceIndex != 0) {
|
||||
// Exit the race
|
||||
func_8019F230();
|
||||
|
|
|
|||
|
|
@ -133,11 +133,14 @@ void EnMuto_Idle(EnMuto* this, GlobalContext* globalCtx) {
|
|||
Player* player;
|
||||
this->actor.textId = sTextIds[this->textIdIndex];
|
||||
|
||||
if (!this->isInMayorsRoom && (player = GET_PLAYER(globalCtx))->transformation == PLAYER_FORM_DEKU) {
|
||||
if (!(gSaveContext.save.weekEventReg[88] & 8)) {
|
||||
this->actor.textId = 0x62C;
|
||||
} else {
|
||||
this->actor.textId = 0x62B;
|
||||
if (!this->isInMayorsRoom) {
|
||||
player = GET_PLAYER(globalCtx);
|
||||
if (player->transformation == PLAYER_FORM_DEKU) {
|
||||
if (!(gSaveContext.save.weekEventReg[88] & 8)) {
|
||||
this->actor.textId = 0x62C;
|
||||
} else {
|
||||
this->actor.textId = 0x62B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1105,12 +1105,11 @@ void func_80AF8AC8(EnPm* this) {
|
|||
|
||||
void func_80AF8BA8(s32 arg0) {
|
||||
static u16 D_80AFB8D4[] = {
|
||||
0x1B02, 0x1B04, 0x1B08, 0x1B10, 0x1B20, 0x0000,
|
||||
0x1B02, 0x1B04, 0x1B08, 0x1B10, 0x1B20,
|
||||
};
|
||||
static u16 D_80AFB8E0[] = {
|
||||
0x1B40, 0x1B80, 0x1C01, 0x1C02, 0x1C04, 0x0000,
|
||||
0x1B40, 0x1B80, 0x1C01, 0x1C02, 0x1C04,
|
||||
};
|
||||
s32 temp;
|
||||
|
||||
if (!(gSaveContext.save.weekEventReg[88] & 2)) {
|
||||
if (gSaveContext.save.weekEventReg[D_80AFB8D4[arg0] >> 8] &
|
||||
|
|
@ -1129,9 +1128,8 @@ void func_80AF8BA8(s32 arg0) {
|
|||
}
|
||||
}
|
||||
|
||||
temp = gSaveContext.save.weekEventReg[D_80AFB8E0[arg0] >> 8];
|
||||
gSaveContext.save.weekEventReg[D_80AFB8E0[arg0] >> 8] =
|
||||
temp | (D_80AFB8E0[arg0] & (1 | 2 | 4 | 0x38 | 0x40 | 0x80));
|
||||
((void)0, gSaveContext.save.weekEventReg[D_80AFB8E0[arg0] >> 8]) | (u8)D_80AFB8E0[arg0];
|
||||
}
|
||||
|
||||
void func_80AF8C68(EnPm* this, GlobalContext* globalCtx) {
|
||||
|
|
@ -1990,9 +1988,8 @@ void func_80AFA4D0(EnPm* this, GlobalContext* globalCtx) {
|
|||
u16 time = gSaveContext.save.time;
|
||||
u16 sp3C = 0;
|
||||
ScheduleResult sp2C;
|
||||
u32* unk_14 = &gSaveContext.save.daySpeed;
|
||||
|
||||
this->unk_374 = REG(15) + *unk_14;
|
||||
this->unk_374 = REG(15) + ((void)0, gSaveContext.save.daySpeed);
|
||||
if (this->unk_38C != 0) {
|
||||
time = gSaveContext.save.time - D_801F4E78;
|
||||
sp3C = gSaveContext.save.time;
|
||||
|
|
|
|||
|
|
@ -312,9 +312,8 @@ void func_80A76748(EnPrz* this) {
|
|||
void func_80A767A8(EnPrz* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
EnPr* pr = (EnPr*)this->actor.parent;
|
||||
f32 sqrt;
|
||||
f32 distXZ;
|
||||
s32 pad[2];
|
||||
u8 playerForm;
|
||||
|
||||
if (func_80A762C0(this, globalCtx)) {
|
||||
func_80A75F18(this, 0);
|
||||
|
|
@ -323,10 +322,10 @@ void func_80A767A8(EnPrz* this, GlobalContext* globalCtx) {
|
|||
return;
|
||||
}
|
||||
|
||||
sqrt = sqrtf(SQ(player->actor.world.pos.x - this->actor.parent->home.pos.x) +
|
||||
SQ(player->actor.world.pos.z - this->actor.parent->home.pos.z));
|
||||
distXZ = sqrtf(SQ(player->actor.world.pos.x - this->actor.parent->home.pos.x) +
|
||||
SQ(player->actor.world.pos.z - this->actor.parent->home.pos.z));
|
||||
|
||||
if (!(player->stateFlags1 & 0x8000000) || (pr->unk_2C8 < sqrt)) {
|
||||
if (!(player->stateFlags1 & 0x8000000) || (pr->unk_2C8 < distXZ)) {
|
||||
this->unk_1F2 = 100;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
func_80A76388(this);
|
||||
|
|
@ -354,9 +353,8 @@ void func_80A767A8(EnPrz* this, GlobalContext* globalCtx) {
|
|||
this->unk_1C8 = 1;
|
||||
}
|
||||
|
||||
playerForm = gSaveContext.save.playerForm;
|
||||
this->unk_1D8.y =
|
||||
(player->actor.world.pos.y + D_80A771E0[playerForm]) + randPlusMinusPoint5Scaled((2.0f * this->unk_1E6) + 1.0f);
|
||||
this->unk_1D8.y = (player->actor.world.pos.y + D_80A771E0[((void)0, gSaveContext.save.playerForm)]) +
|
||||
randPlusMinusPoint5Scaled((2.0f * this->unk_1E6) + 1.0f);
|
||||
func_80A76070(this, Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_1D8), globalCtx);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ void EnRecepgirl_SetupTalk(EnRecepgirl* this) {
|
|||
}
|
||||
|
||||
void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) {
|
||||
u8 temp_v0_2;
|
||||
u8 talkState;
|
||||
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (this->skelAnime.animation == &object_bg_Anim_00A280) {
|
||||
|
|
@ -140,11 +140,11 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
temp_v0_2 = Message_GetState(&globalCtx->msgCtx);
|
||||
if (temp_v0_2 == 2) {
|
||||
talkState = Message_GetState(&globalCtx->msgCtx);
|
||||
if (talkState == 2) {
|
||||
this->actor.textId = 0x2ADC; // hear directions again?
|
||||
EnRecepgirl_SetupWait(this);
|
||||
} else if ((temp_v0_2 == 5) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
} else if ((talkState == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (this->actor.textId == 0x2AD9) { // "Welcome..."
|
||||
Flags_SetSwitch(globalCtx, this->actor.params);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ void func_80BCB6D0(EnScopenuts* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
} else if (temp_v0 == 4) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
if (gSaveContext.save.playerData.rupees < this->unk_358) {
|
||||
|
|
|
|||
|
|
@ -607,8 +607,8 @@ void EnSob1_Hello(EnSob1* this, GlobalContext* globalCtx) {
|
|||
ActorCutscene_SetIntentToPlay(this->cutscene);
|
||||
}
|
||||
}
|
||||
if ((talkState == 5) && (Message_ShouldAdvance(globalCtx)) &&
|
||||
(!EnSob1_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx)))) {
|
||||
if ((talkState == 5) && Message_ShouldAdvance(globalCtx) &&
|
||||
!EnSob1_TestEndInteraction(this, globalCtx, CONTROLLER1(globalCtx))) {
|
||||
if (this->welcomeTextId == 0x68A) { // Welcome text when wearing Kafei's mask
|
||||
EnSob1_EndInteraction(globalCtx, this);
|
||||
} else {
|
||||
|
|
@ -1084,7 +1084,7 @@ void EnSob1_ContinueShopping(EnSob1* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
EnGirlA* item;
|
||||
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && (Message_ShouldAdvance(globalCtx))) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
EnSob1_ResetItemPosition(this);
|
||||
item = this->items[this->cursorIdx];
|
||||
item->restockFunc(globalCtx, item);
|
||||
|
|
|
|||
|
|
@ -227,12 +227,8 @@ void EnSuttari_SetNextEntrance(GlobalContext* globalCtx, u16 nextEntranceIndex)
|
|||
}
|
||||
|
||||
void EnSuttari_UpdateTime(void) {
|
||||
u32* unk_14 = &gSaveContext.save.daySpeed;
|
||||
u16 time = gSaveContext.save.time;
|
||||
|
||||
gSaveContext.save.time = (u16)REG(15) + time;
|
||||
time = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)*unk_14 + time;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
|
||||
s32 func_80BAA904(EnSuttari* this, GlobalContext* globalCtx) {
|
||||
|
|
|
|||
|
|
@ -885,38 +885,33 @@ void func_808DA89C(EnSw* this, GlobalContext* globalCtx) {
|
|||
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_BLUE_FIRE;
|
||||
func_808D8ED0(this, globalCtx);
|
||||
}
|
||||
return;
|
||||
if (1) {}
|
||||
}
|
||||
|
||||
if (ENSW_GET_3(&this->actor)) {
|
||||
} else if (ENSW_GET_3(&this->actor)) {
|
||||
this->actionFunc = func_808DAEB4;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
f32 temp_f2;
|
||||
|
||||
this->actor.shape.yOffset = 400.0f;
|
||||
temp_f2 = fabsf(this->actor.velocity.y) * 0.6f;
|
||||
this->actor.velocity.y = temp_f2;
|
||||
this->unk_448 = temp_f2;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
if ((s32)temp_f2 != 0) {
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND);
|
||||
} else {
|
||||
this->actionFunc = func_808DAEB4;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
if ((s32)this->actor.velocity.y >= 2) {
|
||||
func_808D8940(this, globalCtx);
|
||||
}
|
||||
} else {
|
||||
Math_ApproachF(&this->actor.shape.yOffset, 400.0f, 0.3f, 1000.0f);
|
||||
}
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
f32 temp_f2;
|
||||
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
|
||||
this->actor.shape.yOffset = 400.0f;
|
||||
temp_f2 = fabsf(this->actor.velocity.y) * 0.6f;
|
||||
this->actor.velocity.y = temp_f2;
|
||||
this->unk_448 = temp_f2;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
if ((s32)temp_f2 != 0) {
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND);
|
||||
} else {
|
||||
this->actionFunc = func_808DAEB4;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
}
|
||||
if ((s32)this->actor.velocity.y >= 2) {
|
||||
func_808D8940(this, globalCtx);
|
||||
}
|
||||
} else {
|
||||
Math_ApproachF(&this->actor.shape.yOffset, 400.0f, 0.3f, 1000.0f);
|
||||
}
|
||||
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
|
||||
}
|
||||
}
|
||||
|
||||
void func_808DAA60(EnSw* this, GlobalContext* globalCtx) {
|
||||
|
|
|
|||
|
|
@ -1097,26 +1097,19 @@ void func_809C898C(EnSyatekiMan* this, GlobalContext* globalCtx) {
|
|||
};
|
||||
static s32 D_809C94A8 = 0;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 sp30;
|
||||
s32 pad;
|
||||
u64 sp20;
|
||||
|
||||
sp20 = gSaveContext.unk_3DE0[1];
|
||||
sp30 = (sp20 * 0.1f) + 1.0f;
|
||||
s32 sp30 = (((void)0, gSaveContext.unk_3DE0[1]) * 0.1f) + 1.0f;
|
||||
|
||||
if (sp30 < 0x2EF) {
|
||||
s32 temp;
|
||||
|
||||
// clang-format off
|
||||
if (D_809C94A8 == 0) {
|
||||
sp20 = gSaveContext.unk_3DE0[1]; temp = sp20 % 0x1F4;
|
||||
temp = ((void)0, gSaveContext.unk_3DE0[1]) % 500;
|
||||
} else {
|
||||
sp20 = gSaveContext.unk_3DE0[1]; temp = (sp20 + 250) % 0x1F4;
|
||||
temp = (((void)0, gSaveContext.unk_3DE0[1]) + 250) % 500;
|
||||
}
|
||||
//clang-format on
|
||||
|
||||
if (temp < 100) {
|
||||
this->unk_26C = 0x50;
|
||||
this->unk_26C = 80;
|
||||
}
|
||||
|
||||
if (this->unk_26E != 0) {
|
||||
|
|
@ -1292,7 +1285,7 @@ void EnSyatekiMan_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex]));
|
||||
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnSyatekiMan_OverrideLimbDraw, EnSyatekiMan_PostLimbDraw, &this->actor);
|
||||
EnSyatekiMan_OverrideLimbDraw, EnSyatekiMan_PostLimbDraw, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -482,18 +482,15 @@ void func_80967608(EnWeatherTag* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnWeatherTag* this = THIS;
|
||||
u16 oldTime;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.msgMode != 0) &&
|
||||
(globalCtx->msgCtx.currentTextId == 0x5E6) && (!FrameAdvance_IsEnabled(&globalCtx->state)) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (ActorCutscene_GetCurrentIndex() == -1) && (globalCtx->csCtx.state == 0)) {
|
||||
|
||||
oldTime = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)REG(0xF) + oldTime; // cast req
|
||||
if (REG(0xF) != 0) {
|
||||
oldTime = gSaveContext.save.time;
|
||||
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + oldTime;
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)REG(15);
|
||||
if (REG(15) != 0) {
|
||||
gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)((void)0, gSaveContext.save.daySpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ void EnYb_Talk(EnYb* this, GlobalContext* globalCtx) {
|
|||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
EnYb_UpdateAnimation(this, globalCtx);
|
||||
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 5 && Message_ShouldAdvance(globalCtx) != 0) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.currentTextId) {
|
||||
case 0x147D: // I am counting on you
|
||||
func_801477B4(globalCtx);
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ void MirRay3_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 i;
|
||||
f32 temp;
|
||||
u16 phi_a0;
|
||||
u16 time;
|
||||
|
||||
if (!(this->unk_210 & 1) && func_8012405C(globalCtx)) {
|
||||
Matrix_InsertMatrix(&player->shieldMf, MTXMODE_NEW);
|
||||
|
|
@ -369,13 +369,13 @@ void MirRay3_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if (MIRRAY3_GET_F(&this->actor) == MIRRAY3_F_1) {
|
||||
phi_a0 = gSaveContext.save.time;
|
||||
time = gSaveContext.save.time;
|
||||
|
||||
if (phi_a0 > CLOCK_TIME(12, 0)) {
|
||||
phi_a0 = 0xFFFF - phi_a0;
|
||||
if (time > CLOCK_TIME(12, 0)) {
|
||||
time = (DAY_LENGTH - 1) - time;
|
||||
}
|
||||
|
||||
temp = (phi_a0 * (1.0f / 0x8000));
|
||||
temp = (time * (1.0f / 0x8000));
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x78, 255, 255, 255, (u8)(s8)(100 * this->unk_214));
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 218, 225, (u8)((100.0f * temp) + 105.0f), 255);
|
||||
|
|
|
|||
|
|
@ -290,7 +290,6 @@ void ObjChan_InitPot(ObjChan* this, GlobalContext* globalCtx) {
|
|||
|
||||
void ObjChan_PotAction(ObjChan* this, GlobalContext* globalCtx) {
|
||||
s32 potBreaks;
|
||||
s16 temp_v0_2;
|
||||
s32 phi_v1;
|
||||
|
||||
potBreaks = false;
|
||||
|
|
@ -311,9 +310,8 @@ void ObjChan_PotAction(ObjChan* this, GlobalContext* globalCtx) {
|
|||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_CHANDELIER_BROKEN);
|
||||
func_80BB9A1C((ObjChan*)this->actor.parent, 40.0f);
|
||||
if (this->myPotIndex == 4) {
|
||||
temp_v0_2 = gSaveContext.save.weekEventReg[0x25];
|
||||
if (!(temp_v0_2 & 0x10)) {
|
||||
gSaveContext.save.weekEventReg[0x25] = temp_v0_2 | 0x10;
|
||||
if (!(((void)0, gSaveContext.save.weekEventReg[0x25]) & 0x10)) {
|
||||
gSaveContext.save.weekEventReg[0x25] = ((void)0, gSaveContext.save.weekEventReg[0x25]) | 0x10;
|
||||
Actor_SpawnAsChildAndCutscene(&globalCtx->actorCtx, globalCtx, ACTOR_EN_MM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x8000,
|
||||
this->actor.cutscene, this->actor.unk20, NULL);
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void ObjWarpstone_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (this->isTalking) {
|
||||
if (Actor_TextboxIsClosing(&this->dyna.actor, globalCtx)) {
|
||||
this->isTalking = false;
|
||||
} else if ((Message_GetState(&globalCtx->msgCtx) == 4) && (Message_ShouldAdvance(globalCtx))) {
|
||||
} else if ((Message_GetState(&globalCtx->msgCtx) == 4) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (globalCtx->msgCtx.choiceIndex != 0) {
|
||||
func_8019F208();
|
||||
globalCtx->msgCtx.msgMode = 0x4D;
|
||||
|
|
|
|||
Loading…
Reference in New Issue