Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/oot.ld
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ SECTIONS
gRandFloat = 0x50C0C8 + _LD_OFF;
NaviColorsArray = 0x50C998 + _LD_OFF;
gActorOverlayTable = 0x50CD84 + _LD_OFF;
gGanondorfBlood = 0x514F78 + _LD_OFF;
gGanonBlood = 0x515194 + _LD_OFF;
EnChanger_LoserGetItemIds = 0x521774 + _LD_OFF;
VanillaScrubTable = 0x522384 + _LD_OFF;
EnGirlA_ShopItemEntries = 0x524F50 + _LD_OFF;
Expand Down
11 changes: 11 additions & 0 deletions code/src/effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
#include "colors.h"
#include "objects.h"

void Effects_Init(void) {
// Blood effect color for Ganondorf and Ganon defeat cutscenes
typedef struct {
Color_RGBA8 primary;
Color_RGBA8 environ;
} BloodCol;
extern BloodCol gGanondorfBlood, gGanonBlood;
Color_RGBA8 col = gSettingsContext.ganonBloodColor;
gGanondorfBlood = gGanonBlood = (BloodCol){ col, col };
}

// This function is called when a new effect element tries to spawn but there's no space left.
// The vanilla game simply fails to spawn the new element, but with the randomizer extended duration setting,
// it is best to clear the oldest element to make space instead.
Expand Down
1 change: 1 addition & 0 deletions code/src/effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "z3D/z3D.h"

void Effects_Init(void);
void EffectSs_ClearAllWithMissingObject(void);

