From 06aefb30f75f67eed05f891761c69e7c339a3a21 Mon Sep 17 00:00:00 2001 From: Archez Date: Sun, 15 Dec 2024 23:01:00 -0500 Subject: [PATCH] let-it-snow: Snow Golems (Skeleton override) (#4695) * Add Snow Golems (Skeleton override) * update snowball to use new snowball DL --- .../objects/custom_snowball/LightNoise.rgba32 | Bin 0 -> 4188 bytes .../objects/custom_snowball/mat_snowball_snow | 16 +++ .../custom/objects/custom_snowball/model.xml | 10 ++ .../custom/objects/custom_snowball/snowball | 10 ++ .../objects/custom_snowball/snowball_tri_0 | 47 +++++++ .../objects/custom_snowball/snowball_vtx_0 | 92 +++++++++++++ .../objects/custom_snowball/snowball_vtx_cull | 10 ++ soh/assets/soh_assets.h | 3 + soh/soh/Enhancements/Holiday/AGreenSpoon.cpp | 31 +++-- soh/soh/Enhancements/Holiday/Archez.cpp | 123 +++++++++++++++++ soh/soh/Enhancements/Holiday/Archez.h | 16 +++ soh/soh/Enhancements/Holiday/Caladius.cpp | 111 +++++++--------- soh/soh/Enhancements/Holiday/Caladius.h | 6 +- soh/soh/Enhancements/Holiday/Example.cpp | 2 +- soh/soh/Enhancements/Holiday/Fredomato.cpp | 56 ++++---- soh/soh/Enhancements/Holiday/Grimey.cpp | 29 ++-- soh/soh/Enhancements/Holiday/Holiday.hpp | 2 +- soh/soh/Enhancements/Holiday/ItsHeckinPat.cpp | 53 ++++---- soh/soh/Enhancements/Holiday/NotProxySaw.cpp | 125 ++++++++---------- soh/soh/Enhancements/Holiday/Pablo.cpp | 77 +++-------- soh/soh/Enhancements/Holiday/ProxySaw.cpp | 82 +++++------- soh/soh/Enhancements/Holiday/Rando.cpp | 10 +- soh/soh/Enhancements/Holiday/aMannus.cpp | 42 +++--- soh/soh/Enhancements/Holiday/lilDavid.cpp | 31 ++--- .../custom-collectible/CustomCollectible.cpp | 5 +- .../game-interactor/GameInteractor.h | 14 +- soh/soh/Enhancements/mods.cpp | 3 +- .../randomizer/option_descriptions.cpp | 6 +- soh/soh/OTRGlobals.cpp | 12 +- soh/soh/util.cpp | 3 +- soh/src/code/z_actor.c | 3 +- soh/src/code/z_parameter.c | 35 ++--- soh/src/code/z_player_lib.c | 13 ++ soh/src/code/z_skelanime.c | 61 ++++++--- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 3 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 12 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 5 + .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 7 + .../overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 9 ++ .../overlays/actors/ovl_Boss_Va/z_boss_va.c | 3 + .../actors/ovl_Door_Killer/z_door_killer.c | 3 + soh/src/overlays/actors/ovl_En_Am/z_en_am.c | 3 + .../overlays/actors/ovl_En_Arrow/z_en_arrow.c | 3 + .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 7 + soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c | 4 +- .../ovl_En_ChristmasDeco/z_en_christmasdeco.c | 5 +- .../ovl_En_ChristmasTree/z_en_christmastree.c | 5 +- .../overlays/actors/ovl_En_Door/z_en_door.c | 3 + soh/src/overlays/actors/ovl_En_Go/z_en_go.c | 27 +++- soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 26 +++- .../overlays/actors/ovl_En_Hata/z_en_hata.c | 7 + .../actors/ovl_En_Heishi1/z_en_heishi1.c | 6 + .../actors/ovl_En_Heishi2/z_en_heishi2.c | 6 + .../actors/ovl_En_Heishi3/z_en_heishi3.c | 6 + .../actors/ovl_En_Heishi4/z_en_heishi4.c | 7 + soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c | 12 ++ soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c | 3 + soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c | 20 ++- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 6 +- .../overlays/actors/ovl_En_Okuta/z_en_okuta.c | 22 +-- .../actors/ovl_En_Snowball/z_en_snowball.c | 7 +- .../overlays/actors/ovl_En_Test/z_en_test.c | 6 + .../actors/ovl_En_Torch2/z_en_torch2.c | 6 + soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c | 3 + .../actors/ovl_En_Wood02/z_en_wood02.c | 12 +- soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c | 6 +- .../actors/ovl_End_Title/z_end_title.c | 40 +++--- .../actors/ovl_player_actor/z_player.c | 22 ++- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 6 +- 69 files changed, 971 insertions(+), 496 deletions(-) create mode 100644 soh/assets/custom/objects/custom_snowball/LightNoise.rgba32 create mode 100644 soh/assets/custom/objects/custom_snowball/mat_snowball_snow create mode 100644 soh/assets/custom/objects/custom_snowball/model.xml create mode 100644 soh/assets/custom/objects/custom_snowball/snowball create mode 100644 soh/assets/custom/objects/custom_snowball/snowball_tri_0 create mode 100644 soh/assets/custom/objects/custom_snowball/snowball_vtx_0 create mode 100644 soh/assets/custom/objects/custom_snowball/snowball_vtx_cull create mode 100644 soh/soh/Enhancements/Holiday/Archez.cpp create mode 100644 soh/soh/Enhancements/Holiday/Archez.h diff --git a/soh/assets/custom/objects/custom_snowball/LightNoise.rgba32 b/soh/assets/custom/objects/custom_snowball/LightNoise.rgba32 new file mode 100644 index 0000000000000000000000000000000000000000..73bcf2a59c1a8ae147f592dada13c779cef4b9fb GIT binary patch literal 4188 zcma*o!EsYt5QO1N282K+tXQ*QK{zBt3WP!gwvc3%WV>u%>l6H{DXn-_Q!{6#r@PP5 zeRx@x<@=X!Uq77lpI<+Ji*xzk|JnQWFa9q5_`EFV__!>G!(n}Vd|Z#m)@Ev$<_`}K>)YGg1#9MP|Mm6tnql?KpP!#E7#wNIY1vCdwnrPUj7#3_c9#sZ z-EJ>+d@yP|_2S`GO)pJ2x?yD;Y2`z%HnVS6=(le+d;0wL2F~#I)h{nEm#h|c-7%j$ zJ2%e*Tp06q=fOIP3ESp9i^n!nz0CX0y5S#AOB(KcDvFPeZ@^+fm1x z9;|+z@&(sj)%tgLch|f026)oJ!I#Lx{r&y*jo|brCXM>C9xfSwUhJovmfY`_rgumS zULB8n2z%XCZMW!c=%%eF@+8x77qzgT7EkT;erEYftDF~ST+?5({NOde{hrtJfA;gK zZny8qj0gLAFlw6k;LW>}`^A@cvwE`qcGA~V!{XrGd*PoR?3v}Gop_ynL-EVF&GB}I z!_&-L(8`+`FZHUO)x61tzDO58P4n4vrXiaPd+^@3zH?e?ec{dHb?z-@FTOmOsp-zp z?IOTqWsf#Cln9eef-5akSjDA?XcJTC`Ve%s5f>o#4j!dKb zd#60h>B8Z07hHXt-L1QNzuWi0Vc&0?FFvOy`}00HXz1N~&@)d5r(Rxg=d<^SKMX&3 zdy_oY%ct}FX7Q!nuAabI^!H+7d9)L^9d(*<*T-e2Jvm+&XZ%yM+T8CI9@ZQ9ePy_* zr!Km07`r08H&pXo?YHVZ?A5mirziV9)V%>*+&FoY!af)lr^kzL#V%|)y)&(mK y?Y`md!t@5P_Vh)1d2QzG-u&|xHb1gmxU}?UZH~`7s?)~VF5dR4;qi2q?Ysjy|A!<1 literal 0 HcmV?d00001 diff --git a/soh/assets/custom/objects/custom_snowball/mat_snowball_snow b/soh/assets/custom/objects/custom_snowball/mat_snowball_snow new file mode 100644 index 000000000..49b24d2b5 --- /dev/null +++ b/soh/assets/custom/objects/custom_snowball/mat_snowball_snow @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/custom_snowball/model.xml b/soh/assets/custom/objects/custom_snowball/model.xml new file mode 100644 index 000000000..8e2e4aa6e --- /dev/null +++ b/soh/assets/custom/objects/custom_snowball/model.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/custom/objects/custom_snowball/snowball b/soh/assets/custom/objects/custom_snowball/snowball new file mode 100644 index 000000000..ca9fb8e40 --- /dev/null +++ b/soh/assets/custom/objects/custom_snowball/snowball @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/custom/objects/custom_snowball/snowball_tri_0 b/soh/assets/custom/objects/custom_snowball/snowball_tri_0 new file mode 100644 index 000000000..7c4fb871d --- /dev/null +++ b/soh/assets/custom/objects/custom_snowball/snowball_tri_0 @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/custom_snowball/snowball_vtx_0 b/soh/assets/custom/objects/custom_snowball/snowball_vtx_0 new file mode 100644 index 000000000..69080c089 --- /dev/null +++ b/soh/assets/custom/objects/custom_snowball/snowball_vtx_0 @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/custom_snowball/snowball_vtx_cull b/soh/assets/custom/objects/custom_snowball/snowball_vtx_cull new file mode 100644 index 000000000..8e2e4aa6e --- /dev/null +++ b/soh/assets/custom/objects/custom_snowball/snowball_vtx_cull @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/soh_assets.h b/soh/assets/soh_assets.h index 0682703bc..4c528bddc 100644 --- a/soh/assets/soh_assets.h +++ b/soh/assets/soh_assets.h @@ -59,6 +59,9 @@ static const ALIGN_ASSET(2) char gSkullTreasureChestFrontTex[] = dgSkullTreasure #define dgSkullTreasureChestSideAndTopTex "__OTR__objects/object_box/gSkullTreasureChestSideAndTopTex" static const ALIGN_ASSET(2) char gSkullTreasureChestSideAndTopTex[] = dgSkullTreasureChestSideAndTopTex; +#define dgSnowballDL "__OTR__objects/custom_snowball/snowball" +static const ALIGN_ASSET(2) char gSnowballDL[] = dgSnowballDL; + #define dgTitleRandomizerSubtitleTex "__OTR__objects/object_mag/gTitleRandomizerSubtitleTex" static const ALIGN_ASSET(2) char gTitleRandomizerSubtitleTex[] = dgTitleRandomizerSubtitleTex; diff --git a/soh/soh/Enhancements/Holiday/AGreenSpoon.cpp b/soh/soh/Enhancements/Holiday/AGreenSpoon.cpp index 2e745a9ee..1d632e912 100644 --- a/soh/soh/Enhancements/Holiday/AGreenSpoon.cpp +++ b/soh/soh/Enhancements/Holiday/AGreenSpoon.cpp @@ -26,40 +26,39 @@ void EnGs_Evil(EnGs* enGs, PlayState* play) { float offsetZ = cosf(enGs->actor.shape.rot.y * (M_PI / 0x8000)) * offsetDistance; float dx = player->actor.world.pos.x - (enGs->actor.world.pos.x + offsetX); - float dy = player->actor.world.pos.y - 10.0f - enGs->actor.world.pos.y; + float dy = player->actor.world.pos.y - 10.0f - enGs->actor.world.pos.y; float dz = player->actor.world.pos.z - (enGs->actor.world.pos.z + offsetZ); s16 rotX = atan2f(dy, sqrtf(dx * dx + dz * dz)) * (0x8000 / M_PI); s16 rotY = enGs->actor.shape.rot.y; s16 rotZ = atan2f(dx, dz) * (0x8000 / M_PI); - Actor* actor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, - enGs->actor.world.pos.x + offsetX, - enGs->actor.world.pos.y + 40.0f, - enGs->actor.world.pos.z + offsetZ, - rotX, rotY, rotZ, - 100, false); + Actor* actor = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, enGs->actor.world.pos.x + offsetX, + enGs->actor.world.pos.y + 40.0f, enGs->actor.world.pos.z + offsetZ, rotX, rotY, + rotZ, 100, false); EnClearTag* clearTag = (EnClearTag*)actor; enGs->unk_200 = 5; } - + enGs->unk_200--; } } static void OnConfigurationChanged() { - COND_ID_HOOK(OnOpenText, 0x2053, CVarGetInteger(CVAR("EvilGossipStone"), 0), [](u16 * textId, bool* loadFromMessageTable) { - Actor* actor = Actor_FindNearby(gPlayState, &GET_PLAYER(gPlayState)->actor, ACTOR_EN_GS, ACTORCAT_PROP, 100.0f); + COND_ID_HOOK( + OnOpenText, 0x2053, CVarGetInteger(CVAR("EvilGossipStone"), 0), [](u16* textId, bool* loadFromMessageTable) { + Actor* actor = + Actor_FindNearby(gPlayState, &GET_PLAYER(gPlayState)->actor, ACTOR_EN_GS, ACTORCAT_PROP, 100.0f); - if (actor == NULL) { - return; - } + if (actor == NULL) { + return; + } - EnGs* gs = (EnGs*)actor; - gs->actionFunc = EnGs_Evil; - }); + EnGs* gs = (EnGs*)actor; + gs->actionFunc = EnGs_Evil; + }); } static void DrawMenu() { diff --git a/soh/soh/Enhancements/Holiday/Archez.cpp b/soh/soh/Enhancements/Holiday/Archez.cpp new file mode 100644 index 000000000..0665c9d29 --- /dev/null +++ b/soh/soh/Enhancements/Holiday/Archez.cpp @@ -0,0 +1,123 @@ +#include "Holiday.hpp" +#include "Archez.h" +#include +#include "soh/UIWidgets.hpp" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh_assets.h" + +extern "C" { +#include "macros.h" +#include "functions.h" +#include "variables.h" +#include "objects/object_goroiwa/object_goroiwa.h" + +extern PlayState* gPlayState; +} + +#define AUTHOR "Archez" +#define CVAR(v) "gHoliday." AUTHOR "." v + +static bool sSkipNextLimb = false; +static bool sSkipNextSkeleton = false; + +extern "C" void SkipOverrideNextLimb() { + sSkipNextLimb = true; +} + +extern "C" void SkipOverrideNextSkeleton() { + sSkipNextSkeleton = true; +} + +extern "C" void ClearOverrideSkips() { + sSkipNextLimb = false; + sSkipNextSkeleton = false; +} + +static void ConfigurationChanged() { + COND_VB_SHOULD(VB_DRAW_SKEL_LIMB, CVarGetInteger(CVAR("SnowGolems"), 0), { + if (!*should) { + return; + } + + if (sSkipNextLimb) { + sSkipNextLimb = false; + return; + } + + if (sSkipNextSkeleton) { + return; + } + + Gfx** gfxP = va_arg(args, Gfx**); + void* dList = va_arg(args, void*); + + *should = false; + + Gfx* gfx = *gfxP; + + Matrix_Push(); + + Matrix_Scale(0.55f, 0.55f, 0.55f, MTXMODE_APPLY); + gSPMatrix(gfx++, Matrix_NewMtx(gPlayState->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_LOAD); + gSPDisplayList(gfx++, (Gfx*)gSnowballDL); + + Matrix_Pop(); + + gSPMatrix(gfx++, Matrix_NewMtx(gPlayState->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_LOAD); + + *gfxP = gfx; + }); + + COND_VB_SHOULD(VB_DRAW_SKEL_FLEX_LIMB, CVarGetInteger(CVAR("SnowGolems"), 0), { + if (!*should) { + return; + } + + if (sSkipNextLimb) { + sSkipNextLimb = false; + } + + if (sSkipNextSkeleton) { + return; + } + + Gfx** gfxP = va_arg(args, Gfx**); + void* dList = va_arg(args, void*); + Mtx* mtx = va_arg(args, Mtx*); + + *should = false; + + Gfx* gfx = *gfxP; + MtxF mtxF; + + Matrix_Push(); + Matrix_MtxToMtxF(mtx, &mtxF); + Matrix_Put(&mtxF); + + Matrix_Scale(0.55f, 0.55f, 0.55f, MTXMODE_APPLY); + gSPMatrix(gfx++, Matrix_NewMtx(gPlayState->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_LOAD); + gSPDisplayList(gfx++, (Gfx*)gSnowballDL); + + Matrix_Pop(); + + gSPMatrix(gfx++, mtx, G_MTX_LOAD); + + *gfxP = gfx; + }); +} + +static void DrawMenu() { + ImGui::SeparatorText(AUTHOR); + + if (UIWidgets::EnhancementCheckbox("Snow Golems", CVAR("SnowGolems"))) { + ConfigurationChanged(); + } + UIWidgets::Tooltip("Overrides most charactor skeletons with snow balls to make them look like Snow Golems"); +} + +static void RegisterMod() { + ConfigurationChanged(); +} + +static Holiday holiday(DrawMenu, RegisterMod); diff --git a/soh/soh/Enhancements/Holiday/Archez.h b/soh/soh/Enhancements/Holiday/Archez.h new file mode 100644 index 000000000..235f9dee3 --- /dev/null +++ b/soh/soh/Enhancements/Holiday/Archez.h @@ -0,0 +1,16 @@ +#ifndef ARCHEZ_H +#define ARCHEZ_H + +#ifdef __cplusplus +extern "C" { +#endif + +void SkipOverrideNextLimb(); +void SkipOverrideNextSkeleton(); +void ClearOverrideSkips(); + +#ifdef __cplusplus +} +#endif + +#endif // ARCHEZ_H diff --git a/soh/soh/Enhancements/Holiday/Caladius.cpp b/soh/soh/Enhancements/Holiday/Caladius.cpp index 5c4b76499..d4e625ca2 100644 --- a/soh/soh/Enhancements/Holiday/Caladius.cpp +++ b/soh/soh/Enhancements/Holiday/Caladius.cpp @@ -38,9 +38,9 @@ void OnTimeOver() { } int32_t calculateRemainingTime() { - int32_t timeRemaining = + int32_t timeRemaining = ((gSaveContext.sohStats.count[COUNT_ICE_TRAPS] * (CVarGetInteger(CVAR("ExtendTimer"), 0) * 600)) + - (CVarGetInteger(CVAR("StartTimer"), 0) * 600) - GAMEPLAYSTAT_TOTAL_TIME); + (CVarGetInteger(CVAR("StartTimer"), 0) * 600) - GAMEPLAYSTAT_TOTAL_TIME); if (timeRemaining <= 0) { OnTimeOver(); timeRemaining = 0; @@ -53,7 +53,7 @@ s32 ActorSnapToFloor(Actor* refActor, PlayState* play, f32 arg2) { Vec3f pos; s32 bgId; f32 floorY; - + pos.x = refActor->world.pos.x; pos.y = refActor->world.pos.y + 30.0f; pos.z = refActor->world.pos.z; @@ -66,7 +66,7 @@ s32 ActorSnapToFloor(Actor* refActor, PlayState* play, f32 arg2) { } void RandomizeBoulder(Actor* refActor) { - Actor* actor = (Actor*) refActor; + Actor* actor = (Actor*)refActor; int16_t param = actor->params; int32_t yAdj = 0; uint32_t roll = rand() % boulderList.size(); @@ -75,8 +75,8 @@ void RandomizeBoulder(Actor* refActor) { } yAdj = ActorSnapToFloor(actor, gPlayState, 0.0f); - Actor_Spawn(&gPlayState->actorCtx, gPlayState, boulderList[roll], actor->world.pos.x, ActorSnapToFloor(actor, gPlayState, 0.0f), - actor->world.pos.z, 0, 0, 0, param, false); + Actor_Spawn(&gPlayState->actorCtx, gPlayState, boulderList[roll], actor->world.pos.x, + ActorSnapToFloor(actor, gPlayState, 0.0f), actor->world.pos.z, 0, 0, 0, param, false); Actor_Kill(actor); } @@ -89,44 +89,39 @@ static void OnPresentChange() { Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); std::string msg = std::to_string(giftsCollected).c_str(); msg += " Gifts in Inventory."; - Notification::Emit({ - .itemIcon = "RG_TRIFORCE_PIECE", - .message = msg + Notification::Emit({ .itemIcon = "RG_TRIFORCE_PIECE", .message = msg }); + }); + COND_ID_HOOK( + OnOpenText, 0x204A, CVarGetInteger(CVAR("OrnExch.Enabled"), 0), [](u16* textId, bool* loadFromMessageTable) { + auto messageEntry = CustomMessage(""); + bool reduceGifts = false; + uint32_t giftsCollected = CVarGetInteger(CVAR("GiftsCollected"), 0); + uint32_t giftsRequired = CVarGetInteger(CVAR("OrnExch.Amount"), 15); + if (giftsCollected < giftsRequired) { + std::string msg = "You only have %r " + std::to_string(giftsCollected) + "%w If you bring me %g" + + std::to_string(giftsRequired) + "%w I'll give you a reward!"; + messageEntry = CustomMessage(msg); + } else { + std::string msg = "A present? And %g" + std::to_string(giftsRequired) + + "%w to boot? Here's your reward, bring me more if you find any!"; + messageEntry = CustomMessage(msg); + reduceGifts = true; + } + messageEntry.AutoFormat(); + messageEntry.LoadIntoFont(); + *loadFromMessageTable = false; + + if (reduceGifts) { + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_TRIFORCE_PIECE).GetGIEntry_Copy(); + giftsCollected -= giftsRequired; + CVarSetInteger(CVAR("GiftsCollected"), giftsCollected); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + + std::string msg = std::to_string(giftsCollected).c_str(); + msg += " Gifts in Inventory."; + Notification::Emit({ .itemIcon = "RG_TRIFORCE_PIECE", .message = msg }); + } }); - }); - COND_ID_HOOK(OnOpenText, 0x204A, CVarGetInteger(CVAR("OrnExch.Enabled"), 0), [](u16 * textId, bool* loadFromMessageTable) { - auto messageEntry = CustomMessage(""); - bool reduceGifts = false; - uint32_t giftsCollected = CVarGetInteger(CVAR("GiftsCollected"), 0); - uint32_t giftsRequired = CVarGetInteger(CVAR("OrnExch.Amount"), 15); - if (giftsCollected < giftsRequired) { - std::string msg = "You only have %r " + std::to_string(giftsCollected) + "%w If you bring me %g" - + std::to_string(giftsRequired) + "%w I'll give you a reward!"; - messageEntry = CustomMessage(msg); - } else { - std::string msg = "A present? And %g" + std::to_string(giftsRequired) + - "%w to boot? Here's your reward, bring me more if you find any!"; - messageEntry = CustomMessage(msg); - reduceGifts = true; - } - messageEntry.AutoFormat(); - messageEntry.LoadIntoFont(); - *loadFromMessageTable = false; - - if (reduceGifts) { - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_TRIFORCE_PIECE).GetGIEntry_Copy(); - giftsCollected -= giftsRequired; - CVarSetInteger(CVAR("GiftsCollected"), giftsCollected); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); - - std::string msg = std::to_string(giftsCollected).c_str(); - msg += " Gifts in Inventory."; - Notification::Emit({ - .itemIcon = "RG_TRIFORCE_PIECE", - .message = msg - }); - } - }); } static void OnBlitzChange() { @@ -171,14 +166,10 @@ void CaladiusWindow::Draw() { ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0.5f)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0)); ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f); - ImGui::Begin("TimerDisplay", nullptr, ImGuiWindowFlags_AlwaysAutoResize | - ImGuiWindowFlags_NoNav | - ImGuiWindowFlags_NoFocusOnAppearing | - ImGuiWindowFlags_NoResize | - ImGuiWindowFlags_NoDocking | - ImGuiWindowFlags_NoTitleBar | - ImGuiWindowFlags_NoScrollWithMouse | - ImGuiWindowFlags_NoScrollbar); + ImGui::Begin("TimerDisplay", nullptr, + ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoFocusOnAppearing | + ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | + ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoScrollbar); ImGui::SetWindowFontScale(fontScale); ImGui::Text(formatTimestampIceTrapFever(calculateRemainingTime()).c_str()); ImGui::End(); @@ -194,14 +185,14 @@ static void DrawMenu() { } UIWidgets::Tooltip("Can you beat your objective before the Fever sets in?/n" "- Obtaining Ice Traps extends your timer."); - if (UIWidgets::EnhancementSliderFloat("", "##FontScale", CVAR("FontScale"), - 1.0f, 5.0f, "Font: %.1fx", 1.0f, false, false, isFeverDisabled)) { + if (UIWidgets::EnhancementSliderFloat("", "##FontScale", CVAR("FontScale"), 1.0f, 5.0f, "Font: %.1fx", 1.0f, false, + false, isFeverDisabled)) { OnFeverConfigurationChanged(); } - UIWidgets::PaddedEnhancementSliderInt("Starting Timer: %d minutes", "##StartTime", CVAR("StartTimer"), - 5, 30, "", 15, true, true, false, isFeverDisabled); - UIWidgets::PaddedEnhancementSliderInt("Time Extensions: %d minutes", "##ExtendTime", CVAR("ExtendTimer"), - 1, 10, "", 5, true, true, false, isFeverDisabled); + UIWidgets::PaddedEnhancementSliderInt("Starting Timer: %d minutes", "##StartTime", CVAR("StartTimer"), 5, 30, "", + 15, true, true, false, isFeverDisabled); + UIWidgets::PaddedEnhancementSliderInt("Time Extensions: %d minutes", "##ExtendTime", CVAR("ExtendTimer"), 1, 10, "", + 5, true, true, false, isFeverDisabled); UIWidgets::PaddedSeparator(); if (UIWidgets::EnhancementCheckbox("Boulder Blitz", CVAR("Blitz.Enabled"))) { @@ -217,12 +208,10 @@ static void DrawMenu() { } UIWidgets::Tooltip("See Malon as Young Link in Lon Lon Ranch to exchange Gifts for Ornaments!\n" "Note: Enabling this will set \"Gifts For NPCs\" to match."); - UIWidgets::PaddedEnhancementSliderInt("Gifts Required: %d Gifts", "##GiftsReq", CVAR("OrnExch.Amount"), - 5, 30, "", 15, true, true, false, isExchangeDisabled); - + UIWidgets::PaddedEnhancementSliderInt("Gifts Required: %d Gifts", "##GiftsReq", CVAR("OrnExch.Amount"), 5, 30, "", + 15, true, true, false, isExchangeDisabled); } - static void RegisterMod() { OnFeverConfigurationChanged(); OnBlitzChange(); diff --git a/soh/soh/Enhancements/Holiday/Caladius.h b/soh/soh/Enhancements/Holiday/Caladius.h index 4bbd1ad8e..ff4d8c1f7 100644 --- a/soh/soh/Enhancements/Holiday/Caladius.h +++ b/soh/soh/Enhancements/Holiday/Caladius.h @@ -4,8 +4,8 @@ class CaladiusWindow : public Ship::GuiWindow { public: using GuiWindow::GuiWindow; - void InitElement() override {}; - void DrawElement() override {}; + void InitElement() override{}; + void DrawElement() override{}; void Draw() override; - void UpdateElement() override {}; + void UpdateElement() override{}; }; \ No newline at end of file diff --git a/soh/soh/Enhancements/Holiday/Example.cpp b/soh/soh/Enhancements/Holiday/Example.cpp index 235738811..dc8086788 100644 --- a/soh/soh/Enhancements/Holiday/Example.cpp +++ b/soh/soh/Enhancements/Holiday/Example.cpp @@ -20,7 +20,7 @@ static void OnConfigurationChanged() { // COND_HOOK(OnSceneSpawnActors, CVarGetInteger(CVAR("Enabled"), 0), []() { // // Spawn your own actors? // }); - + // COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, CVarGetInteger(CVAR("DoSomethingWithPots"), 0), [](void* actorRef) { // // Do something with pots? // }); diff --git a/soh/soh/Enhancements/Holiday/Fredomato.cpp b/soh/soh/Enhancements/Holiday/Fredomato.cpp index bb01ea991..c2ef2a936 100644 --- a/soh/soh/Enhancements/Holiday/Fredomato.cpp +++ b/soh/soh/Enhancements/Holiday/Fredomato.cpp @@ -28,23 +28,25 @@ static CollisionPoly snowballPoly; static f32 raycastResult; const s16 entrances[] = { - 0x0000, 0x0209, 0x0004, 0x0242, 0x0028, 0x0221, 0x0169, 0x0215, 0x0165, 0x024A, 0x0010, 0x021D, 0x0082, 0x01E1, 0x0037, 0x0205, - 0x0098, 0x02A6, 0x0088, 0x03D4, 0x0008, 0x03A8, 0x0467, 0x023D, 0x0433, 0x0443, 0x0437, 0x0447, 0x009C, 0x033C, 0x00C9, 0x026A, - 0x00C1, 0x0266, 0x0043, 0x03CC, 0x045F, 0x0309, 0x03A0, 0x03D0, 0x007E, 0x026E, 0x0530, 0x01D1, 0x0507, 0x03BC, 0x0388, 0x02A2, - 0x0063, 0x01D5, 0x0528, 0x03C0, 0x043B, 0x0067, 0x02FD, 0x0349, 0x0550, 0x04EE, 0x039C, 0x0345, 0x05C8, 0x05DC, 0x0072, 0x034D, - 0x030D, 0x0355, 0x037C, 0x03FC, 0x0380, 0x03C4, 0x004F, 0x0378, 0x02F9, 0x042F, 0x05D0, 0x05D4, 0x052C, 0x03B8, 0x016D, 0x01CD, - 0x00B7, 0x0201, 0x003B, 0x0463, 0x0588, 0x057C, 0x0578, 0x0340, 0x04C2, 0x03E8, 0x04BE, 0x0482, 0x0315, 0x045B, 0x0371, 0x0394, - 0x0272, 0x0211, 0x0053, 0x0472, 0x0453, 0x0351, 0x0384, 0x044B, 0x03EC, 0x04FF, 0x0700, 0x0800, 0x0701, 0x0801, 0x0702, 0x0802, - 0x0703, 0x0803, 0x0704, 0x0804, 0x0705, 0x0805, 0x0706, 0x0806, 0x0707, 0x0807, 0x0708, 0x0808, 0x0709, 0x0809, 0x070A, 0x080A, - 0x070B, 0x080B, 0x070C, 0x080C, 0x070D, 0x080D, 0x070E, 0x080E, 0x070F, 0x080F, 0x0710, 0x0711, 0x0811, 0x0712, 0x0812, - 0x0713, 0x0813, 0x0714, 0x0814, 0x0715, 0x0815, 0x0716, 0x0816, 0x0717, 0x0817, 0x0718, 0x0818, 0x0719, 0x0819, 0x081A, - 0x071B, 0x081B, 0x071C, 0x081C, 0x071D, 0x081D, 0x071E, 0x081E, 0x071F, 0x081F, 0x0720, 0x0820, 0x004B, 0x035D, 0x031C, 0x0361, - 0x002D, 0x050B, 0x044F, 0x0359, 0x05E0, 0x020D, 0x011E, 0x0286, 0x04E2, 0x04D6, 0x01DD, 0x04DA, 0x00FC, 0x01A9, 0x0185, 0x04DE, - 0x0102, 0x0189, 0x0117, 0x018D, 0x0276, 0x01FD, 0x00DB, 0x017D, 0x00EA, 0x0181, 0x0157, 0x01F9, 0x0328, 0x0560, 0x0129, 0x022D, - 0x0130, 0x03AC, 0x0123, 0x0365, 0x00B1, 0x0033, 0x0138, 0x025A, 0x0171, 0x025E, 0x00E4, 0x0195, 0x013D, 0x0191, 0x014D, 0x01B9, - 0x0246, 0x01C1, 0x0147, 0x01BD, 0x0108, 0x019D, 0x0225, 0x01A1, 0x0219, 0x027E, 0x0554, 0x00BB, 0x0282, 0x0600, 0x04F6, 0x0604, - 0x01F1, 0x0568, 0x05F4, 0x040F, 0x0252, 0x040B, 0x00C5, 0x0301, 0x0407, 0x000C, 0x024E, 0x0305, 0x0175, 0x0417, 0x0423, 0x008D, - 0x02F5, 0x0413, 0x02B2, 0x0457, 0x047A, 0x010E, 0x0608, 0x0564, 0x060C, 0x0610, 0x0580 + 0x0000, 0x0209, 0x0004, 0x0242, 0x0028, 0x0221, 0x0169, 0x0215, 0x0165, 0x024A, 0x0010, 0x021D, 0x0082, 0x01E1, + 0x0037, 0x0205, 0x0098, 0x02A6, 0x0088, 0x03D4, 0x0008, 0x03A8, 0x0467, 0x023D, 0x0433, 0x0443, 0x0437, 0x0447, + 0x009C, 0x033C, 0x00C9, 0x026A, 0x00C1, 0x0266, 0x0043, 0x03CC, 0x045F, 0x0309, 0x03A0, 0x03D0, 0x007E, 0x026E, + 0x0530, 0x01D1, 0x0507, 0x03BC, 0x0388, 0x02A2, 0x0063, 0x01D5, 0x0528, 0x03C0, 0x043B, 0x0067, 0x02FD, 0x0349, + 0x0550, 0x04EE, 0x039C, 0x0345, 0x05C8, 0x05DC, 0x0072, 0x034D, 0x030D, 0x0355, 0x037C, 0x03FC, 0x0380, 0x03C4, + 0x004F, 0x0378, 0x02F9, 0x042F, 0x05D0, 0x05D4, 0x052C, 0x03B8, 0x016D, 0x01CD, 0x00B7, 0x0201, 0x003B, 0x0463, + 0x0588, 0x057C, 0x0578, 0x0340, 0x04C2, 0x03E8, 0x04BE, 0x0482, 0x0315, 0x045B, 0x0371, 0x0394, 0x0272, 0x0211, + 0x0053, 0x0472, 0x0453, 0x0351, 0x0384, 0x044B, 0x03EC, 0x04FF, 0x0700, 0x0800, 0x0701, 0x0801, 0x0702, 0x0802, + 0x0703, 0x0803, 0x0704, 0x0804, 0x0705, 0x0805, 0x0706, 0x0806, 0x0707, 0x0807, 0x0708, 0x0808, 0x0709, 0x0809, + 0x070A, 0x080A, 0x070B, 0x080B, 0x070C, 0x080C, 0x070D, 0x080D, 0x070E, 0x080E, 0x070F, 0x080F, 0x0710, 0x0711, + 0x0811, 0x0712, 0x0812, 0x0713, 0x0813, 0x0714, 0x0814, 0x0715, 0x0815, 0x0716, 0x0816, 0x0717, 0x0817, 0x0718, + 0x0818, 0x0719, 0x0819, 0x081A, 0x071B, 0x081B, 0x071C, 0x081C, 0x071D, 0x081D, 0x071E, 0x081E, 0x071F, 0x081F, + 0x0720, 0x0820, 0x004B, 0x035D, 0x031C, 0x0361, 0x002D, 0x050B, 0x044F, 0x0359, 0x05E0, 0x020D, 0x011E, 0x0286, + 0x04E2, 0x04D6, 0x01DD, 0x04DA, 0x00FC, 0x01A9, 0x0185, 0x04DE, 0x0102, 0x0189, 0x0117, 0x018D, 0x0276, 0x01FD, + 0x00DB, 0x017D, 0x00EA, 0x0181, 0x0157, 0x01F9, 0x0328, 0x0560, 0x0129, 0x022D, 0x0130, 0x03AC, 0x0123, 0x0365, + 0x00B1, 0x0033, 0x0138, 0x025A, 0x0171, 0x025E, 0x00E4, 0x0195, 0x013D, 0x0191, 0x014D, 0x01B9, 0x0246, 0x01C1, + 0x0147, 0x01BD, 0x0108, 0x019D, 0x0225, 0x01A1, 0x0219, 0x027E, 0x0554, 0x00BB, 0x0282, 0x0600, 0x04F6, 0x0604, + 0x01F1, 0x0568, 0x05F4, 0x040F, 0x0252, 0x040B, 0x00C5, 0x0301, 0x0407, 0x000C, 0x024E, 0x0305, 0x0175, 0x0417, + 0x0423, 0x008D, 0x02F5, 0x0413, 0x02B2, 0x0457, 0x047A, 0x010E, 0x0608, 0x0564, 0x060C, 0x0610, 0x0580 }; static bool midoGrottoInit = false; @@ -55,7 +57,8 @@ static Vec3s midoMorphTable[17]; static void RandomGrotto_WaitOpen(DoorAna* doorAna, PlayState* play) { if (!midoGrottoInit) { midoGrottoInit = true; - SkelAnime_InitFlex(play, &midoSkelAnime, (FlexSkeletonHeader*)&gMidoSkel, (AnimationHeader*)&gMidoWalkingAnim, midoJointTable, midoMorphTable, 17); + SkelAnime_InitFlex(play, &midoSkelAnime, (FlexSkeletonHeader*)&gMidoSkel, (AnimationHeader*)&gMidoWalkingAnim, + midoJointTable, midoMorphTable, 17); } SkelAnime_Update(&midoSkelAnime); @@ -68,13 +71,13 @@ static void RandomGrotto_WaitOpen(DoorAna* doorAna, PlayState* play) { Math_ApproachS(&doorAna->actor.shape.rot.y, doorAna->actor.yawTowardsPlayer, 5, 0xBB8); if (Math_StepToF(&actor->scale.x, 0.01f, 0.001f)) { - if ((actor->targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_FLOOR_DISABLED) && (player->av1.actionVar1 == 0)) { + if ((actor->targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && + (player->stateFlags1 & PLAYER_STATE1_FLOOR_DISABLED) && (player->av1.actionVar1 == 0)) { play->nextEntranceIndex = RandomElement(entrances); DoorAna_SetupAction((DoorAna*)actor, DoorAna_GrabPlayer); } else { if (!Player_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER)) && - actor->xzDistToPlayer <= 15.0f && -50.0f <= actor->yDistToPlayer && - actor->yDistToPlayer <= 15.0f) { + actor->xzDistToPlayer <= 15.0f && -50.0f <= actor->yDistToPlayer && actor->yDistToPlayer <= 15.0f) { player->stateFlags1 |= PLAYER_STATE1_FLOOR_DISABLED; actor->targetMode = 1; } else { @@ -92,11 +95,13 @@ static void RandomGrotto_Draw(Actor* actor, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, (Gfx*)gGrottoDL); Matrix_Translate(0.0f, -2700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPSegment(POLY_OPA_DISP++, 0x08, (uintptr_t)gMidoEyeOpenTex); func_80034BA0(play, &midoSkelAnime, NULL, NULL, actor, 255); @@ -115,14 +120,15 @@ static void SpawnRandomGrotto() { pos.x = 0; pos.z = 0; } - // X/Z anywhere from -1000.0 to +1000.0 from player + // X/Z anywhere from -1000.0 to +1000.0 from player pos.x += (float)(Random(0, 2000)) - 1000.0f; pos.z += (float)(Random(0, 2000)) - 1000.0f; raycastResult = BgCheck_AnyRaycastFloor1(&gPlayState->colCtx, &snowballPoly, &pos); if (raycastResult > BGCHECK_Y_MIN) { - Actor* grotto = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_DOOR_ANA, pos.x, raycastResult, pos.z, 0, 0, 0, 0, false); + Actor* grotto = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_DOOR_ANA, pos.x, raycastResult, pos.z, + 0, 0, 0, 0, false); midoGrottoInit = false; DoorAna_SetupAction((DoorAna*)grotto, RandomGrotto_WaitOpen); grotto->draw = RandomGrotto_Draw; diff --git a/soh/soh/Enhancements/Holiday/Grimey.cpp b/soh/soh/Enhancements/Holiday/Grimey.cpp index cd21ce91c..3580a59d0 100644 --- a/soh/soh/Enhancements/Holiday/Grimey.cpp +++ b/soh/soh/Enhancements/Holiday/Grimey.cpp @@ -69,7 +69,7 @@ void Penguin_Update(Actor* actor, PlayState* play) { actor->speedXZ = 0.5f; break; } - + Math_SmoothStepToS(&actor->world.rot.y, penguin->targetRot, 1, 200, 0); actor->shape.rot.y = actor->world.rot.y; @@ -89,7 +89,8 @@ void Penguin_Draw(Actor* actor, PlayState* play) { Matrix_Scale(0.8f, 0.8f, 0.8f, MTXMODE_APPLY); Matrix_Translate(0, 2000.0f, 0, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), + G_MTX_MODELVIEW | G_MTX_LOAD); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gPenguinDL); @@ -103,7 +104,7 @@ void Penguin_Destroy(Actor* actor, PlayState* play) { static void OnConfigurationChanged() { COND_HOOK(OnPlayerUpdate, CVarGetInteger(CVAR("Hailstorm"), 0), []() { // Every frame has a 1/300 chance of spawning hail - if (rand() % 300 == 0) { + if (rand() % 300 == 0) { int spawned = 0; while (spawned < 1) { Vec3f pos = GET_PLAYER(gPlayState)->actor.world.pos; @@ -111,7 +112,8 @@ static void OnConfigurationChanged() { pos.z += (float)Random(0, 100) - 50.0f; pos.y += 200.0f; - Actor* actor = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_NUTSBALL, pos.x, pos.y, pos.z, 0, 0, 0, 0, false); + Actor* actor = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_NUTSBALL, pos.x, pos.y, pos.z, 0, + 0, 0, 0, false); EnNutsball* nut = (EnNutsball*)actor; nut->actor.draw = EnNutsball_Draw; nut->actor.shape.rot.y = 0; @@ -140,15 +142,13 @@ static void OnConfigurationChanged() { int huddlesSpawned = 0; while (huddlesSpawned < 10) { - huddlePos.x = (float)(Random( - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -10000 : -2700) + 10000, - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 5000 : 2000) + 10000 - ) - (float)10000.0f); + huddlePos.x = (float)(Random((gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -10000 : -2700) + 10000, + (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 5000 : 2000) + 10000) - + (float)10000.0f); huddlePos.y = 5000; - huddlePos.z = (float)(Random( - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -1000 : -2000) + 10000, - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 15000 : 2000) + 10000 - ) - (float)10000.0f); + huddlePos.z = (float)(Random((gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -1000 : -2000) + 10000, + (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 15000 : 2000) + 10000) - + (float)10000.0f); if (BgCheck_AnyRaycastFloor1(&gPlayState->colCtx, &poly, &huddlePos) <= BGCHECK_Y_MIN) { continue; @@ -165,7 +165,8 @@ static void OnConfigurationChanged() { raycastResult = BgCheck_AnyRaycastFloor1(&gPlayState->colCtx, &poly, &spawnPos); if (raycastResult > BGCHECK_Y_MIN) { - Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_OE2, spawnPos.x, raycastResult, spawnPos.z, 0, 0, 0, 0, false); + Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_OE2, spawnPos.x, raycastResult, spawnPos.z, + 0, 0, 0, 0, false); penguinsSpawned++; } } @@ -174,7 +175,7 @@ static void OnConfigurationChanged() { spawningPenguins = false; }); - + COND_ID_HOOK(ShouldActorInit, ACTOR_EN_OE2, CVarGetInteger(CVAR("Penguins"), 0), [](void* actorRef, bool* should) { Actor* actor = (Actor*)actorRef; if (spawningPenguins) { diff --git a/soh/soh/Enhancements/Holiday/Holiday.hpp b/soh/soh/Enhancements/Holiday/Holiday.hpp index e16bd005a..299b4b536 100644 --- a/soh/soh/Enhancements/Holiday/Holiday.hpp +++ b/soh/soh/Enhancements/Holiday/Holiday.hpp @@ -37,4 +37,4 @@ struct Holiday { } }; -#endif //HOLIDAY_HPP +#endif // HOLIDAY_HPP diff --git a/soh/soh/Enhancements/Holiday/ItsHeckinPat.cpp b/soh/soh/Enhancements/Holiday/ItsHeckinPat.cpp index 9f3192a80..fd72e0a29 100644 --- a/soh/soh/Enhancements/Holiday/ItsHeckinPat.cpp +++ b/soh/soh/Enhancements/Holiday/ItsHeckinPat.cpp @@ -23,8 +23,7 @@ bool spawningPresents = false; int collectedPresent = 0; -struct Present { -}; +struct Present {}; std::unordered_map presents; @@ -60,7 +59,8 @@ void Present_Draw(Actor* actor, PlayState* play) { Matrix_Scale(30.0f, 30.0f, 30.0f, MTXMODE_APPLY); Matrix_Translate(49.20f, 0.0f, -106.60f, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), + G_MTX_MODELVIEW | G_MTX_LOAD); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gXmasDecor100DL); @@ -88,7 +88,7 @@ void OnConfigChanged() { pos.x = 0; pos.z = 0; } - // X/Z anywhere from -1000.0 to +1000.0 from player + // X/Z anywhere from -1000.0 to +1000.0 from player pos.x += (float)(Random(0, 2000)) - 1000.0f; pos.z += (float)(Random(0, 2000)) - 1000.0f; @@ -96,7 +96,8 @@ void OnConfigChanged() { if (raycastResult > BGCHECK_Y_MIN) { spawningPresents = true; - Actor* actor = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_OE2, pos.x, raycastResult, pos.z, 0, 0, 0, 0, false); + Actor* actor = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_OE2, pos.x, raycastResult, pos.z, + 0, 0, 0, 0, false); spawningPresents = false; // break; } @@ -105,30 +106,32 @@ void OnConfigChanged() { } }); - COND_ID_HOOK(ShouldActorInit, ACTOR_EN_OE2, CVarGetInteger(CVAR("GiftsForNPCs"), 0), [](void* actorRef, bool* should) { - Actor* actor = (Actor*)actorRef; - if (spawningPresents) { - actor->init = Present_Init; - actor->update = Present_Update; - actor->draw = Present_Draw; - actor->destroy = Present_Destroy; - } - }); + COND_ID_HOOK(ShouldActorInit, ACTOR_EN_OE2, CVarGetInteger(CVAR("GiftsForNPCs"), 0), + [](void* actorRef, bool* should) { + Actor* actor = (Actor*)actorRef; + if (spawningPresents) { + actor->init = Present_Init; + actor->update = Present_Update; + actor->draw = Present_Draw; + actor->destroy = Present_Destroy; + } + }); - COND_ID_HOOK(OnOpenText, 0x1019, CVarGetInteger(CVAR("GiftsForNPCs"), 0), [](u16 * textId, bool* loadFromMessageTable) { - if (collectedPresent <= 0) { - return; - } + COND_ID_HOOK(OnOpenText, 0x1019, CVarGetInteger(CVAR("GiftsForNPCs"), 0), + [](u16* textId, bool* loadFromMessageTable) { + if (collectedPresent <= 0) { + return; + } - auto messageEntry = CustomMessage("A present??? FOR ME???"); - messageEntry.Format(); - messageEntry.LoadIntoFont(); - *loadFromMessageTable = false; + auto messageEntry = CustomMessage("A present??? FOR ME???"); + messageEntry.Format(); + messageEntry.LoadIntoFont(); + *loadFromMessageTable = false; - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_PIECE_OF_HEART).GetGIEntry_Copy(); + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_PIECE_OF_HEART).GetGIEntry_Copy(); - collectedPresent--; - }); + collectedPresent--; + }); } static void DrawMenu() { diff --git a/soh/soh/Enhancements/Holiday/NotProxySaw.cpp b/soh/soh/Enhancements/Holiday/NotProxySaw.cpp index b6cf85091..b52732d10 100644 --- a/soh/soh/Enhancements/Holiday/NotProxySaw.cpp +++ b/soh/soh/Enhancements/Holiday/NotProxySaw.cpp @@ -28,56 +28,48 @@ struct Dialog { std::vector options; }; -const std::vector dialogs = { - { // 0 - "Think you can defeat me? Foolish!", - { - {"You're lonely. You don't have to be.", 3, 1}, - {"I'm here to end this... peacefully.", 1, 2}, - {"I respect a man with ambition.", -1, 3}, - } - }, - { // 1 - "Lonely? Power's my only ally.", - { - {"There's more to you than that.", 3, 4}, - {"I get it more than you think.", 5, 4}, - {"Why not let someone in?", 2, 4}, - } - }, - { // 2 - "Peace? It's meaningless here.", - { - {"Maybe you've forgotten peace.", 2, 4}, - {"Power isn't everything.", 4, 4}, - {"Ally, not enemy.. that's my goal.", 1, 4}, - } - }, - { // 3 - "Respect? From you?", - { - {"We're not so different.", 3, 4}, - {"Maybe I admire your strength.", 5, 4}, - {"True power must be earned.", -1, 4}, - } - }, - { // 4 - "You're... different than I thought.", - { - {"Together, we'd be unstoppable.", 5, 5}, - {"Power won't bring fulfillment.", 3, 5}, - {"Let's change the world.", 4, 5}, - } - }, - { // 5 - "What if I trusted you with power?", - { - {"I'll protect it. And you.", 10, -1}, - {"Together, we're unstoppable.", 5, -1}, - {"Our way. Our history.", -3, -1}, - } - } -}; +const std::vector dialogs = { { // 0 + "Think you can defeat me? Foolish!", + { + { "You're lonely. You don't have to be.", 3, 1 }, + { "I'm here to end this... peacefully.", 1, 2 }, + { "I respect a man with ambition.", -1, 3 }, + } }, + { // 1 + "Lonely? Power's my only ally.", + { + { "There's more to you than that.", 3, 4 }, + { "I get it more than you think.", 5, 4 }, + { "Why not let someone in?", 2, 4 }, + } }, + { // 2 + "Peace? It's meaningless here.", + { + { "Maybe you've forgotten peace.", 2, 4 }, + { "Power isn't everything.", 4, 4 }, + { "Ally, not enemy.. that's my goal.", 1, 4 }, + } }, + { // 3 + "Respect? From you?", + { + { "We're not so different.", 3, 4 }, + { "Maybe I admire your strength.", 5, 4 }, + { "True power must be earned.", -1, 4 }, + } }, + { // 4 + "You're... different than I thought.", + { + { "Together, we'd be unstoppable.", 5, 5 }, + { "Power won't bring fulfillment.", 3, 5 }, + { "Let's change the world.", 4, 5 }, + } }, + { // 5 + "What if I trusted you with power?", + { + { "I'll protect it. And you.", 10, -1 }, + { "Together, we're unstoppable.", 5, -1 }, + { "Our way. Our history.", -3, -1 }, + } } }; static void ConfigurationChanged() { COND_ID_HOOK(OnActorInit, ACTOR_BOSS_GANON, CVarGetInteger(CVAR("GanonDatingSim"), 0), [](void* actorRef) { @@ -108,26 +100,25 @@ static void ConfigurationChanged() { Message_StartTextbox(gPlayState, 0x70CB, NULL); }); - COND_ID_HOOK(OnOpenText, 0x70CB, CVarGetInteger(CVAR("GanonDatingSim"), 0), [](u16 * textId, bool* loadFromMessageTable) { - std::string message; - if (dialogIndex == -1) { - if (affection >= TARGET_AFFECTION) { - message = "I've never felt this way before...\x01Take my power, Link. I trust you."; + COND_ID_HOOK( + OnOpenText, 0x70CB, CVarGetInteger(CVAR("GanonDatingSim"), 0), [](u16* textId, bool* loadFromMessageTable) { + std::string message; + if (dialogIndex == -1) { + if (affection >= TARGET_AFFECTION) { + message = "I've never felt this way before...\x01Take my power, Link. I trust you."; + } else { + message = "Liar! You're just like the rest of\x01them! Now I must destroy you!"; + } } else { - message = "Liar! You're just like the rest of\x01them! Now I must destroy you!"; + message = dialogs[dialogIndex].ganonText + "\x01\x1C" + dialogs[dialogIndex].options[0].text + "\x01" + + dialogs[dialogIndex].options[1].text + "\x01" + dialogs[dialogIndex].options[2].text; } - } else { - message = dialogs[dialogIndex].ganonText + "\x01\x1C" - + dialogs[dialogIndex].options[0].text + "\x01" - + dialogs[dialogIndex].options[1].text + "\x01" - + dialogs[dialogIndex].options[2].text; - } - auto messageEntry = CustomMessage(message); - messageEntry.Format(); - messageEntry.LoadIntoFont(); - *loadFromMessageTable = false; - }); + auto messageEntry = CustomMessage(message); + messageEntry.Format(); + messageEntry.LoadIntoFont(); + *loadFromMessageTable = false; + }); } static void DrawMenu() { diff --git a/soh/soh/Enhancements/Holiday/Pablo.cpp b/soh/soh/Enhancements/Holiday/Pablo.cpp index 08173df86..fcb821117 100644 --- a/soh/soh/Enhancements/Holiday/Pablo.cpp +++ b/soh/soh/Enhancements/Holiday/Pablo.cpp @@ -5,7 +5,7 @@ #include "src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h" extern "C" { - extern PlayState* gPlayState; +extern PlayState* gPlayState; } #define AUTHOR "Pablo" @@ -14,63 +14,21 @@ extern "C" { #pragma region Shiny static Vec3f shineSpots[12] = { - { 20.0f, 20.0f, 0.0f }, { 10.0f, 40.0f, 10.0f }, { -10.0f, 40.0f, 10.0f }, { -20.0f, 20.0f, 0.0f }, - { 10.0f, 40.0f, -10.0f }, { -10.0f, 40.0f, -10.0f }, { 0.0f, 20.0f, -20.0f }, { 10.0f, 0.0f, 10.0f }, - { 10.0f, 0.0f, -10.0f }, { 0.0f, 20.0f, 20.0f }, { -10.0f, 0.0f, 10.0f }, { -10.0f, 0.0f, -10.0f }, + { 20.0f, 20.0f, 0.0f }, { 10.0f, 40.0f, 10.0f }, { -10.0f, 40.0f, 10.0f }, { -20.0f, 20.0f, 0.0f }, + { 10.0f, 40.0f, -10.0f }, { -10.0f, 40.0f, -10.0f }, { 0.0f, 20.0f, -20.0f }, { 10.0f, 0.0f, 10.0f }, + { 10.0f, 0.0f, -10.0f }, { 0.0f, 20.0f, 20.0f }, { -10.0f, 0.0f, 10.0f }, { -10.0f, 0.0f, -10.0f }, }; static u8 shinyableActorIds[51] = { - ACTOR_EN_WALLMAS, - ACTOR_EN_ZF, - ACTOR_EN_YUKABYUN, - ACTOR_EN_WF, - ACTOR_EN_WEIYER, - ACTOR_EN_VM, - ACTOR_EN_TUBO_TRAP, - ACTOR_EN_VALI, - ACTOR_EN_TP, - ACTOR_EN_TORCH2, - ACTOR_EN_TITE, - ACTOR_EN_TEST, - ACTOR_EN_SW, - ACTOR_EN_ST, - ACTOR_EN_SKB, - ACTOR_EN_SKJ, - ACTOR_EN_PEEHAT, - ACTOR_EN_SB, - ACTOR_EN_RR, - ACTOR_EN_REEBA, - ACTOR_EN_RD, - ACTOR_EN_PO_SISTERS, - ACTOR_EN_PO_FIELD, - ACTOR_EN_POH, - ACTOR_EN_KAREBABA, - ACTOR_EN_OKUTA, - ACTOR_EN_NY, - ACTOR_EN_MB, - ACTOR_EN_IK, - ACTOR_EN_GOMA, - ACTOR_EN_GELDB, - ACTOR_EN_FZ, - ACTOR_EN_FLOORMAS, - ACTOR_EN_FIREFLY, - ACTOR_EN_FD, - ACTOR_EN_EIYER, - ACTOR_EN_DODONGO, - ACTOR_EN_DODOJR, - ACTOR_EN_DH, - ACTOR_EN_DEKUBABA, - ACTOR_EN_CROW, - ACTOR_EN_CLEAR_TAG, - ACTOR_EN_BW, - ACTOR_EN_BUBBLE, - ACTOR_EN_AM, - ACTOR_EN_BILI, - ACTOR_EN_BIGOKUTA, - ACTOR_EN_BB, - ACTOR_EN_BA, - ACTOR_EN_ANUBICE, - ACTOR_DOOR_KILLER + ACTOR_EN_WALLMAS, ACTOR_EN_ZF, ACTOR_EN_YUKABYUN, ACTOR_EN_WF, ACTOR_EN_WEIYER, ACTOR_EN_VM, + ACTOR_EN_TUBO_TRAP, ACTOR_EN_VALI, ACTOR_EN_TP, ACTOR_EN_TORCH2, ACTOR_EN_TITE, ACTOR_EN_TEST, + ACTOR_EN_SW, ACTOR_EN_ST, ACTOR_EN_SKB, ACTOR_EN_SKJ, ACTOR_EN_PEEHAT, ACTOR_EN_SB, + ACTOR_EN_RR, ACTOR_EN_REEBA, ACTOR_EN_RD, ACTOR_EN_PO_SISTERS, ACTOR_EN_PO_FIELD, ACTOR_EN_POH, + ACTOR_EN_KAREBABA, ACTOR_EN_OKUTA, ACTOR_EN_NY, ACTOR_EN_MB, ACTOR_EN_IK, ACTOR_EN_GOMA, + ACTOR_EN_GELDB, ACTOR_EN_FZ, ACTOR_EN_FLOORMAS, ACTOR_EN_FIREFLY, ACTOR_EN_FD, ACTOR_EN_EIYER, + ACTOR_EN_DODONGO, ACTOR_EN_DODOJR, ACTOR_EN_DH, ACTOR_EN_DEKUBABA, ACTOR_EN_CROW, ACTOR_EN_CLEAR_TAG, + ACTOR_EN_BW, ACTOR_EN_BUBBLE, ACTOR_EN_AM, ACTOR_EN_BILI, ACTOR_EN_BIGOKUTA, ACTOR_EN_BB, + ACTOR_EN_BA, ACTOR_EN_ANUBICE, ACTOR_DOOR_KILLER }; u8 CanBeShiny(Actor* actor) { @@ -157,7 +115,8 @@ void SpawnShinyReward(Actor* actor) { void RegisterShiny() { GameInteractor::Instance->RegisterGameHook([](void* refActor) { Actor* actor = static_cast(refActor); - if (CVarGetInteger(CVAR("Shiny.Enabled"), 0) && CanBeShiny(actor) && Rand_ZeroOne() < (1.0f / (s32)CVarGetInteger(CVAR("Shiny.Chance"), 8192))) { + if (CVarGetInteger(CVAR("Shiny.Enabled"), 0) && CanBeShiny(actor) && + Rand_ZeroOne() < (1.0f / (s32)CVarGetInteger(CVAR("Shiny.Chance"), 8192))) { ApplyShinyness(actor); } }); @@ -179,9 +138,11 @@ void RegisterShiny() { void ShinyDrawImGui() { UIWidgets::PaddedEnhancementCheckbox("Enable Shiny Enemies", CVAR("Shiny.Enabled"), true, false); - UIWidgets::Tooltip("Allows enemies to be shiny.\nShiny enemies are 25% bigger and have 4 times the health but drop the equivalent of a gold rupee upon death"); + UIWidgets::Tooltip("Allows enemies to be shiny.\nShiny enemies are 25% bigger and have 4 times the health but drop " + "the equivalent of a gold rupee upon death"); - UIWidgets::PaddedEnhancementSliderInt("Shiny Chance: %d", "##ShinyChance", CVAR("Shiny.Chance"), 1, 8192, "", 8192, true, true, false, false, ""); + UIWidgets::PaddedEnhancementSliderInt("Shiny Chance: %d", "##ShinyChance", CVAR("Shiny.Chance"), 1, 8192, "", 8192, + true, true, false, false, ""); UIWidgets::Tooltip("The chance for an enemy to be shiny is 1 / Shiny Chance"); } diff --git a/soh/soh/Enhancements/Holiday/ProxySaw.cpp b/soh/soh/Enhancements/Holiday/ProxySaw.cpp index 988ae28a9..32e6db264 100644 --- a/soh/soh/Enhancements/Holiday/ProxySaw.cpp +++ b/soh/soh/Enhancements/Holiday/ProxySaw.cpp @@ -30,11 +30,7 @@ static Vec3f snowballPos; static f32 raycastResult; static u32 iceBlockParams[] = { - 0x214, - 0x1, - 0x11, - 0x10, - 0x20, + 0x214, 0x1, 0x11, 0x10, 0x20, }; static void SpawnSnowballs() { @@ -45,21 +41,19 @@ static void SpawnSnowballs() { int actorsSpawned = 0; while (actorsSpawned < 30) { - snowballPos.x = (float)(Random( - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -10000 : -2700) + 10000, - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 5000 : 2000) + 10000 - ) - (float)10000.0f); + snowballPos.x = (float)(Random((gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -10000 : -2700) + 10000, + (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 5000 : 2000) + 10000) - + (float)10000.0f); snowballPos.y = 5000; - snowballPos.z = (float)(Random( - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -1000 : -2000) + 10000, - (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 15000 : 2000) + 10000 - ) - (float)10000.0f); + snowballPos.z = (float)(Random((gPlayState->sceneNum == SCENE_HYRULE_FIELD ? -1000 : -2000) + 10000, + (gPlayState->sceneNum == SCENE_HYRULE_FIELD ? 15000 : 2000) + 10000) - + (float)10000.0f); raycastResult = BgCheck_AnyRaycastFloor1(&gPlayState->colCtx, &snowballPoly, &snowballPos); if (raycastResult > BGCHECK_Y_MIN) { - Actor_Spawn(&gPlayState->actorCtx, gPlayState, gEnSnowballId, snowballPos.x, raycastResult, - snowballPos.z, 0, 0, 0, gPlayState->sceneNum == SCENE_HYRULE_FIELD, 0); + Actor_Spawn(&gPlayState->actorCtx, gPlayState, gEnSnowballId, snowballPos.x, raycastResult, snowballPos.z, + 0, 0, 0, gPlayState->sceneNum == SCENE_HYRULE_FIELD, 0); actorsSpawned++; } } @@ -76,15 +70,9 @@ static void SpawnIcebergs() { while (actorsSpawned < 15) { Vec3f iceBlockPos; - iceBlockPos.x = (float)(Random( - (-4200) + 10000, - (3000) + 10000 - ) - (float)10000.0f); + iceBlockPos.x = (float)(Random((-4200) + 10000, (3000) + 10000) - (float)10000.0f); iceBlockPos.y = -1713.0f; - iceBlockPos.z = (float)(Random( - (2600) + 10000, - (9000) + 10000 - ) - (float)10000.0f); + iceBlockPos.z = (float)(Random((2600) + 10000, (9000) + 10000) - (float)10000.0f); raycastResult = BgCheck_AnyRaycastFloor1(&gPlayState->colCtx, &snowballPoly, &iceBlockPos); @@ -117,36 +105,38 @@ static void SpawnIcebergs() { } const s16 entrances[] = { - 0x0000, 0x0209, 0x0004, 0x0242, 0x0028, 0x0221, 0x0169, 0x0215, 0x0165, 0x024A, 0x0010, 0x021D, 0x0082, 0x01E1, 0x0037, 0x0205, - 0x0098, 0x02A6, 0x0088, 0x03D4, 0x0008, 0x03A8, 0x0467, 0x023D, 0x0433, 0x0443, 0x0437, 0x0447, 0x009C, 0x033C, 0x00C9, 0x026A, - 0x00C1, 0x0266, 0x0043, 0x03CC, 0x045F, 0x0309, 0x03A0, 0x03D0, 0x007E, 0x026E, 0x0530, 0x01D1, 0x0507, 0x03BC, 0x0388, 0x02A2, - 0x0063, 0x01D5, 0x0528, 0x03C0, 0x043B, 0x0067, 0x02FD, 0x0349, 0x0550, 0x04EE, 0x039C, 0x0345, 0x05C8, 0x05DC, 0x0072, 0x034D, - 0x030D, 0x0355, 0x037C, 0x03FC, 0x0380, 0x03C4, 0x004F, 0x0378, 0x02F9, 0x042F, 0x05D0, 0x05D4, 0x052C, 0x03B8, 0x016D, 0x01CD, - 0x00B7, 0x0201, 0x003B, 0x0463, 0x0588, 0x057C, 0x0578, 0x0340, 0x04C2, 0x03E8, 0x04BE, 0x0482, 0x0315, 0x045B, 0x0371, 0x0394, - 0x0272, 0x0211, 0x0053, 0x0472, 0x0453, 0x0351, 0x0384, 0x044B, 0x03EC, 0x04FF, 0x0700, 0x0800, 0x0701, 0x0801, 0x0702, 0x0802, - 0x0703, 0x0803, 0x0704, 0x0804, 0x0705, 0x0805, 0x0706, 0x0806, 0x0707, 0x0807, 0x0708, 0x0808, 0x0709, 0x0809, 0x070A, 0x080A, - 0x070B, 0x080B, 0x070C, 0x080C, 0x070D, 0x080D, 0x070E, 0x080E, 0x070F, 0x080F, 0x0710, 0x0711, 0x0811, 0x0712, 0x0812, - 0x0713, 0x0813, 0x0714, 0x0814, 0x0715, 0x0815, 0x0716, 0x0816, 0x0717, 0x0817, 0x0718, 0x0818, 0x0719, 0x0819, 0x081A, - 0x071B, 0x081B, 0x071C, 0x081C, 0x071D, 0x081D, 0x071E, 0x081E, 0x071F, 0x081F, 0x0720, 0x0820, 0x004B, 0x035D, 0x031C, 0x0361, - 0x002D, 0x050B, 0x044F, 0x0359, 0x05E0, 0x020D, 0x011E, 0x0286, 0x04E2, 0x04D6, 0x01DD, 0x04DA, 0x00FC, 0x01A9, 0x0185, 0x04DE, - 0x0102, 0x0189, 0x0117, 0x018D, 0x0276, 0x01FD, 0x00DB, 0x017D, 0x00EA, 0x0181, 0x0157, 0x01F9, 0x0328, 0x0560, 0x0129, 0x022D, - 0x0130, 0x03AC, 0x0123, 0x0365, 0x00B1, 0x0033, 0x0138, 0x025A, 0x0171, 0x025E, 0x00E4, 0x0195, 0x013D, 0x0191, 0x014D, 0x01B9, - 0x0246, 0x01C1, 0x0147, 0x01BD, 0x0108, 0x019D, 0x0225, 0x01A1, 0x0219, 0x027E, 0x0554, 0x00BB, 0x0282, 0x0600, 0x04F6, 0x0604, - 0x01F1, 0x0568, 0x05F4, 0x040F, 0x0252, 0x040B, 0x00C5, 0x0301, 0x0407, 0x000C, 0x024E, 0x0305, 0x0175, 0x0417, 0x0423, 0x008D, - 0x02F5, 0x0413, 0x02B2, 0x0457, 0x047A, 0x010E, 0x0608, 0x0564, 0x060C, 0x0610, 0x0580 + 0x0000, 0x0209, 0x0004, 0x0242, 0x0028, 0x0221, 0x0169, 0x0215, 0x0165, 0x024A, 0x0010, 0x021D, 0x0082, 0x01E1, + 0x0037, 0x0205, 0x0098, 0x02A6, 0x0088, 0x03D4, 0x0008, 0x03A8, 0x0467, 0x023D, 0x0433, 0x0443, 0x0437, 0x0447, + 0x009C, 0x033C, 0x00C9, 0x026A, 0x00C1, 0x0266, 0x0043, 0x03CC, 0x045F, 0x0309, 0x03A0, 0x03D0, 0x007E, 0x026E, + 0x0530, 0x01D1, 0x0507, 0x03BC, 0x0388, 0x02A2, 0x0063, 0x01D5, 0x0528, 0x03C0, 0x043B, 0x0067, 0x02FD, 0x0349, + 0x0550, 0x04EE, 0x039C, 0x0345, 0x05C8, 0x05DC, 0x0072, 0x034D, 0x030D, 0x0355, 0x037C, 0x03FC, 0x0380, 0x03C4, + 0x004F, 0x0378, 0x02F9, 0x042F, 0x05D0, 0x05D4, 0x052C, 0x03B8, 0x016D, 0x01CD, 0x00B7, 0x0201, 0x003B, 0x0463, + 0x0588, 0x057C, 0x0578, 0x0340, 0x04C2, 0x03E8, 0x04BE, 0x0482, 0x0315, 0x045B, 0x0371, 0x0394, 0x0272, 0x0211, + 0x0053, 0x0472, 0x0453, 0x0351, 0x0384, 0x044B, 0x03EC, 0x04FF, 0x0700, 0x0800, 0x0701, 0x0801, 0x0702, 0x0802, + 0x0703, 0x0803, 0x0704, 0x0804, 0x0705, 0x0805, 0x0706, 0x0806, 0x0707, 0x0807, 0x0708, 0x0808, 0x0709, 0x0809, + 0x070A, 0x080A, 0x070B, 0x080B, 0x070C, 0x080C, 0x070D, 0x080D, 0x070E, 0x080E, 0x070F, 0x080F, 0x0710, 0x0711, + 0x0811, 0x0712, 0x0812, 0x0713, 0x0813, 0x0714, 0x0814, 0x0715, 0x0815, 0x0716, 0x0816, 0x0717, 0x0817, 0x0718, + 0x0818, 0x0719, 0x0819, 0x081A, 0x071B, 0x081B, 0x071C, 0x081C, 0x071D, 0x081D, 0x071E, 0x081E, 0x071F, 0x081F, + 0x0720, 0x0820, 0x004B, 0x035D, 0x031C, 0x0361, 0x002D, 0x050B, 0x044F, 0x0359, 0x05E0, 0x020D, 0x011E, 0x0286, + 0x04E2, 0x04D6, 0x01DD, 0x04DA, 0x00FC, 0x01A9, 0x0185, 0x04DE, 0x0102, 0x0189, 0x0117, 0x018D, 0x0276, 0x01FD, + 0x00DB, 0x017D, 0x00EA, 0x0181, 0x0157, 0x01F9, 0x0328, 0x0560, 0x0129, 0x022D, 0x0130, 0x03AC, 0x0123, 0x0365, + 0x00B1, 0x0033, 0x0138, 0x025A, 0x0171, 0x025E, 0x00E4, 0x0195, 0x013D, 0x0191, 0x014D, 0x01B9, 0x0246, 0x01C1, + 0x0147, 0x01BD, 0x0108, 0x019D, 0x0225, 0x01A1, 0x0219, 0x027E, 0x0554, 0x00BB, 0x0282, 0x0600, 0x04F6, 0x0604, + 0x01F1, 0x0568, 0x05F4, 0x040F, 0x0252, 0x040B, 0x00C5, 0x0301, 0x0407, 0x000C, 0x024E, 0x0305, 0x0175, 0x0417, + 0x0423, 0x008D, 0x02F5, 0x0413, 0x02B2, 0x0457, 0x047A, 0x010E, 0x0608, 0x0564, 0x060C, 0x0610, 0x0580 }; static void RandomGrotto_WaitOpen(DoorAna* doorAna, PlayState* play) { Actor* actor = &doorAna->actor; Player* player = GET_PLAYER(play); if (Math_StepToF(&actor->scale.x, 0.01f, 0.001f)) { - if ((actor->targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_FLOOR_DISABLED) && (player->av1.actionVar1 == 0)) { + if ((actor->targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && + (player->stateFlags1 & PLAYER_STATE1_FLOOR_DISABLED) && (player->av1.actionVar1 == 0)) { play->nextEntranceIndex = RandomElement(entrances); DoorAna_SetupAction((DoorAna*)actor, DoorAna_GrabPlayer); } else { if (!Player_InCsMode(play) && !(player->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER)) && - actor->xzDistToPlayer <= 15.0f && -50.0f <= actor->yDistToPlayer && - actor->yDistToPlayer <= 15.0f) { + actor->xzDistToPlayer <= 15.0f && -50.0f <= actor->yDistToPlayer && actor->yDistToPlayer <= 15.0f) { player->stateFlags1 |= PLAYER_STATE1_FLOOR_DISABLED; actor->targetMode = 1; } else { @@ -169,21 +159,21 @@ static void SpawnRandomGrotto() { pos.x = 0; pos.z = 0; } - // X/Z anywhere from -1000.0 to +1000.0 from player + // X/Z anywhere from -1000.0 to +1000.0 from player pos.x += (float)(Random(0, 2000)) - 1000.0f; pos.z += (float)(Random(0, 2000)) - 1000.0f; raycastResult = BgCheck_AnyRaycastFloor1(&gPlayState->colCtx, &snowballPoly, &pos); if (raycastResult > BGCHECK_Y_MIN) { - Actor* grotto = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_DOOR_ANA, pos.x, raycastResult, pos.z, 0, 0, 0, 0, false); + Actor* grotto = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_DOOR_ANA, pos.x, raycastResult, pos.z, + 0, 0, 0, 0, false); DoorAna_SetupAction((DoorAna*)grotto, RandomGrotto_WaitOpen); break; } spawnAttempts++; } - } static void ConfigurationChanged() { diff --git a/soh/soh/Enhancements/Holiday/Rando.cpp b/soh/soh/Enhancements/Holiday/Rando.cpp index e5466dccf..7ec0c1ba5 100644 --- a/soh/soh/Enhancements/Holiday/Rando.cpp +++ b/soh/soh/Enhancements/Holiday/Rando.cpp @@ -14,7 +14,7 @@ extern PlayState* gPlayState; } static void ConfigurationChanged() { - COND_ID_HOOK(OnOpenText, 0x406B, IS_RANDO, [](u16 * textId, bool* loadFromMessageTable) { + COND_ID_HOOK(OnOpenText, 0x406B, IS_RANDO, [](u16* textId, bool* loadFromMessageTable) { if (gPlayState->sceneNum != SCENE_KAKARIKO_VILLAGE) { return; } @@ -24,7 +24,8 @@ static void ConfigurationChanged() { uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); if (current < required) { - message = "The %yChristmas tree%w seems to be&missing some of %gits magic%w... Find all&ornaments to save %rChristmas%w!"; + message = "The %yChristmas tree%w seems to be&missing some of %gits magic%w... Find all&ornaments to save " + "%rChristmas%w!"; } else { message = "The tree's magic has been fully&restored. %gMerry %rChristmas%w!"; } @@ -41,9 +42,8 @@ static void RegisterMod() { ConfigurationChanged(); // #endregion - GameInteractor::Instance->RegisterGameHook([](int16_t fileNum) { - ConfigurationChanged(); - }); + GameInteractor::Instance->RegisterGameHook( + [](int16_t fileNum) { ConfigurationChanged(); }); } static Holiday holiday([]() {}, RegisterMod); diff --git a/soh/soh/Enhancements/Holiday/aMannus.cpp b/soh/soh/Enhancements/Holiday/aMannus.cpp index 8cf854b1d..70c9e90ae 100644 --- a/soh/soh/Enhancements/Holiday/aMannus.cpp +++ b/soh/soh/Enhancements/Holiday/aMannus.cpp @@ -29,32 +29,32 @@ static void ConfigurationChanged() { Player* player = GET_PLAYER(gPlayState); // Roc's Feather behaviour - if (*usedItem == ITEM_NAYRUS_LOVE) { - *should = false; + if (*usedItem == ITEM_NAYRUS_LOVE) { + *should = false; - if (!rocsUseCount) { - rocsUseCount++; - player->linearVelocity = 5.0f; - player->actor.velocity.y = 8.0f; - player->actor.world.rot.y = player->yaw = player->actor.shape.rot.y; + if (!rocsUseCount) { + rocsUseCount++; + player->linearVelocity = 5.0f; + player->actor.velocity.y = 8.0f; + player->actor.world.rot.y = player->yaw = player->actor.shape.rot.y; - func_80838940(player, (LinkAnimationHeader*)&gPlayerAnim_link_fighter_backturn_jump, - !(2 & 1) ? 5.8f : 3.5f, gPlayState, 0); + func_80838940(player, (LinkAnimationHeader*)&gPlayerAnim_link_fighter_backturn_jump, + !(2 & 1) ? 5.8f : 3.5f, gPlayState, 0); - Vec3f effectsPos = player->actor.home.pos; - effectsPos.y += 3; - f32 effectsScale = 1; - if (!gSaveContext.linkAge) { - effectsScale = 1.5f; - } - EffectSsGRipple_Spawn(gPlayState, &effectsPos, 200 * effectsScale, 300 * effectsScale, 1); - EffectSsGSplash_Spawn(gPlayState, &effectsPos, NULL, NULL, 0, 150 * effectsScale); + Vec3f effectsPos = player->actor.home.pos; + effectsPos.y += 3; + f32 effectsScale = 1; + if (!gSaveContext.linkAge) { + effectsScale = 1.5f; + } + EffectSsGRipple_Spawn(gPlayState, &effectsPos, 200 * effectsScale, 300 * effectsScale, 1); + EffectSsGSplash_Spawn(gPlayState, &effectsPos, NULL, NULL, 0, 150 * effectsScale); - player->stateFlags2 &= ~(PLAYER_STATE2_HOPPING); + player->stateFlags2 &= ~(PLAYER_STATE2_HOPPING); - Player_PlaySfx(&player->actor, NA_SE_PL_SKIP); - } - } + Player_PlaySfx(&player->actor, NA_SE_PL_SKIP); + } + } }); } diff --git a/soh/soh/Enhancements/Holiday/lilDavid.cpp b/soh/soh/Enhancements/Holiday/lilDavid.cpp index 1ed871920..4648cb2dd 100644 --- a/soh/soh/Enhancements/Holiday/lilDavid.cpp +++ b/soh/soh/Enhancements/Holiday/lilDavid.cpp @@ -13,8 +13,8 @@ extern PlayState* gPlayState; #include "src/overlays/actors/ovl_En_Bom/z_en_bom.h" extern "C" { - void func_809B45E0(EnArrow*, PlayState*); - void func_809B4640(EnArrow*, PlayState*); +void func_809B45E0(EnArrow*, PlayState*); +void func_809B4640(EnArrow*, PlayState*); } #define AUTHOR "lilDavid" @@ -49,15 +49,14 @@ static void OnConfigurationChanged() { }); COND_ID_HOOK(OnActorInit, ACTOR_EN_ARROW, CVarGetInteger(CVAR("BombArrows.Enabled"), 0), [](void* actorRef) { - EnArrow* arrow = (EnArrow*) actorRef; - if (!CVarGetInteger(CVAR("BombArrows.Active"), 0) || - arrow->actor.params != ARROW_NORMAL || AMMO(ITEM_BOMB) == 0 || - gSaveContext.minigameState == 1 || gPlayState->shootingGalleryStatus > 1) + EnArrow* arrow = (EnArrow*)actorRef; + if (!CVarGetInteger(CVAR("BombArrows.Active"), 0) || arrow->actor.params != ARROW_NORMAL || + AMMO(ITEM_BOMB) == 0 || gSaveContext.minigameState == 1 || gPlayState->shootingGalleryStatus > 1) return; - EnBom* bomb = (EnBom*) Actor_SpawnAsChild(&gPlayState->actorCtx, &arrow->actor, gPlayState, ACTOR_EN_BOM, - arrow->actor.world.pos.x, arrow->actor.world.pos.y, arrow->actor.world.pos.z, - 0, 0, 0, BOMB_BODY); + EnBom* bomb = (EnBom*)Actor_SpawnAsChild(&gPlayState->actorCtx, &arrow->actor, gPlayState, ACTOR_EN_BOM, + arrow->actor.world.pos.x, arrow->actor.world.pos.y, + arrow->actor.world.pos.z, 0, 0, 0, BOMB_BODY); if (bomb == nullptr) return; @@ -66,11 +65,11 @@ static void OnConfigurationChanged() { }); COND_ID_HOOK(OnActorUpdate, ACTOR_EN_ARROW, CVarGetInteger(CVAR("BombArrows.Enabled"), 0), [](void* actorRef) { - EnArrow* arrow = (EnArrow*) actorRef; + EnArrow* arrow = (EnArrow*)actorRef; if (!arrow->actor.child || arrow->actor.child->id != ACTOR_EN_BOM) return; - EnBom* bomb = (EnBom*) arrow->actor.child; + EnBom* bomb = (EnBom*)arrow->actor.child; bomb->actor.world.pos = arrow->actor.world.pos; f32 r = 8.0f; f32 xrot = arrow->actor.world.rot.x; @@ -88,10 +87,8 @@ static void OnConfigurationChanged() { bomb->timer = 62; } - if (arrow->actionFunc == func_809B45E0 || - arrow->actionFunc == func_809B4640 || - arrow->actor.params == ARROW_NORMAL_LIT) - { + if (arrow->actionFunc == func_809B45E0 || arrow->actionFunc == func_809B4640 || + arrow->actor.params == ARROW_NORMAL_LIT) { arrow->actor.child = nullptr; bomb->actor.parent = nullptr; bomb->timer = 2; @@ -100,14 +97,14 @@ static void OnConfigurationChanged() { }); COND_ID_HOOK(OnActorKill, ACTOR_EN_ARROW, CVarGetInteger(CVAR("BombArrows.Enabled"), 0), [](void* actorRef) { - EnArrow* arrow = (EnArrow*) actorRef; + EnArrow* arrow = (EnArrow*)actorRef; if (!arrow->actor.child || arrow->actor.child->id != ACTOR_EN_BOM) return; Actor_Kill(arrow->actor.child); }); COND_ID_HOOK(OnActorUpdate, ACTOR_EN_BOM, CVarGetInteger(CVAR("BombArrows.Enabled"), 0), [](void* actorRef) { - EnBom* bomb = (EnBom*) actorRef; + EnBom* bomb = (EnBom*)actorRef; if (!bomb->actor.parent || bomb->actor.parent->id != ACTOR_EN_ARROW) return; diff --git a/soh/soh/Enhancements/custom-collectible/CustomCollectible.cpp b/soh/soh/Enhancements/custom-collectible/CustomCollectible.cpp index 7bbbd8b55..0fdce8bd8 100644 --- a/soh/soh/Enhancements/custom-collectible/CustomCollectible.cpp +++ b/soh/soh/Enhancements/custom-collectible/CustomCollectible.cpp @@ -15,12 +15,13 @@ extern PlayState* gPlayState; } EnItem00* CustomCollectible::Spawn(f32 posX, f32 posY, f32 posZ, s16 rot, s16 flags, s16 params, ActorFunc actionFunc, - ActorFunc drawFunc) { + ActorFunc drawFunc) { if (!gPlayState) { return nullptr; } - Actor* actor = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_ITEM00, posX, posY, posZ, flags, rot, params, ITEM00_NONE, 0); + Actor* actor = Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_ITEM00, posX, posY, posZ, flags, rot, params, + ITEM00_NONE, 0); EnItem00* enItem00 = (EnItem00*)actor; if (actionFunc != NULL) { diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 24feb3148..772fdca1e 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -179,14 +179,14 @@ struct HookInfo { hookId = GameInteractor::Instance->RegisterGameHookForID(id, body); \ } \ } -#define COND_VB_SHOULD(id, condition, body) \ - { \ - static HOOK_ID hookId = 0; \ +#define COND_VB_SHOULD(id, condition, body) \ + { \ + static HOOK_ID hookId = 0; \ GameInteractor::Instance->UnregisterGameHookForID(hookId); \ - hookId = 0; \ - if (condition) { \ - hookId = REGISTER_VB_SHOULD(id, body); \ - } \ + hookId = 0; \ + if (condition) { \ + hookId = REGISTER_VB_SHOULD(id, body); \ + } \ } #define COND_HOOK(hookType, condition, body) \ diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index fd2d64a32..dd2f01549 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -657,4 +657,5 @@ void InitMods() { RegisterPatchHandHandler(); RegisterHurtContainerModeHandler(); RandoKaleido_RegisterHooks(); - RegisterHoliday();} + RegisterHoliday(); +} diff --git a/soh/soh/Enhancements/randomizer/option_descriptions.cpp b/soh/soh/Enhancements/randomizer/option_descriptions.cpp index b3ab8112b..c360cd058 100644 --- a/soh/soh/Enhancements/randomizer/option_descriptions.cpp +++ b/soh/soh/Enhancements/randomizer/option_descriptions.cpp @@ -128,9 +128,9 @@ void Settings::CreateOptionDescriptions() { "When the required amount of ornaments have been found, the game is saved and Ganon's Boss key is given " "to you when you load back into the game if you desire to beat Ganon afterwards.\n\n" "Keep in mind Ganon might not be logically beatable when \"All Locations Reachable\" is turned off."; - mOptionDescriptions[RSK_TRIFORCE_HUNT_PIECES_TOTAL] = - "The amount of Ornaments that will be placed in the world. " - "Keep in mind seed generation can fail if more ornaments are placed than there are junk items in the item pool."; + mOptionDescriptions[RSK_TRIFORCE_HUNT_PIECES_TOTAL] = "The amount of Ornaments that will be placed in the world. " + "Keep in mind seed generation can fail if more ornaments are " + "placed than there are junk items in the item pool."; mOptionDescriptions[RSK_TRIFORCE_HUNT_PIECES_REQUIRED] = "The amount of Ornaments required to win the game."; mOptionDescriptions[RSK_SHUFFLE_DUNGEON_ENTRANCES] = "Shuffle the pool of dungeon entrances, including Bottom of the Well, Ice Cavern and Gerudo Training Ground.\n" diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index b9ee217db..d34970d4d 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1316,12 +1316,12 @@ extern "C" void InitOTR(int argc, char* argv[]) { time_t now = time(NULL); tm* tm_now = localtime(&now); - //if (tm_now->tm_mon == 11 && tm_now->tm_mday >= 24 && tm_now->tm_mday <= 25) { - // CVarRegisterInteger(CVAR_GENERAL("LetItSnow"), 1); - //} else { - // CVarClear(CVAR_GENERAL("LetItSnow")); - //} - + // if (tm_now->tm_mon == 11 && tm_now->tm_mday >= 24 && tm_now->tm_mday <= 25) { + // CVarRegisterInteger(CVAR_GENERAL("LetItSnow"), 1); + // } else { + // CVarClear(CVAR_GENERAL("LetItSnow")); + // } + CVarRegisterInteger(CVAR_GENERAL("LetItSnow"), 1); CVarRegisterInteger(CVAR_COSMETIC("Hud.AButton.Changed"), 1); CVarRegisterColor(CVAR_COSMETIC("Hud.AButton.Value"), Color_RGBA8{ 255, 255, 255, 255 }); diff --git a/soh/soh/util.cpp b/soh/soh/util.cpp index 45ee1da8a..d0d09685b 100644 --- a/soh/soh/util.cpp +++ b/soh/soh/util.cpp @@ -776,7 +776,8 @@ size_t SohUtils::CopyStringToCharBuffer(char* buffer, const std::string& source, int SohUtils::CopyStringToCharBuffer(const std::string& inputStr, char* buffer, const int maxBufferSize) { if (!inputStr.empty()) { - // Prevent potential horrible overflow due to implicit conversion of maxBufferSize to an unsigned. Prevents negatives. + // Prevent potential horrible overflow due to implicit conversion of maxBufferSize to an unsigned. Prevents + // negatives. memset(buffer, 0, std::max(0, maxBufferSize)); // Gaurentee that this value will be greater than 0, regardless of passed variables. const int copiedCharLen = std::min(std::max(0, maxBufferSize - 1), inputStr.length()); diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 919401d2d..451a75a9c 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3352,7 +3352,8 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos objBankIndex = Object_GetIndex(&gPlayState->objectCtx, dbEntry->objectId); - if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || CVarGetInteger("gHoliday.Caladius.Blitz.Enabled", 0))) { + if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || + CVarGetInteger("gHoliday.Caladius.Blitz.Enabled", 0))) { objBankIndex = 0; } diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index c290447a4..5eabe0e5d 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1879,13 +1879,9 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } - //prevents getting sticks without the bag in case something got missed - if ( - IS_RANDO && - (item == ITEM_STICK || item == ITEM_STICKS_5 || item == ITEM_STICKS_10) && - Randomizer_GetSettingValue(RSK_SHUFFLE_DEKU_STICK_BAG) && - CUR_UPG_VALUE(UPG_STICKS) == 0 - ) { + // prevents getting sticks without the bag in case something got missed + if (IS_RANDO && (item == ITEM_STICK || item == ITEM_STICKS_5 || item == ITEM_STICKS_10) && + Randomizer_GetSettingValue(RSK_SHUFFLE_DEKU_STICK_BAG) && CUR_UPG_VALUE(UPG_STICKS) == 0) { return item; } @@ -4957,8 +4953,8 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { ammo = AMMO(i); if (CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0) && - gSaveContext.equips.buttonItems[button] == ITEM_BOW && - AMMO(ITEM_BOMB) != 0 && AMMO(ITEM_BOMB) < AMMO(ITEM_BOW)) { + gSaveContext.equips.buttonItems[button] == ITEM_BOW && AMMO(ITEM_BOMB) != 0 && + AMMO(ITEM_BOMB) < AMMO(ITEM_BOW)) { ammo = AMMO(ITEM_BOMB); } @@ -5597,7 +5593,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[1] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[1] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[1] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 1); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[1]], 1); @@ -5613,7 +5610,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[2] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[2] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[2] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 2); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[2]], 2); @@ -5629,7 +5627,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[3] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[3] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[3] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 3); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[3]], 3); @@ -5698,7 +5697,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[4] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadUpAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[4] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[4] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 4); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[4]], 4); @@ -5712,7 +5712,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[5] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadDownAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[5] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[5] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 5); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[5]], 5); @@ -5726,7 +5727,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[6] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadLeftAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[6] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[6] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 6); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[6]], 6); @@ -5740,7 +5742,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[7] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadRightAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - if (gSaveContext.equips.buttonItems[7] == ITEM_BOW && CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { + if (gSaveContext.equips.buttonItems[7] == ITEM_BOW && + CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0)) { Interface_DrawItemIconTexture(play, gItemIcons[ITEM_BOMB], 7); } Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[7]], 7); diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 05060b464..e4f002c92 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -12,6 +12,7 @@ #include #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" typedef struct { /* 0x00 */ u8 flag; @@ -1391,6 +1392,10 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** sLeftHandType = PLAYER_MODELTYPE_LH_CLOSED; } + if (sLeftHandType != PLAYER_MODELTYPE_LH_OPEN && sLeftHandType != PLAYER_MODELTYPE_LH_CLOSED) { + SkipOverrideNextLimb(); + } + *dList = ResourceMgr_LoadGfxByName(dLists[sDListsLodOffset]); } else if (limbIndex == PLAYER_LIMB_R_HAND) { Gfx** dLists = this->rightHandDLists; @@ -1403,8 +1408,13 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** sRightHandType = PLAYER_MODELTYPE_RH_CLOSED; } + if (sRightHandType != PLAYER_MODELTYPE_RH_OPEN && sRightHandType != PLAYER_MODELTYPE_RH_CLOSED) { + SkipOverrideNextLimb(); + } + *dList = ResourceMgr_LoadGfxByName(dLists[sDListsLodOffset]); } else if (limbIndex == PLAYER_LIMB_SHEATH) { + SkipOverrideNextLimb(); Gfx** dLists = this->sheathDLists; if ((this->sheathType == PLAYER_MODELTYPE_SHEATH_18) || (this->sheathType == PLAYER_MODELTYPE_SHEATH_19)) { @@ -1468,10 +1478,13 @@ s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, G } *dList = sFirstPersonLeftHandDLs[handOutDlIndex]; } else if (limbIndex == PLAYER_LIMB_R_SHOULDER) { + SkipOverrideNextLimb(); *dList = sFirstPersonRightShoulderDLs[gSaveContext.linkAge]; } else if (limbIndex == PLAYER_LIMB_R_FOREARM) { + SkipOverrideNextLimb(); *dList = sFirstPersonForearmDLs[gSaveContext.linkAge]; } else if (limbIndex == PLAYER_LIMB_R_HAND) { + SkipOverrideNextLimb(); s32 firstPersonWeaponIndex = gSaveContext.linkAge; if (CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), 0) || CVarGetInteger(CVAR_ENHANCEMENT("EquipmentAlwaysVisible"), 0)) { diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index a7e93e8c3..c27f68916 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -5,6 +5,7 @@ #include #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" #define ANIM_INTERP 1 @@ -45,7 +46,7 @@ void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); - if (dList != NULL) { + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, dList != NULL, &POLY_OPA_DISP, dList)) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } @@ -105,7 +106,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); - if (dList != NULL) { + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, dList != NULL, &POLY_OPA_DISP, dList)) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } @@ -121,6 +122,8 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx); + + ClearOverrideSkips(); } /** @@ -157,8 +160,10 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, MATRIX_TOMTX(*mtx); { OPEN_DISPS(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD); - gSPDisplayList(POLY_OPA_DISP++, newDList); + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, true, &POLY_OPA_DISP, newDList, *mtx)) { + gSPMatrix(POLY_OPA_DISP++, *mtx, G_MTX_LOAD); + gSPDisplayList(POLY_OPA_DISP++, newDList); + } CLOSE_DISPS(play->state.gfxCtx); } (*mtx)++; @@ -230,8 +235,10 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, if (newDList != NULL) { MATRIX_TOMTX(mtx); gDPNoOpString(POLY_OPA_DISP++, "T5ST", 0); - gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); - gSPDisplayList(POLY_OPA_DISP++, newDList); + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, true, &POLY_OPA_DISP, newDList, *mtx)) { + gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); + gSPDisplayList(POLY_OPA_DISP++, newDList); + } mtx++; } else if (limbDList != NULL) { MATRIX_TOMTX(mtx); @@ -250,6 +257,8 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx); + + ClearOverrideSkips(); } /** @@ -275,7 +284,7 @@ void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3 if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); - if (dList != NULL) { + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, dList != NULL, &POLY_OPA_DISP, dList)) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } @@ -356,7 +365,7 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); - if (dList != NULL) { + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, dList != NULL, &POLY_OPA_DISP, dList)) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dList); } @@ -373,6 +382,8 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx); + + ClearOverrideSkips(); } /** @@ -407,8 +418,10 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TOMTX(*limbMatricies); - gSPMatrix(POLY_OPA_DISP++, *limbMatricies, G_MTX_LOAD); - gSPDisplayList(POLY_OPA_DISP++, newDList); + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, true, &POLY_OPA_DISP, newDList, *limbMatricies)) { + gSPMatrix(POLY_OPA_DISP++, *limbMatricies, G_MTX_LOAD); + gSPDisplayList(POLY_OPA_DISP++, newDList); + } (*limbMatricies)++; } else if (limbDList != NULL) { MATRIX_TOMTX(*limbMatricies); @@ -476,8 +489,10 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TOMTX(mtx); - gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); - gSPDisplayList(POLY_OPA_DISP++, newDList); + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, true, &POLY_OPA_DISP, newDList, *mtx)) { + gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD); + gSPDisplayList(POLY_OPA_DISP++, newDList); + } mtx++; } else if (limbDList != NULL) { MATRIX_TOMTX(mtx); @@ -496,6 +511,8 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx); + + ClearOverrideSkips(); } /** @@ -574,7 +591,7 @@ Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &dList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); - if (dList != NULL) { + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, dList != NULL, &gfx, dList)) { gSPMatrix(gfx++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); gSPDisplayList(gfx++, dList); } @@ -630,7 +647,7 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, arg, &gfx)) { Matrix_TranslateRotateZYX(&pos, &rot); - if (dList != NULL) { + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, dList != NULL, &gfx, dList)) { gSPMatrix(gfx++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); gSPDisplayList(gfx++, dList); } @@ -646,6 +663,8 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid Matrix_Pop(); + ClearOverrideSkips(); + return gfx; } @@ -676,8 +695,10 @@ Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TOMTX(*mtx); - gSPMatrix(gfx++, *mtx, G_MTX_LOAD); - gSPDisplayList(gfx++, newDList); + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, true, &gfx, newDList, *mtx)) { + gSPMatrix(gfx++, *mtx, G_MTX_LOAD); + gSPDisplayList(gfx++, newDList); + } (*mtx)++; } else if (limbDList != NULL) { MATRIX_TOMTX(*mtx); @@ -741,8 +762,10 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { MATRIX_TOMTX(mtx); - gSPMatrix(gfx++, mtx, G_MTX_LOAD); - gSPDisplayList(gfx++, newDList); + if (GameInteractor_Should(VB_DRAW_SKEL_LIMB, true, &gfx, newDList, *mtx)) { + gSPMatrix(gfx++, mtx, G_MTX_LOAD); + gSPDisplayList(gfx++, newDList); + } mtx++; } else if (limbDList != NULL) { MATRIX_TOMTX(mtx); @@ -759,6 +782,8 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 Matrix_Pop(); + ClearOverrideSkips(); + return gfx; } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 44ad0d81f..c57ddc5f7 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -573,7 +573,8 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { Play_ChangeCameraStatus(play, this->csCamIndex, CAM_STAT_ACTIVE); this->csCamFov = 60.0f; - if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE) || IS_RANDO || IS_BOSS_RUSH || CVarGetInteger("gHoliday.NotProxySaw.GanonDatingSim", 0)) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE) || IS_RANDO || IS_BOSS_RUSH || + CVarGetInteger("gHoliday.NotProxySaw.GanonDatingSim", 0)) { // watched cutscene already, skip most of it this->csState = 17; this->csTimer = 0; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index ba63a3ae5..b0370f1a8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -14,10 +14,10 @@ #include "soh/OTRGlobals.h" #include "soh_assets.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" -#define FLAGS \ - (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ - ACTOR_FLAG_DRAW_CULLING_DISABLED) +#define FLAGS \ + (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) typedef enum { /* 0 */ THROW_NORMAL, @@ -1351,6 +1351,8 @@ s32 BossGanondrof_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, case 15: if ((this->actionFunc == BossGanondrof_Intro) && this->work[GND_MASK_OFF]) { *dList = gPhantomGanonFaceDL; + } else { + SkipOverrideNextLimb(); } rot->y += this->rideRotY[limbIndex]; rot->z += this->rideRotZ[limbIndex]; @@ -1410,6 +1412,10 @@ s32 BossGanondrof_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, break; } + if (limbIndex == 12) { + SkipOverrideNextLimb(); + } + return 0; } diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 503e41472..2982e7291 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -8,6 +8,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -1981,6 +1983,7 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f switch (limbIndex) { case BOSSGOMA_LIMB_EYE: + SkipOverrideNextLimb(); if (this->eyeState == EYESTATE_IRIS_FOLLOW_BONUS_IFRAMES && this->eyeLidBottomRotX < -0xA8C) { *dList = NULL; } else if (this->invincibilityFrames != 0) { @@ -1993,10 +1996,12 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f break; case BOSSGOMA_LIMB_EYE_LID_BOTTOM_ROOT2: + SkipOverrideNextLimb(); rot->x += this->eyeLidBottomRotX; break; case BOSSGOMA_LIMB_EYE_LID_TOP_ROOT2: + SkipOverrideNextLimb(); rot->x += this->eyeLidTopRotX; break; diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 6e1db9049..20b325824 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -15,6 +15,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER) @@ -2865,6 +2867,11 @@ s32 BossSst_OverrideHeadDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* rot->z -= 0x200; } } + + if (limbIndex == 7) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 1fee8de96..e5860c1fc 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -8,6 +8,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/Enhancements/Holiday/Archez.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ @@ -3194,6 +3195,10 @@ s32 BossTw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* } } + if (limbIndex == 14) { + SkipOverrideNextLimb(); + } + return false; } @@ -3610,6 +3615,10 @@ s32 BossTw_TwinrovaOverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, *dList = NULL; } + if (limbIndex == 34 || limbIndex == 40) { + SkipOverrideNextLimb(); + } + CLOSE_DISPS(play->state.gfxCtx); return false; diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 3e8f05776..43b18cb68 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -19,6 +19,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -3253,6 +3255,7 @@ void BossVa_Draw(Actor* thisx, PlayState* play) { break; default: if (!this->isDead) { + SkipOverrideNextSkeleton(); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, BossVa_BariOverrideLimbDraw, BossVa_BariPostLimbDraw, this); Collider_UpdateSpheres(0, &this->colliderSph); diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 15bf27f43..6bce6514e 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -13,6 +13,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED typedef enum { @@ -533,6 +535,7 @@ void DoorKiller_DrawDoor(Actor* thisx, PlayState* play) { Gfx_SetupDL_37Opa(play->state.gfxCtx); DoorKiller_SetTexture(&this->actor, play); + SkipOverrideNextSkeleton(); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, NULL, NULL); } diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c index 494e4cb14..ea191f249 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -11,6 +11,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_CAN_PRESS_SWITCHES) @@ -985,6 +987,7 @@ void EnAm_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->textureBlend); + SkipOverrideNextSkeleton(); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, EnAm_PostLimbDraw, this); if (this->iceTimer != 0) { diff --git a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index f3551a113..aee69dfe9 100644 --- a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -8,6 +8,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_gi_nuts/object_gi_nuts.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) void EnArrow_Init(Actor* thisx, PlayState* play); @@ -508,6 +510,7 @@ void EnArrow_Draw(Actor* thisx, PlayState* play) { if (this->actor.params <= ARROW_0E) { Gfx_SetupDL_25Opa(play->state.gfxCtx); + SkipOverrideNextSkeleton(); SkelAnime_DrawLod(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, this, (this->actor.projectedPos.z < MREG(95)) ? 0 : 1); } else if (this->actor.speedXZ != 0.0f) { diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 368bf865b..865498ee7 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -3,6 +3,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -869,6 +871,11 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec Matrix_Scale(1.0f, 1.25f - temp_f0, 1.25f - temp_f0, MTXMODE_APPLY); } } + + if (limbIndex == 15 || limbIndex == 16 || limbIndex == CVarGetInteger("gMyThing", 0)) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 7e77f727e..1189e1a95 100644 --- a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -287,8 +287,8 @@ void EnBom_Update(Actor* thisx, PlayState* play2) { // spawn spark effect on even frames effPos = thisx->world.pos; - if (CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0) && - thisx->parent && thisx->parent->id == ACTOR_EN_ARROW) { + if (CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0) && thisx->parent && + thisx->parent->id == ACTOR_EN_ARROW) { effPos.y += 5.0f; } else { effPos.y += 17.0f; diff --git a/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c b/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c index 2a4e02be9..b2af88423 100644 --- a/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c +++ b/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c @@ -20,11 +20,9 @@ void EnChristmasDeco_Init(Actor* thisx, PlayState* play) { } void EnChristmasDeco_Destroy(Actor* thisx, PlayState* play) { - } void EnChristmasDeco_Update(Actor* thisx, PlayState* play) { - } void EnChristmasDeco_Draw(Actor* thisx, PlayState* play) { @@ -36,7 +34,8 @@ void EnChristmasDeco_Draw(Actor* thisx, PlayState* play) { Matrix_Scale(decoSize, decoSize, decoSize, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), + G_MTX_MODELVIEW | G_MTX_LOAD); // Assertion Halt in Debug mode, switch to Release when testing. if (play->sceneNum == SCENE_KAKARIKO_VILLAGE) { diff --git a/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c b/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c index 467bc6d31..658f1737c 100644 --- a/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c +++ b/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c @@ -162,7 +162,7 @@ void EnChristmasTree_Update(Actor* thisx, PlayState* play) { void EnChristmasTree_Draw(Actor* thisx, PlayState* play) { EnChristmasTree* this = (EnChristmasTree*)thisx; - + float treeSize = 55.0f; uint8_t triforceHuntActive = Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT); float percentageCompleted = (float)gSaveContext.triforcePiecesCollected / @@ -173,7 +173,8 @@ void EnChristmasTree_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Scale(treeSize, treeSize, treeSize, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), + G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gXmasTreeDL); diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index 268355094..a22ad9a61 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -13,6 +13,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED #define DOOR_AJAR_SLAM_RANGE 120.0f @@ -345,6 +347,7 @@ void EnDoor_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL_25Opa(play->state.gfxCtx); + SkipOverrideNextSkeleton(); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnDoor_OverrideLimbDraw, NULL, &this->actor); if (this->actor.world.rot.y != 0) { if (this->actor.world.rot.y > 0) { diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index 3e306587e..353d00266 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -5,6 +5,8 @@ #include "soh/frame_interpolation.h" #include "soh/OTRGlobals.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -1054,11 +1056,15 @@ void EnGo_DrawCurledUp(EnGo* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); Matrix_Push(); - Gfx_SetupDL_25Opa(play->state.gfxCtx); - - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - - gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00BD80); + if (CVarGetInteger("gHoliday.Archez.SnowGolems", 0)) { + Matrix_Translate(0.0f, 10.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(1.75f, 1.75f, 1.75f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gSnowballDL); + } else { + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00BD80); + } Matrix_MultVec3f(&D_80A41BB4, &this->actor.focus.pos); Matrix_Pop(); @@ -1075,8 +1081,15 @@ void EnGo_DrawRolling(EnGo* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_RotateZYX((s16)(play->state.frames * ((s16)this->actor.speedXZ * 1400)), 0, this->actor.shape.rot.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00C140); + if (CVarGetInteger("gHoliday.Archez.SnowGolems", 0)) { + Matrix_Translate(0.0f, -10.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(1.75f, 1.75f, 1.75f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gSnowballDL); + } else { + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00C140); + } Matrix_MultVec3f(&D_80A41BC0, &this->actor.focus.pos); Matrix_Pop(); diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 6b3d46027..0b7b566ba 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -7,6 +7,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -2028,10 +2030,15 @@ void EnGo2_Update(Actor* thisx, PlayState* play) { s32 EnGo2_DrawCurledUp(EnGo2* this, PlayState* play) { Vec3f D_80A48554 = { 0.0f, 0.0f, 0.0f }; - OPEN_DISPS(play->state.gfxCtx); - Gfx_SetupDL_25Opa(play->state.gfxCtx); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00BD80); + if (CVarGetInteger("gHoliday.Archez.SnowGolems", 0)) { + Matrix_Translate(0.0f, 10.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(1.75f, 1.75f, 1.75f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gSnowballDL); + } else { + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00BD80); + } CLOSE_DISPS(play->state.gfxCtx); Matrix_MultVec3f(&D_80A48554, &this->actor.focus.pos); @@ -2047,8 +2054,15 @@ s32 EnGo2_DrawRolling(EnGo2* this, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); speedXZ = this->actionFunc == EnGo2_ReverseRolling ? 0.0f : this->actor.speedXZ; Matrix_RotateZYX((play->state.frames * ((s16)speedXZ * 1400)), 0, this->actor.shape.rot.z, MTXMODE_APPLY); - gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00C140); + if (CVarGetInteger("gHoliday.Archez.SnowGolems", 0)) { + Matrix_Translate(0.0f, -10.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(1.75f, 1.75f, 1.75f, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gSnowballDL); + } else { + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gGoronDL_00C140); + } CLOSE_DISPS(play->state.gfxCtx); Matrix_MultVec3f(&D_80A48560, &this->actor.focus.pos); return 1; diff --git a/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.c index cec19bafe..0b3297685 100644 --- a/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -7,6 +7,8 @@ #include "z_en_hata.h" #include "objects/object_hata/object_hata.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS 0 void EnHata_Init(Actor* thisx, PlayState* play); @@ -130,6 +132,11 @@ s32 EnHata_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* rot->y += limbs[limbIndex].y; rot->z += limbs[limbIndex].z; } + + if (limbIndex == FLAGPOLE_LIMB_POLE_BASE || limbIndex == FLAGPOLE_LIMB_POLE) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 3ca583033..5eb15a775 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -9,6 +9,8 @@ #include "vt.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED void EnHeishi1_Init(Actor* thisx, PlayState* play); @@ -495,6 +497,10 @@ s32 EnHeishi1_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 rot->x += (s16)this->headAngle; } + if (limbIndex == 15) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 192d749d4..b3461ab94 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -15,6 +15,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnHeishi2_Init(Actor* thisx, PlayState* play); @@ -832,6 +834,10 @@ s32 EnHeishi2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 } } + if (limbIndex == 15) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 924505031..52bac2511 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -9,6 +9,8 @@ #include "vt.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS 0 void EnHeishi3_Init(Actor* thisx, PlayState* play); @@ -243,6 +245,10 @@ s32 EnHeishi3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 rot->z += this->unk_264; } + if (limbIndex == 15) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index faf2bb20c..cf10b2d56 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -5,6 +5,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) void EnHeishi4_Init(Actor* thisx, PlayState* play); @@ -415,6 +417,11 @@ s32 EnHeishi_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f rot->x += this->unk_260.y; rot->z += this->unk_260.z; } + + if (limbIndex == 15) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 63388cf08..04bebae06 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -12,6 +12,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED typedef void (*EnIkDrawFunc)(struct EnIk*, PlayState*); @@ -851,6 +853,11 @@ s32 EnIk_OverrideLimbDraw3(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p *dList = NULL; } } + + if (limbIndex == 17) { + SkipOverrideNextLimb(); + } + return false; } @@ -1195,6 +1202,10 @@ s32 EnIk_OverrideLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p } } + if (limbIndex == 17) { + SkipOverrideNextLimb(); + } + return 0; } @@ -1356,6 +1367,7 @@ s32 EnIk_OverrideLimbDraw1(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p if (curFrame < 120.0f) { *dList = NULL; } else { + SkipOverrideNextLimb(); func_80A76E2C(this, play, pos); } break; diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c index 386bf816b..09b4575b1 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -10,6 +10,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) typedef enum { @@ -339,6 +341,7 @@ void EnJj_Draw(Actor* thisx, PlayState* play2) { Matrix_Translate(0.0f, (cosf(this->skelAnime.curFrame * (M_PI / 41.0f)) * 10.0f) - 10.0f, 0.0f, MTXMODE_APPLY); Matrix_Scale(10.0f, 10.0f, 10.0f, MTXMODE_APPLY); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTextures[this->eyeIndex])); + SkipOverrideNextSkeleton(); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, EnJj_PostLimbDraw, this); CLOSE_DISPS(play->state.gfxCtx); diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 78f75dabd..72e873050 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -9,6 +9,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/Holiday/Archez.h" + /* * This actor can have three behaviors: * - "Spear Guard" (variable -1): uses a spear, walks around home point, charges player if too close @@ -1553,6 +1555,22 @@ void EnMb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } } +s32 EnMb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { + EnMb* this = (EnMb*)thisx; + + if (this->actor.params == ENMB_TYPE_CLUB) { + if (limbIndex == ENMB_LIMB_LHAND) { + SkipOverrideNextLimb(); + } + } else { + if (limbIndex == ENMB_LIMB_RHAND) { + SkipOverrideNextLimb(); + } + } + + return 0; +} + void EnMb_Draw(Actor* thisx, PlayState* play) { static Vec3f frontShieldingTriModel0[] = { { 4000.0f, 7000.0f, 3500.0f }, @@ -1572,7 +1590,7 @@ void EnMb_Draw(Actor* thisx, PlayState* play) { EnMb* this = (EnMb*)thisx; Gfx_SetupDL_25Opa(play->state.gfxCtx); - SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, NULL, EnMb_PostLimbDraw, thisx); + SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnMb_OverrideLimbDraw, EnMb_PostLimbDraw, thisx); if (thisx->params != ENMB_TYPE_CLUB) { if (this->attack > ENMB_ATTACK_NONE) { diff --git a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 636c3fbcf..ad59ec1d0 100644 --- a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -183,9 +183,9 @@ void EnNutsball_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - //if ((CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) || CVarGetInteger(CVAR_GENERAL("LetItSnow"), 0)) { - // Gfx_SetupDL_25Opa(play->state.gfxCtx); - // f32 scale = 12.0f; + // if ((CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) || CVarGetInteger(CVAR_GENERAL("LetItSnow"), 0)) { + // Gfx_SetupDL_25Opa(play->state.gfxCtx); + // f32 scale = 12.0f; // gSPSegment(POLY_OPA_DISP++, 0x08, // Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, (0 - 1) % 128, 32, 32, 1, 0, (1 * -2) % 128, 32, 32)); diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 2da3efb1f..91f3b943c 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -554,7 +554,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, PlayState* play) { EffectSsHahen_SpawnBurst(play, &pos, 6.0f, 0, 1, 2, 15, 7, 10, gOctorokProjectileDL); } - //SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + // SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_PL_ICE_BROKEN); Actor_Kill(&this->actor); } @@ -767,16 +767,16 @@ void EnOkuta_Draw(Actor* thisx, PlayState* play) { } else { OPEN_DISPS(play->state.gfxCtx); - //if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) { - // Gfx_SetupDL_25Opa(play->state.gfxCtx); - // gSPSegment(POLY_OPA_DISP++, 0x08, - // Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), - // 1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6), - // 1 * (play->state.frames * 6), 32, 32)); - // Matrix_Scale(7.0f, 7.0f, 7.0f, MTXMODE_APPLY); - // Matrix_RotateX(thisx->home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY); - // gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - // gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL); + // if (CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) { + // Gfx_SetupDL_25Opa(play->state.gfxCtx); + // gSPSegment(POLY_OPA_DISP++, 0x08, + // Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), + // 1 * (play->state.frames * 6), 32, 32, 1, 1 * (play->state.frames * 6), + // 1 * (play->state.frames * 6), 32, 32)); + // Matrix_Scale(7.0f, 7.0f, 7.0f, MTXMODE_APPLY); + // Matrix_RotateX(thisx->home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY); + // gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); + // gSPDisplayList(POLY_OPA_DISP++, gSilverRockDL); if ((CVarGetInteger(CVAR_ENHANCEMENT("NewDrops"), 0) != 0) || CVarGetInteger(CVAR_GENERAL("LetItSnow"), 0)) { Gfx_SetupDL_25Opa(play->state.gfxCtx); f32 scale = 12.0f; diff --git a/soh/src/overlays/actors/ovl_En_Snowball/z_en_snowball.c b/soh/src/overlays/actors/ovl_En_Snowball/z_en_snowball.c index 1a2b9841e..e2781c891 100644 --- a/soh/src/overlays/actors/ovl_En_Snowball/z_en_snowball.c +++ b/soh/src/overlays/actors/ovl_En_Snowball/z_en_snowball.c @@ -63,7 +63,7 @@ void EnSnowball_InitCollider(EnSnowball* this, PlayState* play) { static InitChainEntry sInitChain[] = { ICHAIN_F32_DIV1000(gravity, -860, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(minVelocityY, -15000, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1500, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1500, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 150, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1500, ICHAIN_STOP), }; @@ -111,7 +111,7 @@ void EnSnowball_Update(Actor* thisx, PlayState* play) { this->collider.base.atFlags &= ~AT_HIT; // Flip the actor's rotation away from the player thisx->world.rot.y = thisx->yawTowardsPlayer + 0x8000; - + func_8002F6D4(play, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); Player_PlaySfx(&GET_PLAYER(play)->actor, NA_SE_PL_BODY_HIT); } @@ -200,7 +200,8 @@ void EnSnowball_Update(Actor* thisx, PlayState* play) { Actor_MoveXZGravity(thisx); // Prevent actor from going through the ground or walls - Actor_UpdateBgCheckInfo(play, &this->actor, MAX(10.0f, this->actor.scale.x * 250.0f), MAX(10.0f, this->actor.scale.x * 500.0f), 0.0f, 0xFF); + Actor_UpdateBgCheckInfo(play, &this->actor, MAX(10.0f, this->actor.scale.x * 250.0f), + MAX(10.0f, this->actor.scale.x * 500.0f), 0.0f, 0xFF); EnSnowball_UpdateCollider(this); // Add collision checks if the actor is a mean boulder diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index ed6f7431f..dcf48095e 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -10,6 +10,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) void EnTest_Init(Actor* thisx, PlayState* play); @@ -1845,6 +1847,10 @@ s32 EnTest_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* *dList = NULL; } + if (limbIndex == STALFOS_LIMB_SWORD || limbIndex == STALFOS_LIMB_SHIELD) { + SkipOverrideNextLimb(); + } + return false; } diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index ceca597df..241073b22 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -8,6 +8,8 @@ #include "objects/object_torch2/object_torch2.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -780,6 +782,10 @@ s32 EnTorch2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f Gfx** gfx) { Player* this = (Player*)thisx; + if (limbIndex == PLAYER_LIMB_L_HAND || limbIndex == PLAYER_LIMB_R_HAND) { + SkipOverrideNextLimb(); + } + return Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, &this->actor); } diff --git a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 4ad0e07c6..e7de92354 100644 --- a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -12,6 +12,8 @@ #include "soh/ResourceManagerHelpers.h" #include "soh_assets.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED) void EnVm_Init(Actor* thisx, PlayState* play); @@ -543,6 +545,7 @@ void EnVm_Draw(Actor* thisx, PlayState* play2) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx); + SkipOverrideNextSkeleton(); SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnVm_OverrideLimbDraw, EnVm_PostLimbDraw, this); actorPos = this->actor.world.pos; func_80033C30(&actorPos, &D_80B2EB7C, 255, play); diff --git a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 6c839b0cf..a96e7a818 100644 --- a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -458,17 +458,17 @@ void EnWood02_Draw(Actor* thisx, PlayState* play) { if ((type == WOOD_TREE_OVAL_GREEN_SPAWNER) || (type == WOOD_TREE_OVAL_GREEN_SPAWNED) || (type == WOOD_TREE_OVAL_GREEN) || (type == WOOD_LEAF_GREEN)) { - //red = 50; - //green = 170; - //blue = 70; + // red = 50; + // green = 170; + // blue = 70; red = 255; green = 255; blue = 255; } else if ((type == WOOD_TREE_OVAL_YELLOW_SPAWNER) || (type == WOOD_TREE_OVAL_YELLOW_SPAWNED) || (type == WOOD_LEAF_YELLOW)) { - //red = 180; - //green = 155; - //blue = 0; + // red = 180; + // green = 155; + // blue = 0; red = 255; green = 255; blue = 255; diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 99d9fba48..b213d5114 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -9,6 +9,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/Holiday/Archez.h" + #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) void EnZf_Init(Actor* thisx, PlayState* play); @@ -2130,11 +2132,13 @@ s32 EnZf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po rot->y -= this->headRot; break; case ENZF_LIMB_SWORD: + SkipOverrideNextLimb(); if (this->swordSheathed) { *dList = gZfEmptyHandDL; } break; case ENZF_LIMB_SCABBARD: + SkipOverrideNextLimb(); if (this->swordSheathed) { *dList = gZfSheathedSwordDL; } @@ -2431,4 +2435,4 @@ s32 EnZf_DodgeRangedWaiting(PlayState* play, EnZf* this) { void EnZf_Reset(void) { D_80B4A1B0 = 0; D_80B4A1B4 = 1; -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c index 17a17360f..a32eae631 100644 --- a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -84,34 +84,42 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { if ((frameCount > 850 || isKak) && (this->ootAlpha < 200)) { this->ootAlpha += 15; } - + OVERLAY_DISP = Gfx_SetupDL_64(OVERLAY_DISP); - + if (this->actor.params == 2) { gSPGrayscale(OVERLAY_DISP++, false); gDPSetTextureLUT(OVERLAY_DISP++, G_TT_NONE); gDPSetEnvColor(OVERLAY_DISP++, 0, 255, 0, 0); gDPSetRenderMode(OVERLAY_DISP++, G_RM_PASS, G_RM_XLU_SURF2); - gSPClearGeometryMode(OVERLAY_DISP++, G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR); - gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); + gSPClearGeometryMode(OVERLAY_DISP++, G_TEXTURE_ENABLE | G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | + G_TEXTURE_GEN_LINEAR); + gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, + COMBINED, 0, 0, 0, COMBINED); gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->endAlpha); - gDPLoadTextureTile(OVERLAY_DISP++, sTheEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 80, 24, 0, 0, 80 - 1, 24 - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); - gSPTextureRectangle(OVERLAY_DISP++, 120 << 2, 90 << 2, 200 << 2, 113 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gDPLoadTextureTile(OVERLAY_DISP++, sTheEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 80, 24, 0, 0, 80 - 1, 24 - 1, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gSPTextureRectangle(OVERLAY_DISP++, 120 << 2, 90 << 2, 200 << 2, 113 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, + 1 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->tlozAlpha); - gDPLoadTextureTile(OVERLAY_DISP++, sTheLegendOfZeldaTex, G_IM_FMT_IA, G_IM_SIZ_8b, 120, 24, 0, 0, 120 - 1, 24 - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); - gSPTextureRectangle(OVERLAY_DISP++, 100 << 2, 160 << 2, 220 << 2, 183 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gDPLoadTextureTile(OVERLAY_DISP++, sTheLegendOfZeldaTex, G_IM_FMT_IA, G_IM_SIZ_8b, 120, 24, 0, 0, 120 - 1, + 24 - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gSPTextureRectangle(OVERLAY_DISP++, 100 << 2, 160 << 2, 220 << 2, 183 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, + 1 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->ootAlpha); - gDPLoadTextureTile(OVERLAY_DISP++, sOcarinaOfTimeTex, G_IM_FMT_IA, G_IM_SIZ_8b, 112, 16, 0, 0, 112 - 1, 16 - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); - gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - - gVisMonoColor.a = 0; - //D_801614B0.r = 205; - //D_801614B0.g = 168; - //D_801614B0.b = 130; + gDPLoadTextureTile(OVERLAY_DISP++, sOcarinaOfTimeTex, G_IM_FMT_IA, G_IM_SIZ_8b, 112, 16, 0, 0, 112 - 1, 16 - 1, + 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); + gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, + 1 << 10); - //gSPGrayscale(OVERLAY_DISP++, true); + gVisMonoColor.a = 0; + // D_801614B0.r = 205; + // D_801614B0.g = 168; + // D_801614B0.b = 130; + + // gSPGrayscale(OVERLAY_DISP++, true); } else if (gVisMonoColor.a > 0) { gSPGrayscale(OVERLAY_DISP++, false); gDPSetTextureLUT(OVERLAY_DISP++, G_TT_NONE); 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 4bae31e5d..55fd5a353 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -7340,20 +7340,16 @@ s32 Player_ActionHandler_2(Player* this, PlayState* play) { Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || IS_RANDO; // Only skip cutscenes for drops when they're items/consumables from bushes/rocks/enemies. - uint8_t isDropToSkip = - ( - interactedActor->id == ACTOR_EN_ITEM00 && - interactedActor->params != ITEM00_HEART_PIECE && - interactedActor->params != ITEM00_SMALL_KEY && - interactedActor->params != ITEM00_NONE && - interactedActor->params != ITEM00_SOH_GIVE_ITEM_ENTRY && - interactedActor->params != ITEM00_SOH_GIVE_ITEM_ENTRY_GI - ) || - interactedActor->id == ACTOR_EN_KAREBABA || - interactedActor->id == ACTOR_EN_DEKUBABA; + uint8_t isDropToSkip = + (interactedActor->id == ACTOR_EN_ITEM00 && interactedActor->params != ITEM00_HEART_PIECE && + interactedActor->params != ITEM00_SMALL_KEY && interactedActor->params != ITEM00_NONE && + interactedActor->params != ITEM00_SOH_GIVE_ITEM_ENTRY && + interactedActor->params != ITEM00_SOH_GIVE_ITEM_ENTRY_GI) || + interactedActor->id == ACTOR_EN_KAREBABA || interactedActor->id == ACTOR_EN_DEKUBABA; - // Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before. - // But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places. + // Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player + // never picked it up before. But only for bushes/rocks/enemies because otherwise it can lead to + // softlocks in deku mask theatre and potentially other places. uint8_t skipItemCutscene = CVarGetInteger(CVAR_ENHANCEMENT("FastDrops"), 0) && isDropToSkip; // Same as above but for rando. Rando is different because we want to enable cutscenes for items that diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index b6304a15d..1cc0af7bd 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -1198,12 +1198,12 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { } u8 equipped_slot = gSaveContext.equips.cButtonSlots[pauseCtx->equipTargetCBtn]; if (!CVarGetInteger("gHoliday.lilDavid.BombArrows.Active", 0) && - pauseCtx->equipTargetItem == ITEM_BOMB && equipped_slot == SLOT_BOW) - { + pauseCtx->equipTargetItem == ITEM_BOMB && equipped_slot == SLOT_BOW) { CVarSetInteger("gHoliday.lilDavid.BombArrows.Active", 1); pauseCtx->equipTargetItem = ITEM_BOW; pauseCtx->equipTargetSlot = SLOT_BOW; - Audio_PlaySoundGeneral(NA_SE_SY_SET_FIRE_ARROW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); + Audio_PlaySoundGeneral(NA_SE_SY_SET_FIRE_ARROW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } }