From 1d5e5f82e117d1d98fe11ba3d8ed46d4e6606141 Mon Sep 17 00:00:00 2001 From: kaycodes13 Date: Fri, 6 Feb 2026 15:45:14 -0500 Subject: [PATCH] add eva quest progression patch --- Data/CrestData.cs | 6 ++++++ Patches/EvaProgressionOptOut.cs | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Patches/EvaProgressionOptOut.cs diff --git a/Data/CrestData.cs b/Data/CrestData.cs index d23a665..faf808b 100644 --- a/Data/CrestData.cs +++ b/Data/CrestData.cs @@ -23,6 +23,12 @@ public class CrestData public string name = ""; public bool UnlockedAtStart = true; + /// + /// Sets whether or not this crest's tool slots count towards Eva's unlocks + /// and quest progression. Default is . + /// + public bool slotsCountForEvaQuest = false; + public LocalisedString displayName; public LocalisedString description; diff --git a/Patches/EvaProgressionOptOut.cs b/Patches/EvaProgressionOptOut.cs new file mode 100644 index 0000000..155fe43 --- /dev/null +++ b/Patches/EvaProgressionOptOut.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using HutongGames.PlayMaker.Actions; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace Needleforge.Patches; + +[HarmonyPatch(typeof(CountCrestUnlockPoints), nameof(CountCrestUnlockPoints.OnEnter))] +internal static class EvaProgressionOptOut +{ + private static void Prefix(CountCrestUnlockPoints __instance) + { + ToolCrestList list = ScriptableObject.CreateInstance(); + + HashSet crestsToRemove = [.. + from x in NeedleforgePlugin.newCrestData + where !x.slotsCountForEvaQuest + select x.ToolCrest! + ]; + + foreach (ToolCrest crest in (ToolCrestList)__instance.CrestList.Value) + { + if (!crestsToRemove.Contains(crest)) + list.Add(crest); + } + + __instance.CrestList.Value = list; + } +}