Add Terminal patch to make Hookah unlockable always available in shop
This commit is contained in:
parent
be62175767
commit
b6f0901063
|
|
@ -0,0 +1,22 @@
|
|||
using HarmonyLib;
|
||||
using System.Linq;
|
||||
using Dawn;
|
||||
|
||||
namespace HookahPlace;
|
||||
|
||||
[HarmonyPatch(typeof(Terminal))]
|
||||
internal static class TerminalPatch
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("Update")]
|
||||
private static void UpdatePatch(Terminal __instance)
|
||||
{
|
||||
var hookahNode = LethalContent.Unlockables[HookahPlaceKeys.Hookah].UnlockableItem.shopSelectionNode;
|
||||
|
||||
if (!__instance.ShipDecorSelection.Any(node => node.shipUnlockableID == hookahNode.shipUnlockableID))
|
||||
{
|
||||
HookahPlace.Logger.LogInfo($"Patching terminal selection list {hookahNode.shipUnlockableID}");
|
||||
__instance.ShipDecorSelection = [.. __instance.ShipDecorSelection, hookahNode];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue