using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CellMenu;
using ExtraObjectiveSetup.ExtendedWardenEvents;
using GTFO.API;
using GameData;
using Gear;
using HarmonyLib;
using Il2CppSystem;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using Overload.CustomGearBehavior;
using Overload.CustomLevelBehavior;
using Overload.GUIMods;
using Overload.Utils;
using TMPro;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Overload")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Overload")]
[assembly: AssemblyTitle("Overload")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace Overload
{
[HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")]
internal static class Patch_CustomOverloadWatermark
{
public static void Postfix(PUI_Watermark __instance)
{
string text = "4.6.1+gitf831086-dirty-main".Remove("x.x.x".Length);
((TMP_Text)__instance.m_watermarkText).SetText("<color=red>MODDED</color> <color=orange>" + text + "</color>\n" + string.Empty + "<color=#7C0805>OVERLOAD</color><color=orange> 1.1.0</color>", true);
}
}
[BepInPlugin("Overload", "Overload", "2.0.0")]
public class Plugin : BasePlugin
{
public override void Load()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
ManualLogSource log = ((BasePlugin)this).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(34, 0, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Overload Has launched successfully");
}
log.LogInfo(val);
AssetAPI.OnAssetBundlesLoaded += RegisterTypes;
GUIPatches.Setup();
ToolPatches.Setup();
CustomWardenEvents.Setup();
}
private static void RegisterTypes()
{
CustomLevelManager.Setup();
}
}
}
namespace Overload.Utils
{
internal static class CustomWardenEvents
{
public enum CustomWOEvents
{
Set_Map_State = 5001
}
public static void Setup()
{
Harmony.CreateAndPatchAll(typeof(Patch_CM_PageMap_OnEnable), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_GS_AfterLevel_CleanupAfterExpedition), (string)null);
Init();
Log.Info("Custom Warden Events setup");
}
internal static void SetMapState(WardenObjectiveEventData e)
{
Patch_CM_PageMap_OnEnable.MapEnabled = e.Enabled;
}
internal static void Init()
{
EOSWardenEventManager.Current.AddEventDefinition(CustomWOEvents.Set_Map_State.ToString(), 5001u, (Action<WardenObjectiveEventData>)SetMapState);
}
public static void CleanupEventState()
{
Patch_CM_PageMap_OnEnable.MapEnabled = true;
Log.Info("Cleaning up Warden Event states");
}
}
[HarmonyPatch(typeof(CM_PageMap), "OnEnable")]
internal class Patch_CM_PageMap_OnEnable
{
public static bool MapEnabled = true;
public static void Postfix(CM_PageMap __instance)
{
if (!MapEnabled)
{
__instance.SetMapVisualsIsActive(false);
__instance.SetMapDisconnetedTextIsActive(true);
}
}
}
[HarmonyPatch(typeof(GS_AfterLevel), "CleanupAfterExpedition")]
internal class Patch_GS_AfterLevel_CleanupAfterExpedition
{
public static void Prefix()
{
CustomWardenEvents.CleanupEventState();
}
}
internal static class Log
{
private static readonly ManualLogSource _logger;
static Log()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Expected O, but got Unknown
_logger = new ManualLogSource("RLC.Overload");
Logger.Sources.Add((ILogSource)(object)_logger);
}
private static string Format(object msg)
{
return msg.ToString();
}
public static void Info(object data)
{
_logger.LogMessage((object)Format(data));
}
public static void Verbose(object data)
{
_logger.LogDebug((object)Format(data));
}
public static void Debug(object data)
{
_logger.LogDebug((object)Format(data));
}
public static void Error(object data)
{
_logger.LogError((object)Format(data));
}
}
}
namespace Overload.GUIMods
{
public class GUIPatches
{
public static void Setup()
{
Harmony.CreateAndPatchAll(typeof(Patch_CM_PageRundown_New_ResetElements), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_CM_PageRundown_New_Update), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_BoosterImplantSlotHolder_Setup), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_CM_ExpeditionIcon_New_SetArtifactHeat), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_PUI_LocalPlayerStatus_Setup), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_PUI_Watermark_UpdateWatermark), (string)null);
Harmony.CreateAndPatchAll(typeof(Patch_CM_RundownTierMarker_Setup), (string)null);
Log.Info("GUIPatches Setup");
}
}
[HarmonyPatch(typeof(CM_PageRundown_New), "ResetElements")]
internal class Patch_CM_PageRundown_New_ResetElements
{
public static void Postfix(CM_PageRundown_New __instance)
{
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Unknown result type (might be due to invalid IL or missing references)
//IL_0364: Unknown result type (might be due to invalid IL or missing references)
//IL_043a: Unknown result type (might be due to invalid IL or missing references)
//IL_0472: Unknown result type (might be due to invalid IL or missing references)
((Component)__instance.m_textRundownHeader).gameObject.SetActive(true);
((Component)((Component)__instance).transform.GetChild(2).GetChild(3).GetChild(1)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(1)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(2)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(3)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(4)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(5)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(7)
.GetChild(0)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(1)
.GetChild(1)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(2)
.GetChild(1)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(3)
.GetChild(1)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(4)
.GetChild(1)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(5)
.GetChild(1)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(7)
.GetChild(2)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(0)).transform.localPosition = new Vector3(-300f, 100f, 0f);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(0)).transform.localScale = new Vector3(3f, 3f, 3f);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(6)).transform.localPosition = new Vector3(350f, 0f, 0f);
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(6)).transform.localScale = new Vector3(2f, 2f, 2f);
((TMP_Text)((Component)((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(0)).GetComponent<CM_RundownSelection>().m_altText).GetComponent<TextMeshPro>()).text = "";
((TMP_Text)((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(0)).GetComponent<CM_RundownSelection>().m_rundownText).text = "<size=65%><color=red>0verload 1</color></size>";
((TMP_Text)((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(6)).GetComponent<CM_RundownSelection>().m_rundownText).text = "Overload 2";
((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(0)).GetComponent<BoxCollider2D>().size = new Vector2(150f, 200f);
((Collider2D)((Component)((Component)__instance).transform.GetChild(2).GetChild(4).GetChild(16)
.GetChild(0)).GetComponent<BoxCollider2D>()).offset = new Vector2(0f, -50f);
}
}
[HarmonyPatch(typeof(CM_PageRundown_New), "Update")]
internal class Patch_CM_PageRundown_New_Update
{
public static void Postfix(CM_PageRundown_New __instance)
{
((RectTransformComp)__instance.m_discordButton).SetVisible(false);
((RectTransformComp)__instance.m_matchmakeAllButton).SetVisible(false);
((RectTransformComp)__instance.m_aboutTheRundownButton).SetVisible(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(3).GetChild(8)).gameObject.SetActive(false);
((Component)((Component)__instance).transform.GetChild(2).GetChild(3).GetChild(9)).gameObject.SetActive(false);
}
}
[HarmonyPatch(typeof(CM_RundownTierMarker), "Setup")]
internal class Patch_CM_RundownTierMarker_Setup
{
public static void Postfix(CM_RundownTierMarker __instance)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
((Transform)((Component)__instance).GetComponent<RectTransform>()).localPosition = new Vector3(220f, 34.4f, 0f);
((Component)((Component)__instance).transform.GetChild(0).GetChild(0)).gameObject.SetActive(false);
}
}
[HarmonyPatch(typeof(CM_BoosterImplantSlotHolder), "Setup")]
internal class Patch_BoosterImplantSlotHolder_Setup
{
public static void Prefix(CM_BoosterImplantSlotHolder __instance)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
RectTransform component = ((Component)__instance).GetComponent<RectTransform>();
if ((Object)(object)component != (Object)null)
{
component.anchoredPosition = new Vector2(1f, 2000f);
component.sizeDelta = new Vector2(1f, 2000f);
((Transform)component).localScale = new Vector3(1f, 1f, 1f);
}
}
}
[HarmonyPatch(typeof(CM_ExpeditionIcon_New), "SetArtifactHeat")]
internal class Patch_CM_ExpeditionIcon_New_SetArtifactHeat
{
public static void Postfix(CM_ExpeditionIcon_New __instance)
{
((TMP_Text)__instance.m_artifactHeatText).SetText("", true);
}
}
[HarmonyPatch(typeof(PUI_LocalPlayerStatus), "Start")]
internal class Patch_PUI_LocalPlayerStatus_Setup
{
public static void Postfix(PUI_LocalPlayerStatus __instance)
{
((Component)((Component)__instance).transform.GetChild(6)).gameObject.SetActive(false);
}
}
[HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")]
internal class Patch_PUI_Watermark_UpdateWatermark
{
public static void Postfix(PUI_Watermark __instance)
{
string text = "<color=#7C0805>OVERLOAD</color><color=orange> V2.0.0</color>";
string text2 = "4.6.2+gitf831086-dirty-main".Remove("x.x.x".Length);
((TMP_Text)__instance.m_watermarkText).SetText("<color=red>MODDED</color> <color=orange>" + text2 + "</color>\n" + string.Empty + text, true);
}
}
}
namespace Overload.CustomLevelBehavior
{
public class CustomLevelManager
{
public static void Setup()
{
LG_Factory.OnFactoryBuildStart += Action.op_Implicit((Action)SetupCustomLevel);
}
public static void SetupCustomLevel()
{
if (RundownManager.ActiveExpedition.LevelLayoutData == 2008)
{
D2_Fallout.Setup();
}
}
}
public class D2_Fallout
{
private const string HarmonyID = "RLC.D2.LevelGen";
public static void Setup()
{
Harmony.CreateAndPatchAll(typeof(Patch_CM_PageMap_Setup), "RLC.D2.LevelGen");
Harmony.CreateAndPatchAll(typeof(Patch_GS_AfterLevel_CleanupAfterExpedition_D2), "RLC.D2.LevelGen");
Log.Error("Setting up D2 with Harmony ID: RLC.D2.LevelGen");
}
public static void Unload()
{
Harmony.UnpatchID("RLC.D2.LevelGen");
Log.Error("Unloaded D2 With Harmony ID: RLC.D2.LevelGen");
}
}
[HarmonyPatch(typeof(LG_Factory), "Setup")]
internal class Patch_LG_Factory_Setup_D2
{
public static void Postfix()
{
}
public static void Prefix()
{
}
}
[HarmonyPatch(typeof(GS_AfterLevel), "CleanupAfterExpedition")]
internal class Patch_GS_AfterLevel_CleanupAfterExpedition_D2
{
public static void Postfix()
{
Log.Info("Unloading patches for D2");
D2_Fallout.Unload();
}
public static void Prefix()
{
}
}
[HarmonyPatch(typeof(CM_PageMap), "OnEnable")]
internal class Patch_CM_PageMap_Setup
{
public static void Postfix(CM_PageMap __instance)
{
__instance.m_keyboardMoveSpeed = 1000f;
}
}
}
namespace Overload.CustomGearBehavior
{
public class ToolPatches
{
public static void Setup()
{
Harmony.CreateAndPatchAll(typeof(Patch_EnemyScanner_Setup), (string)null);
Log.Info("ToolPatches Setup");
}
}
[HarmonyPatch(typeof(EnemyScanner), "Setup")]
internal class Patch_EnemyScanner_Setup
{
public static void Postfix(EnemyScanner __instance)
{
__instance.m_maxObjs = 40;
__instance.m_maxScanWorldRadius = 160f;
}
}
}