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
6 changes: 6 additions & 0 deletions Data/CrestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public class CrestData
public string name = "";
public bool UnlockedAtStart = true;

/// <summary>
/// Sets whether or not this crest's tool slots count towards Eva's unlocks
/// and quest progression. Default is <see langword="false"/>.
/// </summary>
public bool slotsCountForEvaQuest = false;

public LocalisedString displayName;
public LocalisedString description;

Expand Down
30 changes: 30 additions & 0 deletions Patches/EvaProgressionOptOut.cs
Original file line number Diff line number Diff line change
@@ -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<ToolCrestList>();

HashSet<ToolCrest> 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;
}
}