#endif //_EFFECTS_H_
2 changes: 2 additions & 0 deletions code/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "actor.h"
#include "input.h"
#include "models.h"
#include "effects.h"
#include "entrance.h"
#include "settings.h"
#include "title_screen.h"
Expand Down Expand Up @@ -39,6 +40,7 @@ void Randomizer_Init() {
IceTrap_Init();
extDataInit();
irrstInit();
Effects_Init();

s64 output = 0;
svcGetSystemInfo(&output, 0x20000, 0);
Expand Down
1 change: 1 addition & 0 deletions shared/s_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ typedef struct SettingsContext {
u8 rainbowChuTrailInnerColor;
u8 rainbowChuTrailOuterColor;
u8 bombchuTrailDuration;
Color_RGBA8 ganonBloodColor;

u8 coloredKeys;
u8 coloredBossKeys;
Expand Down
16 changes: 16 additions & 0 deletions source/cosmetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@ const std::array<std::string_view, 13> weaponTrailColors = {
"FF69B4", // Pink
"FF0000", // Rainbow (starts at red)
};
const std::array<std::string_view, 14> ganonBloodColors = {
"007800", // Vanilla Green
"780000", // Original Red
"FFFFFF", // White
"000000", // Black
"FF0000", // Red
"00FF00", // Green
"0000FF", // Blue
"FFFF00", // Yellow
"00FFFF", // Cyan
"FF00FF", // Magenta
"FFA500", // Orange
"FFD700", // Gold
"800080", // Purple
"FF69B4", // Pink
};

// Generate random hex color
std::string RandomColor() {
Expand Down
1 change: 1 addition & 0 deletions source/cosmetics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ extern const std::array<std::string_view, 29> tunicColors;
extern const std::array<std::string_view, 20> naviInnerColors;
extern const std::array<std::string_view, 20> naviOuterColors;
extern const std::array<std::string_view, 13> weaponTrailColors;
extern const std::array<std::string_view, 14> ganonBloodColors;

bool ValidHexString(std::string_view hexStr);
Color_RGBAf HexStrToColorRGBAf(const std::string& hexStr);
Expand Down
27 changes: 27 additions & 0 deletions source/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,26 @@ static std::vector<std::string> chuTrailDurationOptionNames = {
"Hero's Path",
};

static std::vector<std::string> ganonBloodOptionNames = {
std::string(RANDOM_CHOICE_STR),
std::string(RANDOM_COLOR_STR),
std::string(CUSTOM_COLOR_STR),
"Vanilla Green",
"Original Red",
"White",
"Black",
"Red",
"Green",
"Blue",
"Yellow",
"Cyan",
"Magenta",
"Orange",
"Gold",
"Purple",
"Pink",
};

static std::vector<std::string_view> cosmeticDescriptions = {
RANDOM_CHOICE_DESC,
RANDOM_COLOR_DESC,
Expand Down Expand Up @@ -1268,6 +1288,7 @@ Option BoomerangTrailDuration = Option::U8 (2, "Boomerang (Duration)", tra
Option BombchuTrailInnerColor = Option::U8 (2, "Bombchu (Inner Color)", weaponTrailInnerOptionNames, {RANDOM_CHOICE_DESC, RANDOM_COLOR_DESC, CUSTOM_COLOR_DESC, "Select the color for the center of the\nbombchu trail."}, OptionCategory::Cosmetic, 5); // Red
Option BombchuTrailOuterColor = Option::U8 (2, "Bombchu (Outer Color)", weaponTrailOuterOptionNames, {RANDOM_CHOICE_DESC, RANDOM_COLOR_DESC, CUSTOM_COLOR_DESC, "Select the color for the sides of the\nbombchu trail."}, OptionCategory::Cosmetic, SAME_AS_INNER_TRAIL);
Option BombchuTrailDuration = Option::U8 (2, "Bombchu (Duration)", chuTrailDurationOptionNames, {"Select the duration for bombchu trails."}, OptionCategory::Cosmetic, 2); // Vanilla
Option GanonBloodColor = Option::U8 ("Ganon/dorf Blood Color", ganonBloodOptionNames, {RANDOM_CHOICE_DESC, RANDOM_COLOR_DESC, CUSTOM_COLOR_DESC, "Select the color of Ganondorf and Ganon's blood."}, OptionCategory::Cosmetic, 3); // Vanilla Green
std::string finalChildTunicColor = ChildTunicColor.GetSelectedOptionText();
std::string finalKokiriTunicColor = KokiriTunicColor.GetSelectedOptionText();
std::string finalGoronTunicColor = GoronTunicColor.GetSelectedOptionText();
Expand All @@ -1288,6 +1309,7 @@ Color_RGBA8 finalBoomerangColor = {0};
u8 boomerangTrailColorMode = 0;
std::string finalChuTrailInnerColor = BombchuTrailInnerColor.GetSelectedOptionText();
std::string finalChuTrailOuterColor = BombchuTrailOuterColor.GetSelectedOptionText();
Color_RGBA8 finalGanonBloodColor = { 0, 120, 0, 255 };

Option ColoredKeys = Option::Bool("Colored Small Keys", {"Off", "On"}, {coloredKeysDesc}, OptionCategory::Cosmetic);
Option ColoredBossKeys = Option::Bool("Colored Boss Keys", {"Off", "On"}, {coloredBossKeysDesc}, OptionCategory::Cosmetic);
Expand Down Expand Up @@ -1322,6 +1344,7 @@ std::vector<Option *> cosmeticOptions = {
&BombchuTrailInnerColor,
&BombchuTrailOuterColor,
&BombchuTrailDuration,
&GanonBloodColor,
&ColoredKeys,
&ColoredBossKeys,
&MirrorWorld,
Expand Down Expand Up @@ -1684,6 +1707,7 @@ SettingsContext FillContext() {
ctx.rainbowChuTrailInnerColor = (BombchuTrailInnerColor.Value<u8>() == RAINBOW_TRAIL) ? 1 : 0;
ctx.rainbowChuTrailOuterColor = (BombchuTrailOuterColor.Value<u8>() == RAINBOW_TRAIL) ? 1 : 0;
ctx.bombchuTrailDuration = BombchuTrailDuration.Value<u8>();
ctx.ganonBloodColor = finalGanonBloodColor;
ctx.mirrorWorld = MirrorWorld.Value<u8>();
ctx.coloredKeys = (ColoredKeys) ? 1 : 0;
ctx.coloredBossKeys = (ColoredBossKeys) ? 1 : 0;
Expand Down Expand Up @@ -3085,6 +3109,9 @@ static void UpdateCosmetics() {
} else {
ChooseFinalColor(BombchuTrailOuterColor, finalChuTrailOuterColor, weaponTrailColors);
}
// Ganon/dorf Blood
ChooseFinalColor(GanonBloodColor, tempString, ganonBloodColors);
finalGanonBloodColor = Cosmetics::HexStrToColorRGBA8(tempString);
}

// Function to set flags depending on settings
Expand Down