Randomizer feature: Triforce Hunt (#3062)

* Initial work to make triforce pieces their own rando item

* Disable triforce greyscaling

* Better triforce model, finish adding triforce pieces to logic

* Triforce model is now a shard

* Credits warp + start of item tracker

* Initial item tracker stuff

* Completed triangle on triforce completion

* Completed triforce model on GI done

* Multiple triforce piece models

* Triforce pieces in save editor & fix build

* Finish item tracker

* Gameplaystats timestamp

* Revert parts of logic

* More reverting

* Start of making Triforce Hunt the win condition

* Bit of cleanup

* Triforce pieces can show up as icetraps

* Grant GBK to player after hunt is completed

* Better text boxes

* Disable GBK option in ImGui with Triforce Hunt on

* Clean-up

* Forced save on completion improvements

* Update Item Tracker Settings initial size

* Small ImGui adjustments

* French translation and update defaults

* Finish translations

* Fix timer completion & 50+ triforce pieces

* Remove GI_ and ITEM_ enum usage, add french ice trap names

* Fix build & small fixes

* Review comments

* Comment clarification
This commit is contained in:
aMannus
2023-09-26 15:45:37 +02:00
committed by GitHub
parent ccd05d8e58
commit bae6cf4203
75 changed files with 1364 additions and 27 deletions

View File

@@ -10,6 +10,7 @@
#include <string>
#include <libultraship/bridge.h>
#include <libultraship/libultraship.h>
#include "soh_assets.h"
extern "C" {
#include <z64.h>
@@ -144,6 +145,10 @@ std::map<uint32_t, ItemMapEntry> gregMapping = {
{ITEM_RUPEE_GREEN, {ITEM_RUPEE_GREEN, "ITEM_RUPEE_GREEN", "ITEM_RUPEE_GREEN_Faded", gRupeeCounterIconTex}}
};
std::map<uint32_t, ItemMapEntry> triforcePieceMapping = {
{RG_TRIFORCE_PIECE, {RG_TRIFORCE_PIECE, "RG_TRIFORCE_PIECE", "RG_TRIFORCE_PIECE_Faded", gTriforcePieceTex}}
};
// Maps entries in the GS flag array to the area name it represents
std::vector<std::string> gsMapping = {
"Deku Tree",
@@ -509,6 +514,10 @@ void DrawInfoTab() {
}
UIWidgets::InsertHelpHoverText("Z-Targeting behavior");
if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT)) {
ImGui::InputScalar("Triforce Pieces", ImGuiDataType_U16, &gSaveContext.triforcePiecesCollected);
UIWidgets::InsertHelpHoverText("Currently obtained Triforce Pieces. For Triforce Hunt.");
}
ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
static std::array<const char*, 7> minigameHS = { "Horseback Archery",
@@ -1790,6 +1799,10 @@ void SaveEditorWindow::InitElement() {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen);
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
}
for (const auto& entry : triforcePieceMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
}
for (const auto& entry : questMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));