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 000000000..73bcf2a59
Binary files /dev/null and b/soh/assets/custom/objects/custom_snowball/LightNoise.rgba32 differ
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