diff --git a/soh/soh/Enhancements/randomizer.cpp b/soh/soh/Enhancements/randomizer.cpp index 4c62de44f..bfeb469d3 100644 --- a/soh/soh/Enhancements/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer.cpp @@ -1054,6 +1054,41 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act case 93: return BARINADE; } + case 20: + switch (actorId) { + case 95: + return FOREST_TEMPLE_PHANTOM_GANON_HEART; + case 93: + return PHANTOM_GANON; + } + case 21: + switch (actorId) { + case 95: + return FIRE_TEMPLE_VOLVAGIA_HEART; + case 93: + return VOLVAGIA; + } + case 22: + switch (actorId) { + case 95: + return WATER_TEMPLE_MORPHA_HEART; + case 93: + return MORPHA; + } + case 23: + switch (actorId) { + case 95: + return SPIRIT_TEMPLE_TWINROVA_HEART; + case 93: + return TWINROVA; + } + case 24: + switch (actorId) { + case 95: + return SHADOW_TEMPLE_BONGO_BONGO_HEART; + case 93: + return BONGO_BONGO; + } case 40: switch(actorParams) { case 22944: @@ -1445,4 +1480,4 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 sceneNum, s16 actorId, s16 act } return UNKNOWN_CHECK; -} \ No newline at end of file +} diff --git a/soh/src/code/z_draw.c b/soh/src/code/z_draw.c index 1b67d9e71..499a4ed4f 100644 --- a/soh/src/code/z_draw.c +++ b/soh/src/code/z_draw.c @@ -105,6 +105,10 @@ void GetItem_DrawSmallRupee(GlobalContext* globalCtx, s16 drawId); void GetItem_DrawScale(GlobalContext* globalCtx, s16 drawId); void GetItem_DrawBulletBag(GlobalContext* globalCtx, s16 drawId); void GetItem_DrawWallet(GlobalContext* globalCtx, s16 drawId); +void GetItem_DrawJewel(GlobalContext* globalCtx, s16 drawId); +void GetItem_DrawJewelKokiri(GlobalContext* globalCtx, s16 drawId); +void GetItem_DrawJewelGoron(GlobalContext* globalCtx, s16 drawId); +void GetItem_DrawJewelZora(GlobalContext* globalCtx, s16 drawId); typedef struct { /* 0x00 */ void (*drawFunc)(GlobalContext*, s16); @@ -368,11 +372,9 @@ DrawItemTableEntry sDrawItemTable[] = { // gold skulltula token, OBJECT_ST { GetItem_DrawSkullToken, { object_st_DL_004DB0, object_st_DL_004EB8 } }, - { GetItem_DrawOpa0Xlu1, { gGiKokiriEmeraldGemDL, gGiKokiriEmeraldSettingDL } }, - // fire medallion, OBJECT_GI_MEDAL - { GetItem_DrawOpa0Xlu1, { gGiGoronRubySettingDL, gGiGoronRubyGemDL } }, - // water medallion, OBJECT_GI_MEDAL - { GetItem_DrawOpa0Xlu1, { gGiZoraSapphireSettingDL, gGiZoraSapphireGemDL, } }, + { GetItem_DrawJewelKokiri, { gGiKokiriEmeraldGemDL, gGiKokiriEmeraldSettingDL } }, + { GetItem_DrawJewelGoron, { gGiGoronRubyGemDL, gGiGoronRubySettingDL } }, + { GetItem_DrawJewelZora, { gGiZoraSapphireGemDL, gGiZoraSapphireSettingDL } }, }; /** @@ -385,6 +387,96 @@ void GetItem_Draw(GlobalContext* globalCtx, s16 drawId) { // All remaining functions in this file are draw functions referenced in the table and called by the function above +/* 0x0178 */ u8 primXluColor[3]; +/* 0x017B */ u8 envXluColor[3]; +/* 0x017E */ u8 primOpaColor[3]; +/* 0x0181 */ u8 envOpaColor[3]; + +void GetItem_DrawJewelKokiri(GlobalContext* globalCtx, s16 drawId) { + primXluColor[2] = 160; + primXluColor[0] = 255; + primXluColor[1] = 255; + envXluColor[0] = 0; + envXluColor[1] = 255; + envXluColor[2] = 0; + primOpaColor[2] = 170; + primOpaColor[0] = 255; + primOpaColor[1] = 255; + envOpaColor[1] = 120; + envOpaColor[0] = 150; + envOpaColor[2] = 0; + + GetItem_DrawJewel(globalCtx, drawId); +} + +void GetItem_DrawJewelGoron(GlobalContext* globalCtx, s16 drawId) { + primXluColor[1] = 170; + primXluColor[0] = 255; + primXluColor[2] = 255; + envXluColor[2] = 100; + envXluColor[0] = 255; + envXluColor[1] = 0; + primOpaColor[2] = 170; + primOpaColor[0] = 255; + primOpaColor[1] = 255; + envOpaColor[1] = 120; + envOpaColor[0] = 150; + envOpaColor[2] = 0; + + GetItem_DrawJewel(globalCtx, drawId); +} + +void GetItem_DrawJewelZora(GlobalContext* globalCtx, s16 drawId) { + primXluColor[0] = 50; + primXluColor[1] = 255; + primXluColor[2] = 255; + envXluColor[2] = 150; + envXluColor[0] = 50; + envXluColor[1] = 0; + primOpaColor[2] = 170; + primOpaColor[0] = 255; + primOpaColor[1] = 255; + envOpaColor[1] = 120; + envOpaColor[0] = 150; + envOpaColor[2] = 0; + + GetItem_DrawJewel(globalCtx, drawId); +} + +void GetItem_DrawJewel(GlobalContext* globalCtx, s16 drawId) { + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2543); + + gSPSegment(POLY_XLU_DISP++, 9, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 % 256, (256 - (0 % 256)) - 1, 64, 64, 1, 0 % 256, + (256 - (0 % 256)) - 1, 16, 16)); + + gSPSegment(POLY_OPA_DISP++, 8, Gfx_TexScroll(globalCtx->state.gfxCtx, (u8)0, (u8)0, 16, 16)); + + Matrix_Push(); + Matrix_RotateZYX(0, -0x4000, 0x4000, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2597), + G_MTX_NOPUSH | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2599), + G_MTX_NOPUSH | G_MTX_LOAD); + + func_80093D84(globalCtx->state.gfxCtx); + + // func_8002ED80(&this->actor, globalCtx, 0); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, primXluColor[0], primXluColor[1], primXluColor[2], 255); + gDPSetEnvColor(POLY_XLU_DISP++, envXluColor[0], envXluColor[1], envXluColor[2], 255); + gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); + func_80093D18(globalCtx->state.gfxCtx); + // func_8002EBCC(&this->actor, globalCtx, 0); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 128, primOpaColor[0], primOpaColor[1], primOpaColor[2], 255); + gDPSetEnvColor(POLY_OPA_DISP++, envOpaColor[0], envOpaColor[1], envOpaColor[2], 255); + gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].dlists[1]); + + Matrix_Pop(); + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2620); +} + void GetItem_DrawMaskOrBombchu(GlobalContext* globalCtx, s16 drawId) { s32 pad; diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index fa4d06b05..c7f0d3980 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -225,10 +225,12 @@ void BossDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_BREAKWALL, -890.0f, -1523.76f, -3304.0f, 0, 0, 0, 0x6000); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, -690.0f, -1523.76f, -3304.0f, 0, 0, 0, 0); + /* for (i = 0; i < 2048; i++) { temp_v0 = i; temp_s1_3[temp_v0] = temp_s2[temp_v0]; } + */ } this->actor.flags &= ~ACTOR_FLAG_0; diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 2820c3658..004897e4f 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -463,19 +463,36 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) { u8 success = 0; -void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx) { +void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) { GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum); if (success && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) { - Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - OnePointCutscene_Init(globalCtx, 0x25E7, 999, &this->actor, MAIN_CAM); - func_8002DF54(globalCtx, &this->actor, 10); + if (adult) { + OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM); + func_8002DF54(globalCtx, &this->actor, 10); + player->unk_450.x = this->actor.world.pos.x; + player->unk_450.z = this->actor.world.pos.z; + this->unk_1B2 = 20; + DoorWarp1_SetupAction(this, func_8099A508); + } else { + if (ruto) { + this->rutoWarpState = WARP_BLUE_RUTO_STATE_ENTERED; + func_8002DF54(globalCtx, &this->actor, 10); + this->unk_1B2 = 1; + DoorWarp1_SetupAction(this, func_80999EE0); + } else { + Audio_PlaySoundGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + OnePointCutscene_Init(globalCtx, 0x25E7, 999, &this->actor, MAIN_CAM); + func_8002DF54(globalCtx, &this->actor, 10); - player->unk_450.x = this->actor.world.pos.x; - player->unk_450.z = this->actor.world.pos.z; - this->unk_1B2 = 1; - DoorWarp1_SetupAction(this, DoorWarp1_ChildWarpOut); + player->unk_450.x = this->actor.world.pos.x; + player->unk_450.z = this->actor.world.pos.z; + this->unk_1B2 = 1; + + DoorWarp1_SetupAction(this, DoorWarp1_ChildWarpOut); + } + } success = 0; } else if (!success) { @@ -492,7 +509,7 @@ void DoorWarp1_ChildWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) { player = GET_PLAYER(globalCtx); if (gSaveContext.n64ddFlag) { - GivePlayerRandoReward(this, player, globalCtx); + GivePlayerRandoReward(this, player, globalCtx, 0, 0); return; } @@ -583,6 +600,12 @@ void DoorWarp1_RutoWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); if (this->rutoWarpState != WARP_BLUE_RUTO_STATE_INITIAL && DoorWarp1_PlayerInRange(this, globalCtx)) { + + if (gSaveContext.n64ddFlag) { + GivePlayerRandoReward(this, GET_PLAYER(globalCtx), globalCtx, 1, 0); + return; + } + this->rutoWarpState = WARP_BLUE_RUTO_STATE_ENTERED; func_8002DF54(globalCtx, &this->actor, 10); this->unk_1B2 = 1; @@ -696,6 +719,11 @@ void DoorWarp1_AdultWarpIdle(DoorWarp1* this, GlobalContext* globalCtx) { if (DoorWarp1_PlayerInRange(this, globalCtx)) { player = GET_PLAYER(globalCtx); + if (gSaveContext.n64ddFlag) { + GivePlayerRandoReward(this, player, globalCtx, 0, 1); + return; + } + OnePointCutscene_Init(globalCtx, 0x25E8, 999, &this->actor, MAIN_CAM); func_8002DF54(globalCtx, &this->actor, 10); player->unk_450.x = this->actor.world.pos.x; @@ -753,10 +781,16 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_MORIBOSSROOM) { if (!(gSaveContext.eventChkInf[4] & 0x100)) { gSaveContext.eventChkInf[4] |= 0x100; - Item_Give(globalCtx, ITEM_MEDALLION_FOREST); - globalCtx->nextEntranceIndex = 0x6B; - gSaveContext.nextCutsceneIndex = 0; - gSaveContext.chamberCutsceneNum = CHAMBER_CS_FOREST; + + if (gSaveContext.n64ddFlag) { + globalCtx->nextEntranceIndex = 0x608; + gSaveContext.nextCutsceneIndex = 0; + } else { + Item_Give(globalCtx, ITEM_MEDALLION_FOREST); + globalCtx->nextEntranceIndex = 0x6B; + gSaveContext.nextCutsceneIndex = 0; + gSaveContext.chamberCutsceneNum = CHAMBER_CS_FOREST; + } } else { if (!LINK_IS_ADULT) { globalCtx->nextEntranceIndex = 0x600; @@ -768,9 +802,15 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) { } else if (globalCtx->sceneNum == SCENE_FIRE_BS) { if (!(gSaveContext.eventChkInf[4] & 0x200)) { gSaveContext.eventChkInf[4] |= 0x200; - Item_Give(globalCtx, ITEM_MEDALLION_FIRE); - globalCtx->nextEntranceIndex = 0xDB; - gSaveContext.nextCutsceneIndex = 0xFFF3; + + if (gSaveContext.n64ddFlag) { + globalCtx->nextEntranceIndex = 0x564; + gSaveContext.nextCutsceneIndex = 0; + } else { + Item_Give(globalCtx, ITEM_MEDALLION_FIRE); + globalCtx->nextEntranceIndex = 0xDB; + gSaveContext.nextCutsceneIndex = 0xFFF3; + } } else { if (!LINK_IS_ADULT) { globalCtx->nextEntranceIndex = 0x4F6; @@ -782,10 +822,16 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) { } else if (globalCtx->sceneNum == SCENE_MIZUSIN_BS) { if (!(gSaveContext.eventChkInf[4] & 0x400)) { gSaveContext.eventChkInf[4] |= 0x400; - Item_Give(globalCtx, ITEM_MEDALLION_WATER); - globalCtx->nextEntranceIndex = 0x6B; - gSaveContext.nextCutsceneIndex = 0; - gSaveContext.chamberCutsceneNum = CHAMBER_CS_WATER; + + if (gSaveContext.n64ddFlag) { + globalCtx->nextEntranceIndex = 0x60C; + gSaveContext.nextCutsceneIndex = 0; + } else { + Item_Give(globalCtx, ITEM_MEDALLION_WATER); + globalCtx->nextEntranceIndex = 0x6B; + gSaveContext.nextCutsceneIndex = 0; + gSaveContext.chamberCutsceneNum = CHAMBER_CS_WATER; + } } else { if (!LINK_IS_ADULT) { globalCtx->nextEntranceIndex = 0x604; @@ -796,10 +842,16 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) { } } else if (globalCtx->sceneNum == SCENE_JYASINBOSS) { if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { - Item_Give(globalCtx, ITEM_MEDALLION_SPIRIT); - globalCtx->nextEntranceIndex = 0x6B; - gSaveContext.nextCutsceneIndex = 0; - gSaveContext.chamberCutsceneNum = CHAMBER_CS_SPIRIT; + + if (gSaveContext.n64ddFlag) { + globalCtx->nextEntranceIndex = 0x610; + gSaveContext.nextCutsceneIndex = 0; + } else { + Item_Give(globalCtx, ITEM_MEDALLION_SPIRIT); + globalCtx->nextEntranceIndex = 0x6B; + gSaveContext.nextCutsceneIndex = 0; + gSaveContext.chamberCutsceneNum = CHAMBER_CS_SPIRIT; + } } else { if (!LINK_IS_ADULT) { globalCtx->nextEntranceIndex = 0x1F1; @@ -810,10 +862,15 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) { } } else if (globalCtx->sceneNum == SCENE_HAKADAN_BS) { if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) { - Item_Give(globalCtx, ITEM_MEDALLION_SHADOW); - globalCtx->nextEntranceIndex = 0x6B; - gSaveContext.nextCutsceneIndex = 0; - gSaveContext.chamberCutsceneNum = CHAMBER_CS_SHADOW; + if (gSaveContext.n64ddFlag) { + globalCtx->nextEntranceIndex = 0x580; + gSaveContext.nextCutsceneIndex = 0; + } else { + Item_Give(globalCtx, ITEM_MEDALLION_SHADOW); + globalCtx->nextEntranceIndex = 0x6B; + gSaveContext.nextCutsceneIndex = 0; + gSaveContext.chamberCutsceneNum = CHAMBER_CS_SHADOW; + } } else { if (!LINK_IS_ADULT) { globalCtx->nextEntranceIndex = 0x568; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 7e04bf38a..3830c90d5 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -627,9 +627,9 @@ static GetItemEntry sGetItemTable[] = { GET_ITEM(ITEM_MEDALLION_WATER, OBJECT_GI_MEDAL, GID_MEDALLION_WATER, 0x3D, 0x80, CHEST_ANIM_LONG), GET_ITEM(ITEM_MEDALLION_SHADOW, OBJECT_GI_MEDAL, GID_MEDALLION_SHADOW, 0x41, 0x80, CHEST_ANIM_LONG), GET_ITEM(ITEM_MEDALLION_SPIRIT, OBJECT_GI_MEDAL, GID_MEDALLION_SPIRIT, 0x3F, 0x80, CHEST_ANIM_LONG), - GET_ITEM(ITEM_KOKIRI_EMERALD, OBJECT_GI_COIN, GID_NCOIN_GREEN, 0x80, 0x80, CHEST_ANIM_LONG), - GET_ITEM(ITEM_GORON_RUBY, OBJECT_GI_COIN, GID_NCOIN_RED, 0x81, 0x80, CHEST_ANIM_LONG), - GET_ITEM(ITEM_ZORA_SAPPHIRE, OBJECT_GI_COIN, GID_NCOIN_BLUE, 0x82, 0x80, CHEST_ANIM_LONG), + GET_ITEM(ITEM_KOKIRI_EMERALD, OBJECT_GI_JEWEL, GID_KOKIRI_EMERALD, 0x80, 0x80, CHEST_ANIM_LONG), + GET_ITEM(ITEM_GORON_RUBY, OBJECT_GI_JEWEL, GID_GORON_RUBY, 0x81, 0x80, CHEST_ANIM_LONG), + GET_ITEM(ITEM_ZORA_SAPPHIRE, OBJECT_GI_JEWEL, GID_ZORA_SAPPHIRE, 0x82, 0x80, CHEST_ANIM_LONG), GET_ITEM_NONE, GET_ITEM_NONE, };